From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21122 invoked by alias); 16 Sep 2009 18:38:39 -0000 Received: (qmail 21059 invoked by uid 22791); 16 Sep 2009 18:38:36 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62,J_CHICKENPOX_63,SARE_MSGID_LONG40 X-Spam-Check-By: sourceware.org Received: from e24smtp02.br.ibm.com (HELO e24smtp02.br.ibm.com) (32.104.18.86) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Sep 2009 18:38:32 +0000 Received: from mailhub3.br.ibm.com (mailhub3.br.ibm.com [9.18.232.110]) by e24smtp02.br.ibm.com (8.14.3/8.13.1) with ESMTP id n8GImVkV025995 for ; Wed, 16 Sep 2009 15:48:31 -0300 Received: from d24av04.br.ibm.com (d24av04.br.ibm.com [9.18.232.43]) by mailhub3.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n8GId9gL2060332 for ; Wed, 16 Sep 2009 15:39:09 -0300 Received: from d24av04.br.ibm.com (loopback [127.0.0.1]) by d24av04.br.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id n8GIcTt7024469 for ; Wed, 16 Sep 2009 15:38:29 -0300 Received: from localhost.localdomain (devhv4e-phantom-lp3.austin.ibm.com [9.3.233.173]) by d24av04.br.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id n8GIcMJi024380; Wed, 16 Sep 2009 15:38:28 -0300 From: leitao@linux.vnet.ibm.com To: systemtap@sources.redhat.com Cc: dsmith@redhat.com, jistone@redhat.com Subject: [PATCH 3/3] A network device example Date: Wed, 16 Sep 2009 18:38:00 -0000 Message-Id: In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2009-q3/txt/msg00754.txt.bz2 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. --- testsuite/systemtap.examples/network/netdev.stp | 58 +++++++++++++++++++++++ 1 files changed, 58 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..738754a --- /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) +} -- 1.6.0.2