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: Context information on function return


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)


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