diff options
author | Steven Rostedt <srostedt@redhat.com> | 2008-11-05 16:05:44 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-06 01:50:51 -0500 |
commit | 60a7ecf42661f2b22168751298592da6ee210c9e (patch) | |
tree | 050fd052c546c92f8aac10ee71d5bb6d98a21fc8 /arch/x86/kernel/entry_32.S | |
parent | 79c81d220c8e25163f56edcdfaf23f83a4c88e6b (diff) |
ftrace: add quick function trace stop
Impact: quick start and stop of function tracer
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.
The config option HAVE_FUNCTION_TRACE_MCOUNT_TEST is added for archs
that implement the testing of the function_trace_stop in the mcount
arch dependent code. Otherwise, the test is done in the C code.
x86 is the only arch at the moment that supports this.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/entry_32.S')
-rw-r--r-- | arch/x86/kernel/entry_32.S | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index 28b597ef9ca..9134de814c9 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -1157,6 +1157,9 @@ ENTRY(mcount) | |||
1157 | END(mcount) | 1157 | END(mcount) |
1158 | 1158 | ||
1159 | ENTRY(ftrace_caller) | 1159 | ENTRY(ftrace_caller) |
1160 | cmpl $0, function_trace_stop | ||
1161 | jne ftrace_stub | ||
1162 | |||
1160 | pushl %eax | 1163 | pushl %eax |
1161 | pushl %ecx | 1164 | pushl %ecx |
1162 | pushl %edx | 1165 | pushl %edx |
@@ -1180,6 +1183,9 @@ END(ftrace_caller) | |||
1180 | #else /* ! CONFIG_DYNAMIC_FTRACE */ | 1183 | #else /* ! CONFIG_DYNAMIC_FTRACE */ |
1181 | 1184 | ||
1182 | ENTRY(mcount) | 1185 | ENTRY(mcount) |
1186 | cmpl $0, function_trace_stop | ||
1187 | jne ftrace_stub | ||
1188 | |||
1183 | cmpl $ftrace_stub, ftrace_trace_function | 1189 | cmpl $ftrace_stub, ftrace_trace_function |
1184 | jnz trace | 1190 | jnz trace |
1185 | .globl ftrace_stub | 1191 | .globl ftrace_stub |