Context information on function return
David Smith
dsmith@redhat.com
Thu Apr 26 15:44:00 GMT 2007
Alex Iribarren wrote:
> Hi,
>
> I'm trying to use SystemTap to log network connections at the kernel
> level, so I'm trying to hook into connect(), accept() and a couple of
> other system calls.
... stuff deleted ...
> Currently, I'm using a rather nasty hack involving storing the
> parameters in a global array on function entry and reading and
> processing them on function return. It works, but I don't like it and
> there must be a better way.
If you are using a recent version of systemtap, you can access
parameters in return probes. Now, underneath the hood it is doing the
same thing you are doing - generating an entry probe that saves the
parameter in a global array (indexed by tid and a counter). This has
proved fairly robust.
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
More information about the Systemtap
mailing list