summaryrefslogtreecommitdiffstats
path: root/testsuite/buildok
diff options
context:
space:
mode:
authorDavid J. Wilder <wilder@wilder.ibm.com>2009-07-16 16:47:01 -0700
committerDavid J. Wilder <wilder@wilder.ibm.com>2009-07-16 16:47:01 -0700
commit5a80613abf2b6e0d50575fcacebb92f415ab2d0f (patch)
treed710c715f21c1231b67c30fc4a7bc5a344a98dc4 /testsuite/buildok
parent88eaee9fc6d629529e47820525080f26775a9ba6 (diff)
downloadsystemtap-steved-5a80613abf2b6e0d50575fcacebb92f415ab2d0f.tar.gz
systemtap-steved-5a80613abf2b6e0d50575fcacebb92f415ab2d0f.tar.xz
systemtap-steved-5a80613abf2b6e0d50575fcacebb92f415ab2d0f.zip
This SNMP group of tapsets provides probes used to count SNMP management
events. The probes mirror many of the SNMP statistics defined in /usr/include/linux/snmp.h. Each probe represents a single SNMP statistic or MIB. Each of the probe's handler is called when system performs an operation that would alter the associated statistic. Along with each probe is defined an indexed set of counters used to record probe hits. The probe handlers call a user supplied callback functions to determine which counter to alter. The user's callback should returns a key value that will be used to index the counter. For example a callback could return a unique value for each socket. This would results in a separate counter being used for each socket. tcpipstat.stp shows how snmp tapsets could be used. Tcpipstat collects and displays network statistics related to individual TCP sockets or groups of sockets. The statistics that are collected are simmer to that of the command netstat -s, only sorted and grouped by individual sockets. Signed-off-by: David Wilder <dwilder@us.ibm.com>
Diffstat (limited to 'testsuite/buildok')
-rw-r--r--testsuite/buildok/ipmib-all-probes.stp15
-rw-r--r--testsuite/buildok/linuxmib-all-probes.stp9
-rw-r--r--testsuite/buildok/tcpmib-all-probes.stp15
3 files changed, 39 insertions, 0 deletions
diff --git a/testsuite/buildok/ipmib-all-probes.stp b/testsuite/buildok/ipmib-all-probes.stp
new file mode 100644
index 00000000..b6bedcf7
--- /dev/null
+++ b/testsuite/buildok/ipmib-all-probes.stp
@@ -0,0 +1,15 @@
+#! stap -p4
+
+// Tests if all probes in the ipmib tapset are resolvable.
+
+probe ipmib.* {}
+
+function ipmib_filter_key:long (skb:long, op:long, SourceIsLocal:long) {
+ // Insure all these functions will build
+ if ( ipmib_remote_addr(skb, SourceIsLocal) ) return 0
+ if ( ipmib_local_addr(skb, SourceIsLocal) ) return 0
+ if ( ipmib_tcp_remote_port(skb, SourceIsLocal) ) return 0
+ if ( ipmib_tcp_local_port(skb, SourceIsLocal) ) return 0
+ if ( ipmib_get_proto(skb) ) return 0
+ return op
+}
diff --git a/testsuite/buildok/linuxmib-all-probes.stp b/testsuite/buildok/linuxmib-all-probes.stp
new file mode 100644
index 00000000..c79fc7d3
--- /dev/null
+++ b/testsuite/buildok/linuxmib-all-probes.stp
@@ -0,0 +1,9 @@
+#! stap -p4
+
+// Tests if all probes in the linuxmib tapset are resolvable.
+
+probe linuxmib.* {}
+
+function linuxmib_filter_key:long (sk:long, op:long) {
+ return 0
+}
diff --git a/testsuite/buildok/tcpmib-all-probes.stp b/testsuite/buildok/tcpmib-all-probes.stp
new file mode 100644
index 00000000..f20ba8bb
--- /dev/null
+++ b/testsuite/buildok/tcpmib-all-probes.stp
@@ -0,0 +1,15 @@
+#! stap -p4
+
+// Tests if all probes in the tcpmib tapset are resolvable.
+
+probe tcpmib.* {}
+
+function tcpmib_filter_key:long (sk:long, op:long) {
+ // Insure all these functions will build
+ if ( tcpmib_get_state(sk) ) return 0
+ if ( tcpmib_local_addr(sk) ) return 0
+ if ( tcpmib_remote_addr(sk) ) return 0
+ if ( tcpmib_local_port(sk) ) return 0
+ if ( tcpmib_remote_port(sk) ) return 0
+ return op
+}