[PATCH 1/6] SNMP tapset

Wenji Huang wenji.huang@oracle.com
Mon Jul 20 07:08:00 GMT 2009


David J. Wilder wrote:
> This tapset provides probes used to count TCP SNMP management
> events.  The probes mirror many of the SNMP statistics defined

Excellent stuff.
 > + */
 > +function tcpmib_get_state:long (sk:long)
 > +%{ /* pure */
 > +	struct sock *sk = (struct sock *)(long)THIS->sk;
 > +	THIS->__retvalue = kread(&(sk->sk_state));
 > +	CATCH_DEREF_FAULT();
 > +%}

Maybe using cast operator to avoid such kinds of
embedded C functions.
 > +
 > +/**
 > + * sfunction tcpmib_local_addr - Get the source address.
[...]
 > + *
 > +
 > +function _tcpmib_input_route_type:long (skb:long)
 > +%{ /* pure */
 > +        struct rtable *rt;
 > +        struct sk_buff *skb = (struct sk_buff *)(long)THIS->skb;
 > +        rt = (struct rtable *)kread(&(skb->rtable));
 > +        THIS->__retvalue = kread(&(rt->rt_type));
 > +        CATCH_DEREF_FAULT();
 > +%}

There are some changes in sk_buff structure those cause the failures of 
compiling ipmib.stp and tcpmib.stp. rtable and dst fields are deleted 
and some accessors are provided. See:

net: skb->dst accessors
author	Eric Dumazet <eric.dumazet@gmail.com>
	Tue, 2 Jun 2009 05:19:30 +0000 (05:19 +0000)
committer	David S. Miller <davem@davemloft.net>
	Wed, 3 Jun 2009 09:51:04 +0000 (02:51 -0700)
commit	adf30907d63893e4208dfe3f5c88ae12bc2f25d5

net: skb->rtable accessor
author	Eric Dumazet <eric.dumazet@gmail.com>
	Tue, 2 Jun 2009 05:14:27 +0000 (05:14 +0000)
committer	David S. Miller <davem@davemloft.net>
	Wed, 3 Jun 2009 09:51:02 +0000 (02:51 -0700)
commit	511c3f92ad5b6d9f8f6464be1b4f85f0422be91a


Regards,
Wenji



More information about the Systemtap mailing list