Re: [PATCH 2/3] ftrace: use code patching for ftrace return tracer

From: Frédéric Weisbecker
Date: Tue Nov 25 2008 - 19:13:19 EST


2008/11/25 Steven Rostedt <rostedt@xxxxxxxxxxx>:
> From: Steven Rostedt <rostedt@xxxxxxxxxxx>
>
> Impact: more efficient code for ftrace return tracer
>
> This patch uses the dynamic patching, when available, to patch
> the function return code into the kernel.
>
> This patch will ease the way for letting both function tracing
> and function return tracing run together.
>
> Signed-off-by: Steven Rostedt <srostedt@xxxxxxxxxx>
> ---
> arch/x86/kernel/entry_32.S | 5 ++++
> arch/x86/kernel/ftrace.c | 46 +++++++++++++++++++++++++++++++++++++++++++-
> include/linux/ftrace.h | 5 ++++
> kernel/trace/ftrace.c | 34 ++++++++++++++------------------
> 4 files changed, 70 insertions(+), 20 deletions(-)
>
> diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
> index 7a934c0..d6f0333 100644
> --- a/arch/x86/kernel/entry_32.S
> +++ b/arch/x86/kernel/entry_32.S
> @@ -1185,6 +1185,11 @@ ftrace_call:
> popl %edx
> popl %ecx
> popl %eax
> +#ifdef CONFIG_FUNCTION_RET_TRACER
> +.globl ftrace_return_call
> +ftrace_return_call:
> + jmp ftrace_stub
> +#endif


And you patch ftrace_stub to ftrace_return_caller.
I see...
Seems a good idea :-)

Acked-by: Frederic Weisbecker <fweisbec@xxxxxxxxx>
--
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/