16402
|
1 |
diff -ruN gnome-system-monitor-2.27.4.orig/src/load-graph.cpp gnome-system-monitor-2.27.4/src/load-graph.cpp
|
|
2 |
--- gnome-system-monitor-2.27.4.orig/src/load-graph.cpp 2009-08-27 23:28:31.980127645 +0100
|
|
3 |
+++ gnome-system-monitor-2.27.4/src/load-graph.cpp 2009-08-27 23:33:31.644987867 +0100
|
|
4 |
@@ -421,7 +421,7 @@
|
|
5 |
// where factor10 is integer and x < 10
|
|
6 |
// so we new_max has only 1 significant digit
|
|
7 |
|
|
8 |
- unsigned factor10 = std::pow(10.0, std::floor(std::log10(coef10)));
|
|
9 |
+ unsigned factor10 = std::pow(10.0, std::floor(std::log10((double)coef10)));
|
|
10 |
coef10 = std::ceil(coef10 / double(factor10)) * factor10;
|
|
11 |
|
|
12 |
// then make coef10 divisible by num_bars
|
|
13 |
@@ -430,11 +430,11 @@
|
|
14 |
g_assert(coef10 % g->num_bars() == 0);
|
|
15 |
|
|
16 |
new_max = coef10 * (1UL << (base10 * 10));
|
|
17 |
- procman_debug("bak %u new_max %u pow2 %u coef10 %u", bak_max, new_max, pow2, coef10);
|
|
18 |
+ //procman_debug("bak %u new_max %u pow2 %u coef10 %u", bak_max, new_max, pow2, coef10);
|
|
19 |
}
|
|
20 |
|
|
21 |
if (bak_max > new_max) {
|
|
22 |
- procman_debug("overflow detected: bak=%u new=%u", bak_max, new_max);
|
|
23 |
+ //procman_debug("overflow detected: bak=%u new=%u", bak_max, new_max);
|
|
24 |
new_max = bak_max;
|
|
25 |
}
|
|
26 |
|
|
27 |
@@ -470,6 +470,24 @@
|
|
28 |
GTimeVal time;
|
|
29 |
unsigned din, dout;
|
|
30 |
|
|
31 |
+ /* we have to optimize the performance of libgtop, because in some low
|
|
32 |
+ level machine, to update the information will occupy too much cpu.
|
|
33 |
+
|
|
34 |
+ Here I would like to make a little update:
|
|
35 |
+ set netlist.flags=1
|
|
36 |
+ so as to let glibtop_get_netlist() only return the ones whose first
|
|
37 |
+ character of name is the same withthe first one in their module,
|
|
38 |
+ glibtop_get_netload() just try to find these devices, for example,
|
|
39 |
+ bge0 and bge...
|
|
40 |
+
|
|
41 |
+ We do the check in glibtop_get_netlist(), I think this will
|
|
42 |
+ accelerate the transaction lots. Also this will not affect the
|
|
43 |
+ existing codes, because when nobody set glibtop_netlist.flags,
|
|
44 |
+ glibtop_get_netlist() will return all devices with class "net".
|
|
45 |
+ */
|
|
46 |
+
|
|
47 |
+ netlist.flags = 1;
|
|
48 |
+
|
|
49 |
ifnames = glibtop_get_netlist(&netlist);
|
|
50 |
|
|
51 |
for (i = 0; i < netlist.number; ++i)
|