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