runtime library wrapper for program counter

Vara Prasad prasadav@us.ibm.com
Wed Mar 23 10:20:00 GMT 2005


Vara Prasad wrote:

> 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
>
>
Another useful runtime function for filtering would be who called this 
routine.
One of the ways to define a probe is run the probe handler if this 
function is
called from a specified function. For this we need to know the caller.

bye,
Vara Prasad



More information about the Systemtap mailing list