summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/network
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-09-17 20:36:24 -0400
committerDave Brolley <brolley@redhat.com>2009-09-17 20:36:24 -0400
commit762684a57fa5420cc122b475f592545e8eeb29cd (patch)
treec1b55657f1aff31e7298d76852bbe8522a84db13 /testsuite/systemtap.examples/network
parent8afee8bbf045e858dae186d40653293c99dbbcdd (diff)
parent6bde4f381475cea055352d8ad5f60bb2f24de21d (diff)
downloadsystemtap-steved-762684a57fa5420cc122b475f592545e8eeb29cd.tar.gz
systemtap-steved-762684a57fa5420cc122b475f592545e8eeb29cd.tar.xz
systemtap-steved-762684a57fa5420cc122b475f592545e8eeb29cd.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'testsuite/systemtap.examples/network')
-rw-r--r--testsuite/systemtap.examples/network/netdev.meta13
-rwxr-xr-xtestsuite/systemtap.examples/network/netdev.stp58
2 files changed, 71 insertions, 0 deletions
diff --git a/testsuite/systemtap.examples/network/netdev.meta b/testsuite/systemtap.examples/network/netdev.meta
new file mode 100644
index 00000000..e467a66a
--- /dev/null
+++ b/testsuite/systemtap.examples/network/netdev.meta
@@ -0,0 +1,13 @@
+title: Trace Activity on Network Devices
+name: netdev.stp
+version: 1.0
+author: Breno Leitao
+keywords: network device traffic
+subsystem: network
+status: production
+exit: user-controlled
+output: trace
+scope: system-wide
+description: The netdev.stp script traces configuration and transmit/receive activity on network devices.
+test_check: stap -p4 netdev.stp
+test_installcheck: stap netdev.stp -c "sleep 0.2"
diff --git a/testsuite/systemtap.examples/network/netdev.stp b/testsuite/systemtap.examples/network/netdev.stp
new file mode 100755
index 00000000..faf4d2ae
--- /dev/null
+++ b/testsuite/systemtap.examples/network/netdev.stp
@@ -0,0 +1,58 @@
+#! /usr/bin/env stap
+
+############################################################
+# netdev.stp
+# Author: Breno Leitao <leitao@linux.vnet.ibm.com>
+# An example script to show how a netdev works and its
+# functions
+############################################################
+
+
+probe netdev.get_stats{
+ printf("%s was asked for statistics structure\n", dev_name)
+}
+
+probe netdev.register{
+ printf("Registering netdev_name %s\n", dev_name)
+}
+
+probe netdev.unregister{
+ printf("Unregistering netdev %s\n", dev_name)
+}
+
+probe netdev.ioctl{
+ printf("Netdev ioctl raised with param: %d and arg: %s\n", cmd, arg)
+}
+
+probe netdev.set_promiscuity {
+ if (enable)
+ printf("Device %s entering in promiscuous mode\n", dev_name)
+ else
+ printf("Device %s leaving promiscuous mode\n", dev_name)
+}
+
+probe netdev.change_rx_flag {
+ printf("Device %s is changing its RX flags to %d\n", dev_name, flags)
+}
+
+probe netdev.change_mtu {
+ printf("Changing MTU on device %s from %d to %d\n", dev_name,
+ old_mtu, new_mtu)
+}
+
+probe netdev.change_mac {
+ printf("Changing MAC address on device %s from %s to %s\n",
+ dev_name, old_mac, new_mac)
+}
+
+probe netdev.transmit {
+ printf("Device %s is sending (queued) a packet with protocol %d\n", dev_name, protocol)
+}
+
+probe netdev.hard_transmit {
+ printf("Device %s is sending (hard) a packet with protocol %d\n", dev_name, protocol)
+}
+
+probe netdev.rx {
+ printf("Device %s received a packet with protocol %d\n", dev_name, protocol)
+}