diff -ruN gnome-system-monitor-2.27.4.orig/src/load-graph.cpp gnome-system-monitor-2.27.4/src/load-graph.cpp
--- gnome-system-monitor-2.27.4.orig/src/load-graph.cpp 2009-08-27 23:28:31.980127645 +0100
+++ gnome-system-monitor-2.27.4/src/load-graph.cpp 2009-08-27 23:33:31.644987867 +0100
@@ -421,7 +421,7 @@
// where factor10 is integer and x < 10
// so we new_max has only 1 significant digit
- unsigned factor10 = std::pow(10.0, std::floor(std::log10(coef10)));
+ unsigned factor10 = std::pow(10.0, std::floor(std::log10((double)coef10)));
coef10 = std::ceil(coef10 / double(factor10)) * factor10;
// then make coef10 divisible by num_bars
@@ -430,11 +430,11 @@
g_assert(coef10 % g->num_bars() == 0);
new_max = coef10 * (1UL << (base10 * 10));
- procman_debug("bak %u new_max %u pow2 %u coef10 %u", bak_max, new_max, pow2, coef10);
+ //procman_debug("bak %u new_max %u pow2 %u coef10 %u", bak_max, new_max, pow2, coef10);
}
if (bak_max > new_max) {
- procman_debug("overflow detected: bak=%u new=%u", bak_max, new_max);
+ //procman_debug("overflow detected: bak=%u new=%u", bak_max, new_max);
new_max = bak_max;
}
@@ -470,6 +470,24 @@
GTimeVal time;
unsigned din, dout;
+ /* we have to optimize the performance of libgtop, because in some low
+ level machine, to update the information will occupy too much cpu.
+
+ Here I would like to make a little update:
+ set netlist.flags=1
+ so as to let glibtop_get_netlist() only return the ones whose first
+ character of name is the same withthe first one in their module,
+ glibtop_get_netload() just try to find these devices, for example,
+ bge0 and bge...
+
+ We do the check in glibtop_get_netlist(), I think this will
+ accelerate the transaction lots. Also this will not affect the
+ existing codes, because when nobody set glibtop_netlist.flags,
+ glibtop_get_netlist() will return all devices with class "net".
+ */
+
+ netlist.flags = 1;
+
ifnames = glibtop_get_netlist(&netlist);
for (i = 0; i < netlist.number; ++i)