This is the mail archive of the
systemtap@sources.redhat.com
mailing list for the systemtap project.
Re: runtime library wrapper for program counter
- From: Vara Prasad <prasadav at us dot ibm dot com>
- To: William Cohen <wcohen at redhat dot com>
- Cc: mhunt <mhunt at redhat dot com>, SystemTAP <systemtap at sources dot redhat dot com>
- Date: Wed, 23 Mar 2005 17:09:32 -0800
- Subject: Re: runtime library wrapper for program counter
- References: <4241FEB8.40607@redhat.com>
William Cohen wrote:
I like the wrapper for the return address in the systemtap runtime
libraries. Could there be a similar wrapper for the program
counter/instruction pointer? There are three possible uses for it:
1) It would be use in the case where the same systemtap
instrumentation code is used to multiple points. Allow the
instrumentation code to determine which probe fired.
2) Tracking destinations of calls. Have a post_handler instrumetation
look at the program counter to track the destination of indirect calls.
3) Tracking destination of jumps. For simple condition branch it would
probably be easier just to instrument the target and the fall through.
However for indirect jumps using jump tables, e.g. switch case, the
same post_handler as for destinations of calls could be done. Have a
probe that fires after executing the instruction.
-Will
I like the PC/IP wrapper idea.
I also like the idea of wrapper function for process credentials. This
call gives
process credentials like PID, PPID, UID, EUID, GID all filled into a
structure.
This information will be useful filtering what probes get fired for
which process like
process this probe only for my process kind of filter.
Another wrapper similarly would be print the call stack. For now we can
limit to
kernel stack but in the future similar functions could exist for user
stack and full stack.
bye,
Vara Prasad