author | David Hollister <david.hollister@oracle.com> |
Wed, 12 Oct 2016 14:01:13 -0600 | |
changeset 7094 | 61352b4e5af5 |
parent 5867 | 445e2cf1c845 |
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 Oct 12 07:37:07 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 Tue Oct 12 07:34:41 2010 |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
3 |
@@ -709,7 +709,12 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
4 |
case CPUIDLE: |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
5 |
return ((u_char *) (&cpu_perc[CPU_IDLE])); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
6 |
case CPURAWUSER: |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
7 |
- take_snapshot(&raw_values); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
8 |
+ /* Take the current snapshot */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
9 |
+ if ((take_snapshot(&raw_values) == -1) && (raw_values.css_cpus == 0)) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
10 |
+ snmp_log(LOG_WARNING, |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
11 |
+ "vmstat_solaris2 (var_extensible_vmstat): Something went wrong with take_snapshot.\n"); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
12 |
+ return (NULL); |
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 |
* LINTED has to be 'long' |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
16 |
*/ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
17 |
@@ -723,7 +728,12 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
18 |
* (Has been changed to Counter32 in the latest MIB version!) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
19 |
*/ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
20 |
case CPURAWSYSTEM: |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
21 |
- take_snapshot(&raw_values); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
22 |
+ /* Take the current snapshot */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
23 |
+ if ((take_snapshot(&raw_values) == -1) && (raw_values.css_cpus == 0)) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
24 |
+ snmp_log(LOG_WARNING, |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
25 |
+ "vmstat_solaris2 (var_extensible_vmstat): Something went wrong with take_snapshot.\n"); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
26 |
+ return (NULL); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
27 |
+ } |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
28 |
/* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
29 |
* LINTED has to be 'long' |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
30 |
*/ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
31 |
@@ -732,7 +742,12 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
32 |
raw_values.css_cpu[CPU_WAIT]) / raw_values.css_cpus); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
33 |
return ((u_char *) (&long_ret)); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
34 |
case CPURAWIDLE: |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
35 |
- take_snapshot(&raw_values); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
36 |
+ /* Take the current snapshot */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
37 |
+ if ((take_snapshot(&raw_values) == -1) && (raw_values.css_cpus == 0)) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
38 |
+ snmp_log(LOG_WARNING, |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
39 |
+ "vmstat_solaris2 (var_extensible_vmstat): Something went wrong with take_snapshot.\n"); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
40 |
+ return (NULL); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
41 |
+ } |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
42 |
/* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
43 |
* LINTED has to be 'long' |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
44 |
*/ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
45 |
@@ -740,7 +755,12 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
46 |
(long) (raw_values.css_cpu[CPU_IDLE] / raw_values.css_cpus); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
47 |
return ((u_char *) (&long_ret)); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
48 |
case CPURAWWAIT: |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
49 |
- take_snapshot(&raw_values); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
50 |
+ /* Take the current snapshot */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
51 |
+ if ((take_snapshot(&raw_values) == -1) && (raw_values.css_cpus == 0)) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
52 |
+ snmp_log(LOG_WARNING, |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
53 |
+ "vmstat_solaris2 (var_extensible_vmstat): Something went wrong with take_snapshot.\n"); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
54 |
+ return (NULL); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
55 |
+ } |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
56 |
/* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
57 |
* LINTED has to be 'long' |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
58 |
*/ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
59 |
@@ -748,7 +768,12 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
60 |
(long) (raw_values.css_cpu[CPU_WAIT] / raw_values.css_cpus); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
61 |
return ((u_char *) (&long_ret)); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
62 |
case CPURAWKERNEL: |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
63 |
- take_snapshot(&raw_values); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
64 |
+ /* Take the current snapshot */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
65 |
+ if ((take_snapshot(&raw_values) == -1) && (raw_values.css_cpus == 0)) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
66 |
+ snmp_log(LOG_WARNING, |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
67 |
+ "vmstat_solaris2 (var_extensible_vmstat): Something went wrong with take_snapshot.\n"); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
68 |
+ return (NULL); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
69 |
+ } |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
70 |
/* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
71 |
* LINTED has to be 'long' |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
72 |
*/ |