This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH 2/2] A netdev example
Add a example that cover the network device tapset. This example
just add simple probes and display what is going one with all
the network devices.
Signed-off-by: Breno LeitÃo <leitao@linux.vnet.ibm.com>
---
testsuite/systemtap.examples/network/netdev.stp | 62 +++++++++++++++++++++++
1 files changed, 62 insertions(+), 0 deletions(-)
create mode 100644 testsuite/systemtap.examples/network/netdev.stp
diff --git a/testsuite/systemtap.examples/network/netdev.stp b/testsuite/systemtap.examples/network/netdev.stp
new file mode 100644
index 0000000..42b79c5
--- /dev/null
+++ b/testsuite/systemtap.examples/network/netdev.stp
@@ -0,0 +1,62 @@
+#! /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)
+}
+
+probe netdev.register{
+ printf("Registering netdev %s\n", dev)
+}
+
+probe netdev.unregister{
+ printf("Unregistering netdev %s\n", dev)
+}
+
+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 prosmicuous mode\n", dev)
+ else
+ printf("Device %s leaving prosmicuous mode\n", dev)
+}
+
+probe netdev.change_rx_flag {
+ printf("Device %s is changing its RX flags to %d\n", dev, flags)
+}
+
+probe netdev.change_mtu {
+ printf("Changing MTU on device %s from %d to %d\n", dev,
+ old_mtu, new_mtu)
+}
+
+probe netdev.change_mac {
+ printf("Changing MAC adddres on device %s from %s to %s\n",
+ dev, old_mac, new_mac)
+}
+
+probe netdev.queue_tx {
+ printf("Device %s is sending (queued) a packet with protocol %d\n", dev, protocol)
+}
+
+probe netdev.hard_tx {
+ printf("Device %s is sending (hard) a packet with protocol %d\n", dev, protocol)
+}
+
+probe netdev.rx {
+ printf("Device %s received a packet with protocol %d\n", dev, protocol)
+}
+
+probe netdev.rx_skb {
+ printf("Device %s is going to process a packet with protocol %d\n", dev, protocol)
+}
--
1.6.0.2