This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: $return in wildcarded void functions


HI There,

I tried to use $return with systemtap 0.5.4. It seems 
$return is not supported or I did something wrong here?

[]# stap -V
SystemTap translator/driver (version 0.5.4 built 2006-02-02)
Copyright (C) 2005-2006 Red Hat, Inc. and others
This is free software; see the source for copying conditions

probe kernel.function("d_lookup").return
{
       if($return)        
        missedcnt++ 
}

[]# ./cache.stp 
semantic error: target variables not available to .return probes
semantic error: no match for probe point
         while: resolving probe point kernel.function("d_lookup").return
Pass 2: analysis failed.  Try again with '-v' (verbose) option.

Thanks,
--
John Liang

-----Original Message-----
From: systemtap-owner@sourceware.org [mailto:systemtap-owner@sourceware.org]
On Behalf Of Mike Mason
Sent: Monday, March 05, 2007 8:31 PM
To: systemtap@sources.redhat.com
Subject: $return in wildcarded void functions

A co-worker posed this problem... He's debugging code he's not familiar
with.  He's using wildcarding to probe the entries and exits of all
functions in a specific module. The return probe looks something like this:

probe module("uhci_hcd").function("*").return
{
	printf ("%s <- %s: %s\n", thread_indent(-2), probefunc(),
errno_str($return))
}

The return probe attempts to access $return.  For functions defined as void,
obviously there is no return value, which causes pass 2 to fail with the
following errors: 

semantic error: function has no return value: identifier '$return' at
usb2:11:85
semantic error: function has no return value: identifier '$return' at
usb2:23:85

Is there any way around this problem short of writing a return probe for
each function?  Is there any way to treat a variable as conditional?  That
would be a useful feature, especially for wildcarded return probes.

Mike




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]