aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-09-04 12:12:39 -0400
committerSteven Rostedt <rostedt@goodmis.org>2009-09-04 12:12:39 -0400
commit76f0d07376388f32698ba51b6090a26b90c1342f (patch)
treeea3a2576e7d2ae85d610aa088cb05986a13f03b1
parent621968cdb2563b667d6ecb484ba91ef4c3a797b3 (diff)
tracing: remove users of tracing_reset
The function tracing_reset is deprecated for outside use of trace.c. The new function to reset the the buffers is tracing_reset_online_cpus. The reason for this is that resetting the buffers while the event trace points are active can corrupt the buffers, because they may be writing at the time of reset. The tracing_reset_online_cpus disables writes and waits for current writers to finish. This patch replaces all users of tracing_reset except for the latency tracers. Those changes require more work and will be removed in the following patches. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--kernel/trace/kmemtrace.c4
-rw-r--r--kernel/trace/trace.c7
-rw-r--r--kernel/trace/trace_boot.c4
-rw-r--r--kernel/trace/trace_power.c4
4 files changed, 5 insertions, 14 deletions
diff --git a/kernel/trace/kmemtrace.c b/kernel/trace/kmemtrace.c
index dda53ccf749b..81b1645c8549 100644
--- a/kernel/trace/kmemtrace.c
+++ b/kernel/trace/kmemtrace.c
@@ -183,11 +183,9 @@ static void kmemtrace_stop_probes(void)
183 183
184static int kmem_trace_init(struct trace_array *tr) 184static int kmem_trace_init(struct trace_array *tr)
185{ 185{
186 int cpu;
187 kmemtrace_array = tr; 186 kmemtrace_array = tr;
188 187
189 for_each_cpu(cpu, cpu_possible_mask) 188 tracing_reset_online_cpus(tr);
190 tracing_reset(tr, cpu);
191 189
192 kmemtrace_start_probes(); 190 kmemtrace_start_probes();
193 191
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 9110329ecf77..54517a889791 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -550,7 +550,6 @@ __acquires(kernel_lock)
550 if (type->selftest && !tracing_selftest_disabled) { 550 if (type->selftest && !tracing_selftest_disabled) {
551 struct tracer *saved_tracer = current_trace; 551 struct tracer *saved_tracer = current_trace;
552 struct trace_array *tr = &global_trace; 552 struct trace_array *tr = &global_trace;
553 int i;
554 553
555 /* 554 /*
556 * Run a selftest on this tracer. 555 * Run a selftest on this tracer.
@@ -559,8 +558,7 @@ __acquires(kernel_lock)
559 * internal tracing to verify that everything is in order. 558 * internal tracing to verify that everything is in order.
560 * If we fail, we do not register this tracer. 559 * If we fail, we do not register this tracer.
561 */ 560 */
562 for_each_tracing_cpu(i) 561 tracing_reset_online_cpus(tr);
563 tracing_reset(tr, i);
564 562
565 current_trace = type; 563 current_trace = type;
566 /* the test is responsible for initializing and enabling */ 564 /* the test is responsible for initializing and enabling */
@@ -573,8 +571,7 @@ __acquires(kernel_lock)
573 goto out; 571 goto out;
574 } 572 }
575 /* Only reset on passing, to avoid touching corrupted buffers */ 573 /* Only reset on passing, to avoid touching corrupted buffers */
576 for_each_tracing_cpu(i) 574 tracing_reset_online_cpus(tr);
577 tracing_reset(tr, i);
578 575
579 printk(KERN_CONT "PASSED\n"); 576 printk(KERN_CONT "PASSED\n");
580 } 577 }
diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c
index a29ef23ffb47..863139327816 100644
--- a/kernel/trace/trace_boot.c
+++ b/kernel/trace/trace_boot.c
@@ -41,14 +41,12 @@ void disable_boot_trace(void)
41 41
42static int boot_trace_init(struct trace_array *tr) 42static int boot_trace_init(struct trace_array *tr)
43{ 43{
44 int cpu;
45 boot_trace = tr; 44 boot_trace = tr;
46 45
47 if (!tr) 46 if (!tr)
48 return 0; 47 return 0;
49 48
50 for_each_cpu(cpu, cpu_possible_mask) 49 tracing_reset_online_cpus(tr);
51 tracing_reset(tr, cpu);
52 50
53 tracing_sched_switch_assign_trace(tr); 51 tracing_sched_switch_assign_trace(tr);
54 return 0; 52 return 0;
diff --git a/kernel/trace/trace_power.c b/kernel/trace/trace_power.c
index 8a30d9874cd4..a5d5a4f7745b 100644
--- a/kernel/trace/trace_power.c
+++ b/kernel/trace/trace_power.c
@@ -144,14 +144,12 @@ static void power_trace_reset(struct trace_array *tr)
144 144
145static int power_trace_init(struct trace_array *tr) 145static int power_trace_init(struct trace_array *tr)
146{ 146{
147 int cpu;
148 power_trace = tr; 147 power_trace = tr;
149 148
150 trace_power_enabled = 1; 149 trace_power_enabled = 1;
151 tracing_power_register(); 150 tracing_power_register();
152 151
153 for_each_cpu(cpu, cpu_possible_mask) 152 tracing_reset_online_cpus(tr);
154 tracing_reset(tr, cpu);
155 return 0; 153 return 0;
156} 154}
157 155