freebsd-ports/sysutils/gnomesystemmonitor/files/patch-src::proctable.c
Joe Marcus Clarke e18151212d Presenting GNOME 2.12 for FreeBSD. The release is chock full of bug fixes
and new features.  Don't believe me?  Then see for yourself at
http://www.gnome.org/start/2.12/notes/en/.

DO NOT USE portupgrade by itself to upgrade to GNOME 2.12.  Instead, use
the gnome_upgrade.sh script from
http://www.marcuscom.com/downloads/gnome_upgrade212.sh.  This script will
circumvent some potential pitfalls users can see if they use portupgrade
by itself.

In keeping with tradition, GNOME 2.12 for FreeBSD comes with a special
splash screen.  The winner of this release's contest is
Dominique Goncalves <dominique.goncalves@gmail.com>.  His splash screen
was inspired by http://art.gnome.org/contests/2.12-splash/83.

The FreeBSD GNOME Team would lank to thank the following users for
their contributions to this release:

Matthew Luckie <mjl@luckie.org.nz>
ade
sajd on #freebsd-gnome
Caelian on #freebsd-gnome
mnag
Yasuda Keisuke <kysd@po.harenet.ne.jp>
Mark Hobden <markhobden@gmail.com>
Sergey Akifyev <asa@agava.com>
Andreas Kohn

For more information on GNOME on FreeBSD, checkout
http://www.FreeBSD.org/gnome/.  The 2.12 documentation will be
posted shortly.
2005-11-05 04:53:48 +00:00

31 lines
966 B
C

--- src/proctable.c.orig Fri Jul 22 18:58:42 2005
+++ src/proctable.c Mon Jul 25 22:25:58 2005
@@ -853,6 +853,12 @@ static void cb_exclude(ProcInfo* info, G
}
+static int
+pid_compare(const void* first, const void* second)
+{
+ return *(unsigned*)first - *(unsigned*)second;
+}
+
static void
refresh_list (ProcData *procdata, const unsigned *pid_list, const guint n)
{
@@ -945,10 +951,15 @@ proctable_update_list (ProcData * const
pid_list = glibtop_get_proclist (&proclist, which, arg);
+ qsort(pid_list, proclist.number, sizeof (*pid_list), pid_compare);
+
/* FIXME: total cpu time elapsed should be calculated on an individual basis here
** should probably have a total_time_last gint in the ProcInfo structure */
glibtop_get_cpu (&cpu);
total_time = MAX(cpu.total - total_time_last, 1);
+ if (cpu.frequency) {
+ total_time /= (cpu.frequency/100);
+ }
total_time_last = cpu.total;
refresh_list (procdata, pid_list, proclist.number);