This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Context information on function return
- From: David Smith <dsmith at redhat dot com>
- To: Alex Iribarren <Alex dot Iribarren at cern dot ch>
- Cc: systemtap at sourceware dot org
- Date: Thu, 26 Apr 2007 10:44:19 -0500
- Subject: Re: Context information on function return
- References: <463078C7.9020502@cern.ch>
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)