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: Matching function parameters and corresponding return value


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


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