gnome-system-monitor-01-solaris.diff revision 8403
8403N/Adiff -Nrup gnome-system-monitor-2.14.1/configure.in gnome-system-monitor-2.14.1.mod/configure.in
8403N/A--- gnome-system-monitor-2.14.1/configure.in 2006-04-10 01:39:27.000000000 +0800
8403N/A+++ gnome-system-monitor-2.14.1.mod/configure.in 2006-06-23 17:17:39.797532000 +0800
8403N/A@@ -31,6 +31,12 @@ GNOME_VFS_REQUIRED=2.6.0
8403N/A LIBGKSUUI_REQUIRED=1.0.0
8403N/A LIBGKSU_REQUIRED=0.15.0
8403N/A
8403N/A+case "$host" in
8403N/A+*-*-solaris*) GMSGFMT_CHECKOPT= ;;
8403N/A+*) GMSGFMT_CHECKOPT=-c ;;
8403N/A+esac
8403N/A+AC_SUBST( GMSGFMT_CHECKOPT)
8403N/A+
8403N/A PKG_CHECK_MODULES(PROCMAN, glib-2.0 >= $GLIB_REQUIRED libgnome-2.0 >= $LIBGNOME_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED gconf-2.0 >= $GCONF_REQUIRED libgtop-2.0 >= $LIBGTOP_REQUIRED libwnck-1.0 >= $LIBWNCK_REQUIRED gtk+-2.0 >= $GTK_REQUIRED gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED)
8403N/A
8403N/A
8403N/Adiff -Nrup gnome-system-monitor-2.14.1/po/Makefile.in.in gnome-system-monitor-2.14.1.mod/po/Makefile.in.in
8403N/A--- gnome-system-monitor-2.14.1/po/Makefile.in.in 2006-04-10 19:51:06.000000000 +0800
8403N/A+++ gnome-system-monitor-2.14.1.mod/po/Makefile.in.in 2006-06-23 17:19:28.802301000 +0800
8403N/A@@ -48,6 +48,7 @@ INSTALL_DATA = @INSTALL_DATA@
8403N/A
8403N/A CC = @CC@
8403N/A GMSGFMT = @GMSGFMT@
8403N/A+GMSGFMT_CHECKOPT = @GMSGFMT_CHECKOPT@
8403N/A MSGFMT = @MSGFMT@
8403N/A XGETTEXT = @XGETTEXT@
8403N/A INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
8403N/A@@ -90,7 +91,7 @@ CATOBJEXT = @CATOBJEXT@
8403N/A
8403N/A .po.gmo:
8403N/A file=`echo $* | sed 's,.*/,,'`.gmo \
8403N/A- && rm -f $$file && $(GMSGFMT) -o $$file $<
8403N/A+ && rm -f $$file && $(GMSGFMT) -o $(GMSGFMT_CHECKOPT) $$file $<
8403N/A
8403N/A .po.cat:
8403N/A sed -f ../intl/po2msg.sed < $< > $*.msg \
8403N/Adiff -Nrup gnome-system-monitor-2.14.1/src/callbacks.c gnome-system-monitor-2.14.1.mod/src/callbacks.c
8403N/A--- gnome-system-monitor-2.14.1/src/callbacks.c 2005-09-04 10:49:43.000000000 +0800
8403N/A+++ gnome-system-monitor-2.14.1.mod/src/callbacks.c 2006-07-19 18:47:13.274807000 +0800
8403N/A@@ -371,7 +371,6 @@ cb_change_current_page (GtkNotebook *nb,
8403N/A
8403N/A
8403N/A if (num == 0) {
8403N/A-
8403N/A cb_timeout (procdata);
8403N/A
8403N/A if (!procdata->timeout)
8403N/A@@ -450,7 +449,11 @@ cb_timeout (gpointer data)
8403N/A return FALSE;
8403N/A }
8403N/A
8403N/A- return TRUE;
8403N/A+ procdata->timeout = g_timeout_add(new_interval,
8403N/A+ cb_timeout,
8403N/A+ procdata);
8403N/A+
8403N/A+ return FALSE;
8403N/A }
8403N/A
8403N/A
8403N/Adiff -Nrup gnome-system-monitor-2.14.1/src/load-graph.c gnome-system-monitor-2.14.1.mod/src/load-graph.c
8403N/A--- gnome-system-monitor-2.14.1/src/load-graph.c 2006-04-10 00:46:29.000000000 +0800
8403N/A+++ gnome-system-monitor-2.14.1.mod/src/load-graph.c 2006-07-07 14:16:03.034343000 +0800
8403N/A@@ -26,6 +26,10 @@
8403N/A
8403N/A #define NUM_POINTS 100
8403N/A #define GRAPH_MIN_HEIGHT 30
8403N/A+/*static const unsigned needed_netload_flags =
8403N/A+(1 << GLIBTOP_NETLOAD_IF_FLAGS) +
8403N/A+(1 << GLIBTOP_NETLOAD_BYTES_TOTAL);
8403N/A+*/
8403N/A
8403N/A
8403N/A enum {
8403N/A@@ -71,7 +75,7 @@ struct _LoadGraph {
8403N/A GTimeVal time;
8403N/A float max;
8403N/A } net;
8403N/A- };
8403N/A+ }category;
8403N/A };
8403N/A
8403N/A
8403N/A@@ -206,8 +210,8 @@ get_load (LoadGraph *g)
8403N/A
8403N/A #undef NOW
8403N/A #undef LAST
8403N/A-#define NOW (g->cpu.times[g->cpu.now])
8403N/A-#define LAST (g->cpu.times[g->cpu.now ^ 1])
8403N/A+#define NOW (g->category.cpu.times[g->category.cpu.now])
8403N/A+#define LAST (g->category.cpu.times[g->category.cpu.now ^ 1])
8403N/A
8403N/A if (g->n == 1) {
8403N/A NOW[0][CPU_TOTAL] = cpu.total;
8403N/A@@ -220,9 +224,9 @@ get_load (LoadGraph *g)
8403N/A }
8403N/A }
8403N/A
8403N/A- if (G_UNLIKELY(!g->cpu.initialized)) {
8403N/A+ if (G_UNLIKELY(!g->category.cpu.initialized)) {
8403N/A /* No data yet */
8403N/A- g->cpu.initialized = TRUE;
8403N/A+ g->category.cpu.initialized = TRUE;
8403N/A } else {
8403N/A for (i = 0; i < g->n; i++) {
8403N/A float load;
8403N/A@@ -242,7 +246,7 @@ get_load (LoadGraph *g)
8403N/A }
8403N/A }
8403N/A
8403N/A- g->cpu.now ^= 1;
8403N/A+ g->category.cpu.now ^= 1;
8403N/A
8403N/A #undef NOW
8403N/A #undef LAST
8403N/A@@ -293,7 +297,7 @@ static void
8403N/A net_scale (LoadGraph *g, float new_max)
8403N/A {
8403N/A gint i;
8403N/A- float old_max = MAX (g->net.max, 1.0f), scale;
8403N/A+ float old_max = MAX (g->category.net.max, 1.0f), scale;
8403N/A
8403N/A if (new_max <= old_max)
8403N/A return;
8403N/A@@ -307,7 +311,8 @@ net_scale (LoadGraph *g, float new_max)
8403N/A }
8403N/A }
8403N/A
8403N/A- g->net.max = new_max;
8403N/A+
8403N/A+ g->category.net.max = new_max;
8403N/A }
8403N/A
8403N/A static void
8403N/A@@ -328,12 +333,17 @@ get_net (LoadGraph *g)
8403N/A glibtop_netload netload;
8403N/A glibtop_get_netload (&netload, ifnames[i]);
8403N/A
8403N/A+/* if ((netload.flags & needed_netload_flags) != needed_netload_flags)
8403N/A+ continue;
8403N/A+ if (!(netload.if_flags & (1L << GLIBTOP_IF_FLAGS_UP)))
8403N/A+ continue;
8403N/A+*/
8403N/A if (netload.if_flags & (1 << GLIBTOP_IF_FLAGS_LOOPBACK))
8403N/A continue;
8403N/A-
8403N/A+
8403N/A /* Don't skip interfaces that are down (GLIBTOP_IF_FLAGS_UP)
8403N/A to avoid spikes when they are brought up */
8403N/A-
8403N/A+
8403N/A in += netload.bytes_in;
8403N/A out += netload.bytes_out;
8403N/A }
8403N/A@@ -342,13 +352,13 @@ get_net (LoadGraph *g)
8403N/A
8403N/A g_get_current_time (&time);
8403N/A
8403N/A- if (in >= g->net.last_in && out >= g->net.last_out &&
8403N/A- g->net.time.tv_sec != 0) {
8403N/A+ if (in >= g->category.net.last_in && out >= g->category.net.last_out &&
8403N/A+ g->category.net.time.tv_sec != 0) {
8403N/A float dtime;
8403N/A- dtime = time.tv_sec - g->net.time.tv_sec +
8403N/A- (float) (time.tv_usec - g->net.time.tv_usec) / G_USEC_PER_SEC;
8403N/A- din = (in - g->net.last_in) / dtime;
8403N/A- dout = (out - g->net.last_out) / dtime;
8403N/A+ dtime = time.tv_sec - g->category.net.time.tv_sec +
8403N/A+ (float) (time.tv_usec - g->category.net.time.tv_usec) / G_USEC_PER_SEC;
8403N/A+ din = (in - g->category.net.last_in) / dtime;
8403N/A+ dout = (out - g->category.net.last_out) / dtime;
8403N/A } else {
8403N/A /* Don't calc anything if new data is less than old (interface
8403N/A removed, counters reset, ...) or if it is the first time */
8403N/A@@ -356,15 +366,16 @@ get_net (LoadGraph *g)
8403N/A dout = 0.0f;
8403N/A }
8403N/A
8403N/A- g->net.last_in = in;
8403N/A- g->net.last_out = out;
8403N/A- g->net.time = time;
8403N/A+ g->category.net.last_in = in;
8403N/A+ g->category.net.last_out = out;
8403N/A+ g->category.net.time = time;
8403N/A
8403N/A- g->data[0][0] = din / MAX(g->net.max, 1.0f);
8403N/A- g->data[0][1] = dout / MAX(g->net.max, 1.0f);
8403N/A
8403N/A+ g->data[0][0] = din / MAX(g->category.net.max, 1.0f);
8403N/A+ g->data[0][1] = dout / MAX(g->category.net.max, 1.0f);
8403N/A+
8403N/A net_scale (g, MAX (din, dout));
8403N/A-
8403N/A+
8403N/A text1 = SI_gnome_vfs_format_file_size_for_display (din);
8403N/A text2 = g_strdup_printf (_("%s/s"), text1);
8403N/A gtk_label_set_text (GTK_LABEL (g->labels.net_in), text2);
8403N/Adiff -Nrup gnome-system-monitor-2.14.1/src/procdialogs.c gnome-system-monitor-2.14.1.mod/src/procdialogs.c
8403N/A--- gnome-system-monitor-2.14.1/src/procdialogs.c 2006-04-10 01:19:39.000000000 +0800
8403N/A+++ gnome-system-monitor-2.14.1.mod/src/procdialogs.c 2006-07-08 02:26:05.271840000 +0800
8403N/A@@ -333,7 +333,7 @@ smooth_refresh_toggled(GtkToggleButton *
8403N/A
8403N/A gboolean toggled;
8403N/A
8403N/A- toggled = gtk_toggle_button_get_active(button);
8403N/A+ toggled = TRUE; /*gtk_toggle_button_get_active(button);*/
8403N/A
8403N/A gconf_client_set_bool(client, SMOOTH_REFRESH_KEY, toggled, NULL);
8403N/A }
8403N/Adiff -Nrup gnome-system-monitor-2.14.1/src/proctable.c gnome-system-monitor-2.14.1.mod/src/proctable.c
8403N/A--- gnome-system-monitor-2.14.1/src/proctable.c 2006-02-27 17:44:35.000000000 +0800
8403N/A+++ gnome-system-monitor-2.14.1.mod/src/proctable.c 2006-07-19 18:47:48.938626000 +0800
8403N/A@@ -53,7 +53,6 @@
8403N/A #include "selinux.h"
8403N/A #include "e_date.h"
8403N/A
8403N/A-
8403N/A static guint64 total_time = 1;
8403N/A static guint64 total_time_last = 1;
8403N/A
8403N/A@@ -533,16 +532,19 @@ get_process_memory_info(ProcInfo *info)
8403N/A wnck_pid_read_resource_usage (gdk_screen_get_display (gdk_screen_get_default ()),
8403N/A info->pid,
8403N/A &xresources);
8403N/A+ info->memxserver = xresources.total_bytes_estimate;
8403N/A+
8403N/A+ get_process_memory_writable(info);
8403N/A
8403N/A glibtop_get_proc_mem(&procmem, info->pid);
8403N/A-
8403N/A info->vmsize = procmem.vsize;
8403N/A info->memres = procmem.resident;
8403N/A- info->memshared = procmem.share;
8403N/A-
8403N/A- info->memxserver = xresources.total_bytes_estimate;
8403N/A+ info->memshared = procmem.share;
8403N/A+
8403N/A+#ifdef __sun
8403N/A+ info->pcpu = procmem.load;
8403N/A+#endif
8403N/A
8403N/A- get_process_memory_writable(info);
8403N/A }
8403N/A
8403N/A
8403N/A@@ -795,15 +797,16 @@ update_info (ProcData *procdata, ProcInf
8403N/A glibtop_get_proc_uid (&procuid, info->pid);
8403N/A glibtop_get_proc_time (&proctime, info->pid);
8403N/A
8403N/A- get_process_memory_info(info);
8403N/A get_process_user(procdata, info, procstate.uid);
8403N/A-
8403N/A- info->pcpu = (proctime.rtime - info->cpu_time_last) * 100 / total_time;
8403N/A- info->pcpu = MIN(info->pcpu, 100);
8403N/A-
8403N/A- info->cpu_time_last = proctime.rtime;
8403N/A+ info->pcpu = (proctime.rtime - info->cpu_time_last) * 100 / total_time;
8403N/A+ info->pcpu = MIN(info->pcpu, 100);
8403N/A+
8403N/A+ /* there is a bug here, because info can't store cpu_time_last, it's only a temporary variable in refresh_list() */
8403N/A+ info->cpu_time_last = proctime.rtime;
8403N/A info->nice = procuid.nice;
8403N/A-
8403N/A+
8403N/A+ /* if at Solaris, in get_process_memory_info() info->pcpu will get again from glibtop_get_proc_mem() */
8403N/A+ get_process_memory_info(info);
8403N/A
8403N/A model = gtk_tree_view_get_model (GTK_TREE_VIEW (procdata->tree));
8403N/A
8403N/A@@ -963,8 +966,9 @@ proctable_update_list (ProcData * const
8403N/A /* FIXME: total cpu time elapsed should be calculated on an individual basis here
8403N/A ** should probably have a total_time_last gint in the ProcInfo structure */
8403N/A glibtop_get_cpu (&cpu);
8403N/A- total_time = MAX(cpu.total - total_time_last, 1);
8403N/A- total_time_last = cpu.total;
8403N/A+ /* total is normally is 1/100 second, if transfer to second, have to divide by frequency */
8403N/A+ total_time = MAX(cpu.total / cpu.frequency - total_time_last, 1);
8403N/A+ total_time_last = cpu.total / cpu.frequency;
8403N/A
8403N/A refresh_list (procdata, pid_list, proclist.number);
8403N/A
8403N/Adiff -Nrup gnome-system-monitor-2.14.1/src/smooth_refresh.c gnome-system-monitor-2.14.1.mod/src/smooth_refresh.c
8403N/A--- gnome-system-monitor-2.14.1/src/smooth_refresh.c 2005-12-28 00:14:59.000000000 +0800
8403N/A+++ gnome-system-monitor-2.14.1.mod/src/smooth_refresh.c 2006-07-19 18:47:58.412015000 +0800
8403N/A@@ -181,8 +181,10 @@ smooth_refresh_get(SmoothRefresh *sm, gu
8403N/A gboolean changed;
8403N/A float pcpu;
8403N/A
8403N/A- if (!sm->active)
8403N/A+ if (!sm->active){
8403N/A+ *new_interval = sm->interval;
8403N/A return FALSE;
8403N/A+ }
8403N/A
8403N/A pcpu = get_own_cpu_usage(sm);
8403N/A /*
8403N/A@@ -241,6 +243,8 @@ smooth_refresh_get(SmoothRefresh *sm, gu
8403N/A *sm->config_interval,
8403N/A ctime(&now));
8403N/A }
8403N/A+ else
8403N/A+ *new_interval = sm->interval;
8403N/A
8403N/A g_assert(sm->interval == *new_interval);
8403N/A g_assert(sm->interval >= *sm->config_interval);