Commit 33452b6b authored by Steven Rostedt's avatar Steven Rostedt Committed by Greg Kroah-Hartman

ftrace: Update the kconfig for DYNAMIC_FTRACE

commit db05021d upstream.

The prompt to enable DYNAMIC_FTRACE (the ability to nop and
enable function tracing at run time) had a confusing statement:

 "enable/disable ftrace tracepoints dynamically"

This was written before tracepoints were added to the kernel,
but now that tracepoints have been added, this is very confusing
and has confused people enough to give wrong information during
presentations.

Not only that, I looked at the help text, and it still references
that dreaded daemon that use to wake up once a second to update
the nop locations and brick NICs, that hasn't been around for over
five years.

Time to bring the text up to the current decade.
Reported-by: default avatarEzequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 849149f2
...@@ -416,24 +416,28 @@ config PROBE_EVENTS ...@@ -416,24 +416,28 @@ config PROBE_EVENTS
def_bool n def_bool n
config DYNAMIC_FTRACE config DYNAMIC_FTRACE
bool "enable/disable ftrace tracepoints dynamically" bool "enable/disable function tracing dynamically"
depends on FUNCTION_TRACER depends on FUNCTION_TRACER
depends on HAVE_DYNAMIC_FTRACE depends on HAVE_DYNAMIC_FTRACE
default y default y
help help
This option will modify all the calls to ftrace dynamically This option will modify all the calls to function tracing
(will patch them out of the binary image and replace them dynamically (will patch them out of the binary image and
with a No-Op instruction) as they are called. A table is replace them with a No-Op instruction) on boot up. During
created to dynamically enable them again. compile time, a table is made of all the locations that ftrace
can function trace, and this table is linked into the kernel
image. When this is enabled, functions can be individually
enabled, and the functions not enabled will not affect
performance of the system.
See the files in /sys/kernel/debug/tracing:
available_filter_functions
set_ftrace_filter
set_ftrace_notrace
This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but
otherwise has native performance as long as no tracing is active. otherwise has native performance as long as no tracing is active.
The changes to the code are done by a kernel thread that
wakes up once a second and checks to see if any ftrace calls
were made. If so, it runs stop_machine (stops all CPUS)
and modifies the code to jump over the call to ftrace.
config FUNCTION_PROFILER config FUNCTION_PROFILER
bool "Kernel function profiler" bool "Kernel function profiler"
depends on FUNCTION_TRACER depends on FUNCTION_TRACER
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment