This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Matching function parameters and corresponding return value
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Sylvain Fourmanoit <syfou at users dot sourceforge dot net>
- Cc: systemtap at sourceware dot org
- Date: 14 Jun 2006 10:25:23 -0400
- Subject: Re: Matching function parameters and corresponding return value
- References: <Pine.LNX.4.64.0606131800540.5501@sylvain>
Sylvain Fourmanoit <syfou@users.sourceforge.net> writes:
> I would like to watch calls to a preemptible function such as sys_open():
> ideally, I would like to know both the tentatively accessed files and
> the success (or not) of the various calls.
This is to be addressed in systemtap bug #1382. When this feature is
implemented, it will allow one to write probes of the form:
probe kernel.function("foo").return {
print ("saved arg1=") print ($foo)
print (" arg2=") print ($bar)
print (" return value=") print ($return)
}
In particular, a copy of incoming parameters will be saved by an
implicit kprobe and will be accessable to the .return probe.
In the mean time, one can do the same work by hand - write an ordinary
function-entry probe, save the arguments in some auxiliary array
indexed by tid() (and other state such as nesting level if necessary),
then look up the values in the .return probe.
- FChE