kernel API for in-kernel single stepping

Dave Nomura dcnltc@us.ibm.com
Wed Sep 5 05:02:00 GMT 2007


I'd like to summarize where we stand on instruction tracing support in 
SystemTap.

The key blocking point on the original proposal was the lack of some 
kernel API to support single-step trapping, the basis of instruction 
tracing.

Roland suggested that utrace would be a reasonable kernel API to use for 
single-step tracing of user code, and that kernel instruction tracing be 
treated as a separate case.  Paul felt that the 
MSR/single-step/notify_due infrastructure that kprobes uses should be an 
adequate API for itrace to use, and if not, maybe something could be 
done to make it so.  Frank suggested that we defer that capability until 
we get the user code tracing sorted out.

Thanks to all of you for your input!

I will try and add a utrace based single-stepping mechanism to my 
SystemTap instruction trace prototype and see how the performance 
compares with the Performance Inspector ITRACE strategy (which uses 
__debugger_sstep() as a trap handler without any other layers of overhead).
Frank Ch. Eigler wrote:
> Hi, Paul -
>
>
>   
>> [...]
>>     
>>> [...]  With the various kernel debuggers, kprobes, itrace, and
>>> maybe others trying to share these
>>> [MSR/single-stepping/notify_die] resources do you think it is time
>>> to develop some sort of kernel single stepping API?  Frank is
>>> requesting this API before changing SystemTap to support single
>>> step traps.
>>>       
>
> Actually, I have asked only about user-space single-stepping, possibly
> based on the utrace API.  Broad kernel-space single-stepping is risky
> enough not to attempt yet.
>
>   
>> At present kprobes sets the MSR_SE bit in the MSR when it wants to
>> single-step, and uses the notify_die infrastructure as the way it
>> gets notified when the single-step trap occurs.  [...]  In other
>> words the API for single-stepping is just the notify_die stuff.
>> [...]
>>     
>
> We can attempt this later.
>
> - FChE
>   



More information about the Systemtap mailing list