Messages in this thread | | | Subject | Re: Re: [PATCH 1/5] ftrace: Synchronize variable setting with breakpoints | From | Steven Rostedt <> | Date | Thu, 31 May 2012 11:29:20 -0400 |
| |
On Fri, 2012-06-01 at 00:16 +0900, Masami Hiramatsu wrote:
> Perhaps, kprobes-*jump*-optimization may be better to handle it > because the target probe is simultaneously working while > optimizing (modifying code). This means that if someone hits > breakpoint of such kprobe, it must be handled by kprobes, not > only just tweaking IP address.
Yeah, ftrace is easier on what the breakpoint does. For kprobes, it's a bit more invasive. Ftrace only deals with a nop, or a "trace-me" call. As the modifications are being done, we always treat it as a nop until the modification is complete.
With kprobes, the text_poke() is a bit more difficult, because it can't treat the location as a nop, as what is changing actually performs some task for the kernel. It requires that the breakpoint know what to do with the text (out-of-line execution, and such). ftrace has the benefit of just "skip this instruction" and return.
-- Steve
| |