proposed instruction trace support in SystemTap

Maynard Johnson maynardj@us.ibm.com
Fri Jul 6 21:39:00 GMT 2007


Dave Nomura wrote:
> PROPOSED INSTRUCTION TRACING INTEGRATION INTO SYSTEMTAP
> A user would write a stap script that identified where to turn on 
> instruction tracing and where to turn it off.  The stap script could be 
> invoked via: stap <user_script>.stp -b -M -c "<some program>" -o 
> <trace_data>
Ideally, some default behavior should be provided by new instruction 
trace scripts so that a user may not need to code any stap scripts 
themselves; i.e., user passes in program name, args, start-trace 
function, stop-trace function.
> to allow the stap script to access the pid to trace, although other 
> usage modes are also possible.  Some enhancements to the stap translator 
> are suggested below to support instruction tracing.
> 
> SINGLE_STEP/BRANCH TRAP HANDLER
> The user's stap script would also need to define an instruction trace 
A default handler should be provided, but with some mechanism to allow 
the user to override.
> handler and insert their own body for the handler.  This might look like:
> probe single_step label("single_step handler 1")
> {
>        <do whatever you want for each single stepped instruction>
>        itrace_output();        // write itrace binary output
> }
> 
> probe branch_step label("branch handler 1")
> {
>        <do whatever you want for each branch instruction>
>        itrace_output();        // write itrace binary output
> }
> 
[snip]

-Maynard



More information about the Systemtap mailing list