From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31228 invoked by alias); 16 Jun 2009 09:47:31 -0000 Received: (qmail 31218 invoked by uid 22791); 16 Jun 2009 09:47:31 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from poesci.dolphinics.no (HELO poesci.dolphinics.no) (81.175.23.36) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 16 Jun 2009 09:47:21 +0000 Received: from [192.168.1.22] (p5088FD14.dip.t-dialin.net [80.136.253.20]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by poesci.dolphinics.no (Postfix) with ESMTP id 276BCB0A6F; Tue, 16 Jun 2009 11:47:19 +0200 (CEST) Message-ID: <4A376A1C.9010006@dolphinics.com> Date: Tue, 16 Jun 2009 09:47:00 -0000 From: Christian Kaiser User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: ananth@in.ibm.com CC: systemtap@sourceware.org Subject: Re: trace function argument References: <4A376113.30109@dolphinics.com> <20090616091522.GA4614@in.ibm.com> In-Reply-To: <20090616091522.GA4614@in.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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-q2/txt/msg00900.txt.bz2 Ananth N Mavinakayanahalli wrote: > On Tue, Jun 16, 2009 at 11:08:35AM +0200, Christian Kaiser wrote: >> Hi all, >> >> is it possible to get the value of a function argument of a probed >> function? >> >> With dtrace for example, you can do something like: >> dtrace -n '::some_function:entry/arg0 != 0/{ printf("arg0 is not zero!"); >> }' >> >> I have searched the "Beginners Guide", mailinglist, wiki, web, etc. but >> could not find anything useful. > > With SystemTap with debuginfo, you can refer to arguments by name. > > probe kernel.function("do_fork") > { > if ($clone_flags == 0) > printf("clone_flags is zero!\n") > } > > Further, to just list arguments, you can use $$parms: > > stap -ve 'probe kernel.function("vfs_read") { printf("%s\n", $$parms) }' Right, both suggestions are working for me. Thanks! > With debuginfoless kernels, you can do pretty much what you cite with > DTrace above. I am not sure if I understand you right. If I can do pretty much the same, how is it working then? Let's take your example from above. How can I print out 'clone_flags' with debuginfoless kernels? Christian -- Christian Kaiser, Software Engineer, Dolphin Interconnect Solutions http://www.dolphinics.com