From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1900 invoked by alias); 20 Jul 2009 16:55:12 -0000 Received: (qmail 1893 invoked by uid 22791); 20 Jul 2009 16:55:12 -0000 X-SWARE-Spam-Status: No, hits=-0.1 required=5.0 tests=AWL,BAYES_50,J_CHICKENPOX_53,J_CHICKENPOX_63,SPF_PASS X-Spam-Check-By: sourceware.org Received: from e4.ny.us.ibm.com (HELO e4.ny.us.ibm.com) (32.97.182.144) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 20 Jul 2009 16:55:04 +0000 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e4.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n6KGnLtB024153 for ; Mon, 20 Jul 2009 12:49:21 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n6KGt22Z251450 for ; Mon, 20 Jul 2009 12:55:02 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n6KGqPMS018372 for ; Mon, 20 Jul 2009 12:52:26 -0400 Received: from [9.65.40.173] (sig-9-65-40-173.mts.ibm.com [9.65.40.173]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n6KGqP2Y018306; Mon, 20 Jul 2009 12:52:25 -0400 Subject: Re: [PATCH 1/6] SNMP tapset From: "David J. Wilder" To: wenji.huang@oracle.com Cc: systemtap@sourceware.org In-Reply-To: <4A64179E.7090901@oracle.com> References: <1246935809.23042.34.camel@wilder.ibm.com> <4A64179E.7090901@oracle.com> Content-Type: text/plain Date: Mon, 20 Jul 2009 16:55:00 -0000 Message-Id: <1248108900.9931.5.camel@wilder.ibm.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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/msg00162.txt.bz2 Thanks for the references. I will fix that up. I have not made the switch to @cast yet but plan to soon. I need this to work with older version of stap at for now. On Mon, 2009-07-20 at 15:07 +0800, Wenji Huang wrote: > 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 > Tue, 2 Jun 2009 05:19:30 +0000 (05:19 +0000) > committer David S. Miller > Wed, 3 Jun 2009 09:51:04 +0000 (02:51 -0700) > commit adf30907d63893e4208dfe3f5c88ae12bc2f25d5 > > net: skb->rtable accessor > author Eric Dumazet > Tue, 2 Jun 2009 05:14:27 +0000 (05:14 +0000) > committer David S. Miller > Wed, 3 Jun 2009 09:51:02 +0000 (02:51 -0700) > commit 511c3f92ad5b6d9f8f6464be1b4f85f0422be91a > > > Regards, > Wenji