From 3bdb66294bfbe8c388cb6dea5e8f2a55971cb92b Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Wed, 16 Sep 2009 14:37:17 -0400 Subject: A network device 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: Josh Stone --- testsuite/systemtap.examples/network/netdev.stp | 58 +++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100755 testsuite/systemtap.examples/network/netdev.stp (limited to '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 100755 index 00000000..64c8167a --- /dev/null +++ b/testsuite/systemtap.examples/network/netdev.stp @@ -0,0 +1,58 @@ +#! /usr/bin/env stap + +############################################################ +# netdev.stp +# Author: Breno Leitao +# 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 prosmicuous mode\n", dev_name) + else + printf("Device %s leaving prosmicuous 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 adddres 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) +} -- cgit From ad7e33d7ceb3251f5141b586dad4f824c519d757 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 16 Sep 2009 15:16:47 -0700 Subject: Spelling fixes in the meta of many examples --- testsuite/systemtap.examples/network/netdev.stp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'testsuite/systemtap.examples/network/netdev.stp') diff --git a/testsuite/systemtap.examples/network/netdev.stp b/testsuite/systemtap.examples/network/netdev.stp index 64c8167a..faf4d2ae 100755 --- a/testsuite/systemtap.examples/network/netdev.stp +++ b/testsuite/systemtap.examples/network/netdev.stp @@ -26,9 +26,9 @@ probe netdev.ioctl{ probe netdev.set_promiscuity { if (enable) - printf("Device %s entering in prosmicuous mode\n", dev_name) + printf("Device %s entering in promiscuous mode\n", dev_name) else - printf("Device %s leaving prosmicuous mode\n", dev_name) + printf("Device %s leaving promiscuous mode\n", dev_name) } probe netdev.change_rx_flag { @@ -41,7 +41,7 @@ probe netdev.change_mtu { } probe netdev.change_mac { - printf("Changing MAC adddres on device %s from %s to %s\n", + printf("Changing MAC address on device %s from %s to %s\n", dev_name, old_mac, new_mac) } -- cgit