Matching function parameters and corresponding return value

Frank Ch. Eigler fche@redhat.com
Wed Jun 14 14:25:00 GMT 2006


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



More information about the Systemtap mailing list