|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /usr/share/systemtap/tapset/LKET/ |
Upload File : |
// Copyright (C) 2005, 2006 IBM Corp.
//
// This file is part of systemtap, and is free software. You can
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version
%{
#include <linux/netdevice.h>
%}
probe addevent.netdev
= addevent.netdev.receive,
addevent.netdev.transmit
{}
/* Main device receive routine, be called when packet arrives on network device */
probe addevent.netdev.receive
+= _addevent.netdev.receive
{
update_record()
}
probe _addevent.netdev.receive
= netdev.receive
{
/* no need to filter by pid */
log_netdev_extra(HOOKID_NETDEV_RECEIVE,$skb)
}
/* Queue a buffer for transmission to a network device */
probe addevent.netdev.transmit
+= _addevent.netdev.transmit
{
update_record()
}
probe _addevent.netdev.transmit
= netdev.transmit
{
log_netdev_extra(HOOKID_NETDEV_TRANSMIT, $skb)
}
function log_netdev_extra(var_id:long, var:long)
%{
struct sk_buff *skb = (struct sk_buff *)((long)THIS->var);
/* dev_name | Length of actual data | protocol | Buffer size
skb->protocol is:
0800 IP
8100 802.1Q VLAN
0001 802.3
0002 AX.25
0004 802.2
8035 RARP
0005 SNAP
0805 X.25
0806 ARP
8137 IPX
0009 Localtalk
86DD IPv6
*/
_lket_trace(_GROUP_NETDEV, THIS->var_id, "%0s%4b%2b%4b", skb->dev->name,
(_FMT_)skb->len, (_FMT_)skb->protocol, (_FMT_)skb->truesize);
%}