mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Add copyright statement.
2005-11-04 Soren Sandmann <sandmann@redhat.com> * collector.[ch]: Add copyright statement. * collector.c (on_read): Handle time getting set backwards. * collector.c: Remove unused empty_filedescriptor() function.
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
5bddcf4af9
commit
cf761a2a70
@ -1,3 +1,11 @@
|
||||
2005-11-04 Soren Sandmann <sandmann@redhat.com>
|
||||
|
||||
* collector.[ch]: Add copyright statement.
|
||||
|
||||
* collector.c (on_read): Handle time getting set backwards.
|
||||
|
||||
* collector.c: Remove unused empty_filedescriptor() function.
|
||||
|
||||
2005-11-03 Soren Sandmann <sandmann@redhat.com>
|
||||
|
||||
* configure.ac: Make the message about the kernel source package
|
||||
|
||||
48
collector.c
48
collector.c
@ -1,3 +1,22 @@
|
||||
/* Sysprof -- Sampling, systemwide CPU profiler
|
||||
* Copyright 2004, Red Hat, Inc.
|
||||
* Copyright 2004, 2005, Soeren Sandmann
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "stackstash.h"
|
||||
#include "collector.h"
|
||||
#include "module/sysprof-module.h"
|
||||
@ -89,6 +108,7 @@ on_read (gpointer data)
|
||||
Collector *collector = data;
|
||||
GTimeVal now;
|
||||
int rd;
|
||||
double diff;
|
||||
|
||||
rd = read (collector->fd, &trace, sizeof (trace));
|
||||
|
||||
@ -100,8 +120,9 @@ on_read (gpointer data)
|
||||
/* After a reset we ignore samples for a short period so that
|
||||
* a reset will actually cause 'samples' to become 0
|
||||
*/
|
||||
/* FIXME: handle time getting set back */
|
||||
if (time_diff (&now, &collector->latest_reset) < RESET_DEAD_PERIOD)
|
||||
diff = time_diff (&now, &collector->latest_reset);
|
||||
|
||||
if (diff >= 0.0 && diff < RESET_DEAD_PERIOD)
|
||||
return;
|
||||
|
||||
#if 0
|
||||
@ -160,16 +181,6 @@ open_fd (Collector *collector,
|
||||
if (fd < 0)
|
||||
{
|
||||
/* FIXME: set error */
|
||||
#if 0
|
||||
sorry (app->main_window,
|
||||
"Can't open /proc/sysprof-trace. You need to insert\n"
|
||||
"the sysprof kernel module. Run\n"
|
||||
"\n"
|
||||
" modprobe sysprof-module\n"
|
||||
"\n"
|
||||
"as root.");
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@ -180,19 +191,6 @@ open_fd (Collector *collector,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
empty_file_descriptor (Collector *collector)
|
||||
{
|
||||
int rd;
|
||||
SysprofStackTrace trace;
|
||||
|
||||
do
|
||||
{
|
||||
rd = read (collector->fd, &trace, sizeof (trace));
|
||||
|
||||
} while (rd != -1); /* until EWOULDBLOCK */
|
||||
}
|
||||
|
||||
gboolean
|
||||
collector_start (Collector *collector,
|
||||
GError **err)
|
||||
|
||||
19
collector.h
19
collector.h
@ -1,3 +1,22 @@
|
||||
/* Sysprof -- Sampling, systemwide CPU profiler
|
||||
* Copyright 2004, Red Hat, Inc.
|
||||
* Copyright 2004, 2005, Soeren Sandmann
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "profile.h"
|
||||
|
||||
typedef struct Collector Collector;
|
||||
|
||||
@ -251,7 +251,7 @@ static int timer_notify (struct pt_regs *regs)
|
||||
i = 0;
|
||||
if (!is_user)
|
||||
{
|
||||
trace->addresses[i++] = 0x01;
|
||||
trace->addresses[i++] = (void *)0x01;
|
||||
regs = (void *)current->thread.esp0 - sizeof (struct pt_regs);
|
||||
}
|
||||
|
||||
|
||||
@ -149,7 +149,7 @@ create_process (const char *cmdline, int pid)
|
||||
p->maps = NULL;
|
||||
p->pid = pid;
|
||||
p->undefined.name = NULL;
|
||||
p->undefined.address = NULL;
|
||||
p->undefined.address = 0x00;
|
||||
|
||||
g_assert (!g_hash_table_lookup (processes_by_pid, GINT_TO_POINTER (pid)));
|
||||
g_assert (!g_hash_table_lookup (processes_by_cmdline, cmdline));
|
||||
|
||||
10
sysprof.c
10
sysprof.c
@ -231,7 +231,8 @@ update_sensitivity (Application *app)
|
||||
}
|
||||
|
||||
static void
|
||||
set_busy (GtkWidget *widget, gboolean busy)
|
||||
set_busy (GtkWidget *widget,
|
||||
gboolean busy)
|
||||
{
|
||||
GdkCursor *cursor;
|
||||
|
||||
@ -547,8 +548,8 @@ fill_descendants_tree (Application *app)
|
||||
}
|
||||
|
||||
static void
|
||||
add_callers (GtkListStore *list_store,
|
||||
Profile *profile,
|
||||
add_callers (GtkListStore *list_store,
|
||||
Profile *profile,
|
||||
ProfileCaller *callers)
|
||||
{
|
||||
while (callers)
|
||||
@ -1339,7 +1340,8 @@ load_file (gpointer data)
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
main (int argc,
|
||||
char **argv)
|
||||
{
|
||||
Application *app;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user