[RFC PATCH 2/3] Djprobe improvement patches (Re: Dynamic djprobe)

Masami Hiramatsu hiramatu@sdl.hitachi.co.jp
Thu Aug 4 17:32:00 GMT 2005


Hi, Mathieu

Mathieu Desnoyers wrote:
> If the stack inspection becomes considered too costy (push/pop at each interrupt
> entry/exit) or too uncertain (looking at all the stack's data), 

I developed a patch to check in the entire stack's data. It is attached 
in this mail.

> I would suggest
> a different approach for this interruption problem :
> 
> 1 - Replace the first byte of the segment you want to modify with a int3
> 2 - Wait until each other CPU has reach a point where we know they are not in
>     interrupt context anymore (interrupt or softirq). This could be done by
>     spawning a kernel thread on each CPU which would inform us when it runs. If
>     there is no kernel preemption, then we are sure there is no interruption
>     having a wrong EIP saved on its stack.
> 3 - Write the jmp instruction.
> 
> 
> In a context where there is no preemption, this should work.

It seems a good idea! Can I use a workqueue instead of a kernel thread?

Thanks.

Best regards,

-- 
Masami HIRAMATSU
2nd Research Dept.
Hitachi, Ltd., Systems Development Laboratory
E-mail: hiramatu@sdl.hitachi.co.jp

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: djprobe-find_stack.patch.3
URL: <http://sourceware.org/pipermail/systemtap/attachments/20050804/0b9b3f01/attachment.ksh>


More information about the Systemtap mailing list