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