[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201028131542.963014814@goodmis.org>
Date: Wed, 28 Oct 2020 09:15:42 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: linux-kernel@...r.kernel.org
Cc: Masami Hiramatsu <mhiramat@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Jiri Olsa <jolsa@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Alexei Starovoitov <alexei.starovoitov@...il.com>
Subject: [RFC][PATCH 0/2] ftrace: Add access to function arguments for all callbacks
This is something I wanted to implement a long time ago, but held off until
there was a good reason to do so. Now it appears that having access to the
arguments of the function by default is very useful. As a bonus, because
arguments must be saved regardless before calling a callback, because they
need to be restored before returning back to the start of the traced
function, there's not much work to do to have them always be there for
normal function callbacks.
The basic idea is that if CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS is set, then
all callbacks registered to ftrace can use the regs parameter for the stack
and arguments (kernel_stack_pointer(regs), regs_get_kernel_argument(regs, n)),
without the need to set REGS that causes overhead by saving all registers as
REGS simulates a breakpoint.
Only the first patch is to be applied. The second patch is just to show how
this could work.
Steven Rostedt (VMware) (2):
ftrace/x86: Allow for arguments to be passed in to REGS by default
ftrace: Test arguments by adding trace_printk in function tracer
----
arch/x86/Kconfig | 1 +
arch/x86/kernel/ftrace_64.S | 12 +++++++-----
kernel/trace/Kconfig | 9 +++++++++
kernel/trace/trace_functions.c | 13 ++++++++++++-
4 files changed, 29 insertions(+), 6 deletions(-)
Powered by blists - more mailing lists