Re: [PATCH 2/5] ftrace: Use breakpoint method to update ftracecaller

From: Peter Zijlstra
Date: Thu May 31 2012 - 07:18:12 EST


On Wed, 2012-05-30 at 21:28 -0400, Steven Rostedt wrote:
> From: Steven Rostedt <srostedt@xxxxxxxxxx>
>
> On boot up and module load, it is fine to modify the code directly,
> without the use of breakpoints. This is because boot up modification
> is done before SMP is initialized, thus the modification is serial,
> and module load is done before the module executes.
>
> But after that we must use a SMP safe method to modify running code.
>
> This has been done to change the nops at all the functions, but
> the change of the ftrace callback handler itself was still using a
> direct modification. If tracing was enabled and the function callback
> was changed then another CPU could fault if it was currently calling
> the original callback. This modification must use the breakpoint method
> too.
>
> Note, the direct method is still used for boot up and module load.

The changelog isn't clear if this is a fix or optimization. I suspect
the latter.

Still, you're now re-inventing text_poke() and text_poke_early().

Why are you keeping all this inside of ftrace?


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/