Steven Rostedt | 6 Oct 18:51

[PATCH] ftrace: add quick function trace stop


This patch adds a way to disable the function tracer quickly without
the need to run kstop_machine. It adds a new variable called
function_trace_stop which will stop the calls to functions from mcount
when set.  This is just an on/off switch and does not handle recursion
like preempt_disable().

It's main purpose is to help other tracers/debuggers start and stop tracing
fuctions without the need to call kstop_machine.

A new file is added to /debug/tracing called function_trace_stop.
Echoing 1 into this file will stop the function tracing and echoing 1
will allow function tracing. Note, this is not the same as the heavy weight
/proc/sys/kernel/ftrace_enabled which calls the kstop_machine to fully
enable or disable ftrace.

   ftrace_enabled      function_stop_trace

        0                     0 or 1      - No function tracing at all
        1                       0         - mcount called but no function is
                                              traced
        1                       1         - normal function tracing

Note, only x86 architecture has this implemented (for now).

Signed-off-by: Steven Rostedt <srostedt <at> redhat.com>
---
 arch/x86/kernel/entry_32.S |    6 +++++
 arch/x86/kernel/entry_64.S |    5 ++++
 include/linux/ftrace.h     |   28 ++++++++++++++++++++++++
(Continue reading)


Gmane