author | Geoffrey Gardella <geoffrey.gardella@oracle.com> |
Fri, 15 May 2015 14:07:20 -0700 | |
changeset 4298 | aa030c46708c |
parent 252 | ee0fb1eabcbf |
permissions | -rw-r--r-- |
252
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
1 |
--- patch/net-snmp-5.4.1/agent/mibgroup/ucd-snmp/vmstat_solaris2.c Tue Aug 3 06:04:52 2010 |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
2 |
+++ net-snmp-5.4.1/agent/mibgroup/ucd-snmp/vmstat_solaris2.c Wed Oct 6 01:27:48 2010 |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
3 |
@@ -589,6 +589,13 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
4 |
cpu_sum += (css_new->css_cpu[i] - css_old->css_cpu[i]); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
5 |
} |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
6 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
7 |
+ /* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
8 |
+ * Assign a minimum value to get around divide by zero case |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
9 |
+ */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
10 |
+ if (cpu_sum == 0) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
11 |
+ cpu_sum = 1; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
12 |
+ } |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
13 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
14 |
/* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
15 |
* Now calculate the absolute percentage values |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
16 |
* Looks somewhat complicated sometimes but tries to get around using floats to increase speed |