OSDN Git Service

tracing: Move all function tracing configs together
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 29 Jan 2020 21:19:10 +0000 (16:19 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 30 Jan 2020 14:46:29 +0000 (09:46 -0500)
The features that depend on the function tracer were spread out through the
tracing menu, pull them together as it is easier to manage.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/Kconfig

index 4484e78..32fcbc0 100644 (file)
@@ -172,6 +172,77 @@ config FUNCTION_GRAPH_TRACER
          the return value. This is done by setting the current return
          address on the current task structure into a stack of calls.
 
+config DYNAMIC_FTRACE
+       bool "enable/disable function tracing dynamically"
+       depends on FUNCTION_TRACER
+       depends on HAVE_DYNAMIC_FTRACE
+       default y
+       help
+         This option will modify all the calls to function tracing
+         dynamically (will patch them out of the binary image and
+         replace them with a No-Op instruction) on boot up. During
+         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
+         otherwise has native performance as long as no tracing is active.
+
+config DYNAMIC_FTRACE_WITH_REGS
+       def_bool y
+       depends on DYNAMIC_FTRACE
+       depends on HAVE_DYNAMIC_FTRACE_WITH_REGS
+
+config DYNAMIC_FTRACE_WITH_DIRECT_CALLS
+       def_bool y
+       depends on DYNAMIC_FTRACE
+       depends on HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
+
+config FUNCTION_PROFILER
+       bool "Kernel function profiler"
+       depends on FUNCTION_TRACER
+       default n
+       help
+         This option enables the kernel function profiler. A file is created
+         in debugfs called function_profile_enabled which defaults to zero.
+         When a 1 is echoed into this file profiling begins, and when a
+         zero is entered, profiling stops. A "functions" file is created in
+         the trace_stat directory; this file shows the list of functions that
+         have been hit and their counters.
+
+         If in doubt, say N.
+
+config STACK_TRACER
+       bool "Trace max stack"
+       depends on HAVE_FUNCTION_TRACER
+       select FUNCTION_TRACER
+       select STACKTRACE
+       select KALLSYMS
+       help
+         This special tracer records the maximum stack footprint of the
+         kernel and displays it in /sys/kernel/debug/tracing/stack_trace.
+
+         This tracer works by hooking into every function call that the
+         kernel executes, and keeping a maximum stack depth value and
+         stack-trace saved.  If this is configured with DYNAMIC_FTRACE
+         then it will not have any overhead while the stack tracer
+         is disabled.
+
+         To enable the stack tracer on bootup, pass in 'stacktrace'
+         on the kernel command line.
+
+         The stack tracer can also be enabled or disabled via the
+         sysctl kernel.stack_tracer_enabled
+
+         Say N if unsure.
+
 config TRACE_PREEMPT_TOGGLE
        bool
        help
@@ -410,30 +481,6 @@ config BRANCH_TRACER
 
          Say N if unsure.
 
-config STACK_TRACER
-       bool "Trace max stack"
-       depends on HAVE_FUNCTION_TRACER
-       select FUNCTION_TRACER
-       select STACKTRACE
-       select KALLSYMS
-       help
-         This special tracer records the maximum stack footprint of the
-         kernel and displays it in /sys/kernel/debug/tracing/stack_trace.
-
-         This tracer works by hooking into every function call that the
-         kernel executes, and keeping a maximum stack depth value and
-         stack-trace saved.  If this is configured with DYNAMIC_FTRACE
-         then it will not have any overhead while the stack tracer
-         is disabled.
-
-         To enable the stack tracer on bootup, pass in 'stacktrace'
-         on the kernel command line.
-
-         The stack tracer can also be enabled or disabled via the
-         sysctl kernel.stack_tracer_enabled
-
-         Say N if unsure.
-
 config BLK_DEV_IO_TRACE
        bool "Support for tracing block IO actions"
        depends on SYSFS
@@ -531,53 +578,6 @@ config DYNAMIC_EVENTS
 config PROBE_EVENTS
        def_bool n
 
-config DYNAMIC_FTRACE
-       bool "enable/disable function tracing dynamically"
-       depends on FUNCTION_TRACER
-       depends on HAVE_DYNAMIC_FTRACE
-       default y
-       help
-         This option will modify all the calls to function tracing
-         dynamically (will patch them out of the binary image and
-         replace them with a No-Op instruction) on boot up. During
-         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
-         otherwise has native performance as long as no tracing is active.
-
-config DYNAMIC_FTRACE_WITH_REGS
-       def_bool y
-       depends on DYNAMIC_FTRACE
-       depends on HAVE_DYNAMIC_FTRACE_WITH_REGS
-
-config DYNAMIC_FTRACE_WITH_DIRECT_CALLS
-       def_bool y
-       depends on DYNAMIC_FTRACE
-       depends on HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
-
-config FUNCTION_PROFILER
-       bool "Kernel function profiler"
-       depends on FUNCTION_TRACER
-       default n
-       help
-         This option enables the kernel function profiler. A file is created
-         in debugfs called function_profile_enabled which defaults to zero.
-         When a 1 is echoed into this file profiling begins, and when a
-         zero is entered, profiling stops. A "functions" file is created in
-         the trace_stat directory; this file shows the list of functions that
-         have been hit and their counters.
-
-         If in doubt, say N.
-
 config BPF_KPROBE_OVERRIDE
        bool "Enable BPF programs to override a kprobed function"
        depends on BPF_EVENTS