This is the mail archive of the
systemtap@sources.redhat.com
mailing list for the systemtap project.
Function tracing
- From: Vara Prasad <prasadav at us dot ibm dot com>
- To: SystemTAP <systemtap at sources dot redhat dot com>
- Date: Wed, 27 Apr 2005 14:41:45 -0700
- Subject: Function tracing
In order to help developers debug kernel one useful feature in
systemtap would be able to tell when the function entered and what are
the arguments at the time of entry and when the function returned and
what is the return value. With Jprobes we can do function entry and
arguments. With return probes we can tell what the return value of the
function is but we can not tell from which of the several possible
returns the function returned.
Let me give an example.
Let us say if we have following function max
int max(int a, int b)
{
if (a < b)
return b;
else
return a;
}
What we cannot find out with return probes is, which of the the two
possible return statements was executed.
I would think this feature will be very useful for tracing the code
path. One possible way could be to do a call graph analysis of the
function and put traps in all the possible return statements, but i
would think that is not a very good way to go.
Any ideas on solving this would be appreciated?
A related problem would be how to trace a particular process. If we we
know that running a particular test causes the problem one would like to
trace all function calls and returns done by just that process. The call
graph analysis method wont solve this problem as we can not possibly
find out in advance what functions get called.
Thanks for your help in advance,
Vara Prasad