aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorAnkita Garg <ankita@in.ibm.com>2008-06-09 04:40:25 -0400
committerIngo Molnar <mingo@elte.hu>2008-06-10 08:52:30 -0400
commit2b1bce1787700768cbc87c8509851c6f49d252dc (patch)
treed21617cd4b77ce13417eee35aebec9f91850ce90 /kernel/trace/trace.c
parent040ec23d07f95285e9777a85cda29cb339a3065b (diff)
ftrace: disable tracing when current_tracer is set to "none"
Found that inspite of setting the current_tracer to "none", trace from the previous trace type continued to be collected. The patch below fixes this and causes the trace to be disabled when the "none" type is selected. Compile and boot tested the patch for functionality. Signed-off-by: Ankita Garg <ankita@in.ibm.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 12f5e817380e..dde6f0ace6dc 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -43,11 +43,6 @@ static cpumask_t __read_mostly tracing_buffer_mask;
43#define for_each_tracing_cpu(cpu) \ 43#define for_each_tracing_cpu(cpu) \
44 for_each_cpu_mask(cpu, tracing_buffer_mask) 44 for_each_cpu_mask(cpu, tracing_buffer_mask)
45 45
46/* dummy trace to disable tracing */
47static struct tracer no_tracer __read_mostly = {
48 .name = "none",
49};
50
51static int trace_alloc_page(void); 46static int trace_alloc_page(void);
52static int trace_free_page(void); 47static int trace_free_page(void);
53 48
@@ -135,6 +130,23 @@ static DECLARE_WAIT_QUEUE_HEAD(trace_wait);
135/* trace_flags holds iter_ctrl options */ 130/* trace_flags holds iter_ctrl options */
136unsigned long trace_flags = TRACE_ITER_PRINT_PARENT; 131unsigned long trace_flags = TRACE_ITER_PRINT_PARENT;
137 132
133static notrace void no_trace_init(struct trace_array *tr)
134{
135 int cpu;
136
137 if(tr->ctrl)
138 for_each_online_cpu(cpu)
139 tracing_reset(tr->data[cpu]);
140 tracer_enabled = 0;
141}
142
143/* dummy trace to disable tracing */
144static struct tracer no_tracer __read_mostly = {
145 .name = "none",
146 .init = no_trace_init
147};
148
149
138/** 150/**
139 * trace_wake_up - wake up tasks waiting for trace input 151 * trace_wake_up - wake up tasks waiting for trace input
140 * 152 *