lkml.org 
[lkml]   [2012]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Re: [PATCH 1/5] ftrace: Synchronize variable setting with breakpoints
From
Date
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




\
 
 \ /
  Last update: 2012-05-31 18:21    [W:0.150 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site