diff options
Diffstat (limited to 'sysutils/gnome-system-monitor/files/patch-src::proctable.c')
-rw-r--r-- | sysutils/gnome-system-monitor/files/patch-src::proctable.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/sysutils/gnome-system-monitor/files/patch-src::proctable.c b/sysutils/gnome-system-monitor/files/patch-src::proctable.c index fda683104a47..05f4c5384caf 100644 --- a/sysutils/gnome-system-monitor/files/patch-src::proctable.c +++ b/sysutils/gnome-system-monitor/files/patch-src::proctable.c @@ -1,6 +1,6 @@ ---- src/proctable.c.orig Sun Feb 8 10:06:08 2004 -+++ src/proctable.c Tue Apr 13 01:01:51 2004 -@@ -547,6 +548,9 @@ +--- src/proctable.c.orig Mon Jul 19 10:02:09 2004 ++++ src/proctable.c Mon Jul 19 10:08:18 2004 +@@ -563,6 +563,9 @@ glibtop_get_proc_uid (&procuid, pid); glibtop_get_proc_time (&proctime, pid); newcputime = proctime.utime + proctime.stime; @@ -10,38 +10,40 @@ model = gtk_tree_view_get_model (GTK_TREE_VIEW (procdata->tree)); wnck_pid_read_resource_usage (gdk_screen_get_display (gdk_screen_get_default ()), -@@ -651,6 +655,9 @@ +@@ -667,6 +670,10 @@ glibtop_get_proc_uid (&procuid, pid); glibtop_get_proc_time (&proctime, pid); newcputime = proctime.utime + proctime.stime; + if (proctime.frequency) { + newcputime /= (proctime.frequency/100); + } ++ wnck_pid_read_resource_usage (gdk_screen_get_display (gdk_screen_get_default ()), pid, -@@ -751,12 +758,20 @@ - return NULL; +@@ -761,6 +768,12 @@ + return FALSE; } +static int +pid_compare(const void* first, const void* second) +{ -+ return *(unsigned*)first - *(unsigned*)second; ++ return *(unsigned*)first - *(unsigned*)second; +} + static void refresh_list (ProcData *data, unsigned *pid_list, gint n) { - ProcData *procdata = data; - GList *list = procdata->info; +@@ -769,6 +782,8 @@ + GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (procdata->tree)); gint i = 0; -+ -+ qsort(pid_list, n, sizeof (*pid_list), pid_compare); - while (i < n) - { -@@ -848,6 +863,9 @@ ++ qsort(pid_list, n, sizeof (*pid_list), pid_compare); ++ + /* Add or update processes */ + while (i < n) { + ProcInfo *info; +@@ -862,6 +877,9 @@ ** should probably have a total_time_last gint in the ProcInfo structure */ glibtop_get_cpu (&cpu); total_time = cpu.total - total_time_last; |