diff options
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace.c | 2 | ||||
-rw-r--r-- | kernel/trace/trace.h | 1 | ||||
-rw-r--r-- | kernel/trace/trace_boot.c | 9 | ||||
-rw-r--r-- | kernel/trace/trace_functions.c | 9 | ||||
-rw-r--r-- | kernel/trace/trace_irqsoff.c | 11 | ||||
-rw-r--r-- | kernel/trace/trace_mmiotrace.c | 11 | ||||
-rw-r--r-- | kernel/trace/trace_nop.c | 10 | ||||
-rw-r--r-- | kernel/trace/trace_sched_switch.c | 10 | ||||
-rw-r--r-- | kernel/trace/trace_sched_wakeup.c | 9 | ||||
-rw-r--r-- | kernel/trace/trace_selftest.c | 48 | ||||
-rw-r--r-- | kernel/trace/trace_sysprof.c | 10 |
11 files changed, 29 insertions, 101 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index dbbdacfaaf9e..9e83188172a1 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -3357,8 +3357,6 @@ __init static int tracer_alloc_buffers(void) | |||
3357 | 3357 | ||
3358 | register_tracer(&nop_trace); | 3358 | register_tracer(&nop_trace); |
3359 | #ifdef CONFIG_BOOT_TRACER | 3359 | #ifdef CONFIG_BOOT_TRACER |
3360 | /* We don't want to launch sched_switch tracer yet */ | ||
3361 | global_trace.ctrl = 0; | ||
3362 | register_tracer(&boot_tracer); | 3360 | register_tracer(&boot_tracer); |
3363 | current_trace = &boot_tracer; | 3361 | current_trace = &boot_tracer; |
3364 | current_trace->init(&global_trace); | 3362 | current_trace->init(&global_trace); |
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 25abfc45f081..e481edaae1c4 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -244,7 +244,6 @@ struct tracer { | |||
244 | ssize_t (*read)(struct trace_iterator *iter, | 244 | ssize_t (*read)(struct trace_iterator *iter, |
245 | struct file *filp, char __user *ubuf, | 245 | struct file *filp, char __user *ubuf, |
246 | size_t cnt, loff_t *ppos); | 246 | size_t cnt, loff_t *ppos); |
247 | void (*ctrl_update)(struct trace_array *tr); | ||
248 | #ifdef CONFIG_FTRACE_STARTUP_TEST | 247 | #ifdef CONFIG_FTRACE_STARTUP_TEST |
249 | int (*selftest)(struct tracer *trace, | 248 | int (*selftest)(struct tracer *trace, |
250 | struct trace_array *tr); | 249 | struct trace_array *tr); |
diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c index 0203c1054012..8f71915e8bb4 100644 --- a/kernel/trace/trace_boot.c +++ b/kernel/trace/trace_boot.c | |||
@@ -58,14 +58,6 @@ static void boot_trace_init(struct trace_array *tr) | |||
58 | tracing_sched_switch_assign_trace(tr); | 58 | tracing_sched_switch_assign_trace(tr); |
59 | } | 59 | } |
60 | 60 | ||
61 | static void boot_trace_ctrl_update(struct trace_array *tr) | ||
62 | { | ||
63 | if (tr->ctrl) | ||
64 | enable_boot_trace(); | ||
65 | else | ||
66 | disable_boot_trace(); | ||
67 | } | ||
68 | |||
69 | static enum print_line_t initcall_print_line(struct trace_iterator *iter) | 61 | static enum print_line_t initcall_print_line(struct trace_iterator *iter) |
70 | { | 62 | { |
71 | int ret; | 63 | int ret; |
@@ -102,7 +94,6 @@ struct tracer boot_tracer __read_mostly = | |||
102 | .name = "initcall", | 94 | .name = "initcall", |
103 | .init = boot_trace_init, | 95 | .init = boot_trace_init, |
104 | .reset = reset_boot_trace, | 96 | .reset = reset_boot_trace, |
105 | .ctrl_update = boot_trace_ctrl_update, | ||
106 | .print_line = initcall_print_line, | 97 | .print_line = initcall_print_line, |
107 | }; | 98 | }; |
108 | 99 | ||
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c index 9f1b0de71284..e980b872bef5 100644 --- a/kernel/trace/trace_functions.c +++ b/kernel/trace/trace_functions.c | |||
@@ -54,14 +54,6 @@ static void function_trace_reset(struct trace_array *tr) | |||
54 | stop_function_trace(tr); | 54 | stop_function_trace(tr); |
55 | } | 55 | } |
56 | 56 | ||
57 | static void function_trace_ctrl_update(struct trace_array *tr) | ||
58 | { | ||
59 | if (tr->ctrl) | ||
60 | start_function_trace(tr); | ||
61 | else | ||
62 | stop_function_trace(tr); | ||
63 | } | ||
64 | |||
65 | static void function_trace_start(struct trace_array *tr) | 57 | static void function_trace_start(struct trace_array *tr) |
66 | { | 58 | { |
67 | function_reset(tr); | 59 | function_reset(tr); |
@@ -73,7 +65,6 @@ static struct tracer function_trace __read_mostly = | |||
73 | .init = function_trace_init, | 65 | .init = function_trace_init, |
74 | .reset = function_trace_reset, | 66 | .reset = function_trace_reset, |
75 | .start = function_trace_start, | 67 | .start = function_trace_start, |
76 | .ctrl_update = function_trace_ctrl_update, | ||
77 | #ifdef CONFIG_FTRACE_SELFTEST | 68 | #ifdef CONFIG_FTRACE_SELFTEST |
78 | .selftest = trace_selftest_startup_function, | 69 | .selftest = trace_selftest_startup_function, |
79 | #endif | 70 | #endif |
diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c index 3509086cdc4c..ffdf592a54e3 100644 --- a/kernel/trace/trace_irqsoff.c +++ b/kernel/trace/trace_irqsoff.c | |||
@@ -394,14 +394,6 @@ static void irqsoff_tracer_reset(struct trace_array *tr) | |||
394 | stop_irqsoff_tracer(tr); | 394 | stop_irqsoff_tracer(tr); |
395 | } | 395 | } |
396 | 396 | ||
397 | static void irqsoff_tracer_ctrl_update(struct trace_array *tr) | ||
398 | { | ||
399 | if (tr->ctrl) | ||
400 | start_irqsoff_tracer(tr); | ||
401 | else | ||
402 | stop_irqsoff_tracer(tr); | ||
403 | } | ||
404 | |||
405 | static void irqsoff_tracer_start(struct trace_array *tr) | 397 | static void irqsoff_tracer_start(struct trace_array *tr) |
406 | { | 398 | { |
407 | tracer_enabled = 1; | 399 | tracer_enabled = 1; |
@@ -442,7 +434,6 @@ static struct tracer irqsoff_tracer __read_mostly = | |||
442 | .stop = irqsoff_tracer_stop, | 434 | .stop = irqsoff_tracer_stop, |
443 | .open = irqsoff_tracer_open, | 435 | .open = irqsoff_tracer_open, |
444 | .close = irqsoff_tracer_close, | 436 | .close = irqsoff_tracer_close, |
445 | .ctrl_update = irqsoff_tracer_ctrl_update, | ||
446 | .print_max = 1, | 437 | .print_max = 1, |
447 | #ifdef CONFIG_FTRACE_SELFTEST | 438 | #ifdef CONFIG_FTRACE_SELFTEST |
448 | .selftest = trace_selftest_startup_irqsoff, | 439 | .selftest = trace_selftest_startup_irqsoff, |
@@ -470,7 +461,6 @@ static struct tracer preemptoff_tracer __read_mostly = | |||
470 | .stop = irqsoff_tracer_stop, | 461 | .stop = irqsoff_tracer_stop, |
471 | .open = irqsoff_tracer_open, | 462 | .open = irqsoff_tracer_open, |
472 | .close = irqsoff_tracer_close, | 463 | .close = irqsoff_tracer_close, |
473 | .ctrl_update = irqsoff_tracer_ctrl_update, | ||
474 | .print_max = 1, | 464 | .print_max = 1, |
475 | #ifdef CONFIG_FTRACE_SELFTEST | 465 | #ifdef CONFIG_FTRACE_SELFTEST |
476 | .selftest = trace_selftest_startup_preemptoff, | 466 | .selftest = trace_selftest_startup_preemptoff, |
@@ -500,7 +490,6 @@ static struct tracer preemptirqsoff_tracer __read_mostly = | |||
500 | .stop = irqsoff_tracer_stop, | 490 | .stop = irqsoff_tracer_stop, |
501 | .open = irqsoff_tracer_open, | 491 | .open = irqsoff_tracer_open, |
502 | .close = irqsoff_tracer_close, | 492 | .close = irqsoff_tracer_close, |
503 | .ctrl_update = irqsoff_tracer_ctrl_update, | ||
504 | .print_max = 1, | 493 | .print_max = 1, |
505 | #ifdef CONFIG_FTRACE_SELFTEST | 494 | #ifdef CONFIG_FTRACE_SELFTEST |
506 | .selftest = trace_selftest_startup_preemptirqsoff, | 495 | .selftest = trace_selftest_startup_preemptirqsoff, |
diff --git a/kernel/trace/trace_mmiotrace.c b/kernel/trace/trace_mmiotrace.c index f28484618ff0..fa9354e78b57 100644 --- a/kernel/trace/trace_mmiotrace.c +++ b/kernel/trace/trace_mmiotrace.c | |||
@@ -49,15 +49,10 @@ static void mmio_trace_reset(struct trace_array *tr) | |||
49 | mmio_trace_array = NULL; | 49 | mmio_trace_array = NULL; |
50 | } | 50 | } |
51 | 51 | ||
52 | static void mmio_trace_ctrl_update(struct trace_array *tr) | 52 | static void mmio_trace_start(struct trace_array *tr) |
53 | { | 53 | { |
54 | pr_debug("in %s\n", __func__); | 54 | pr_debug("in %s\n", __func__); |
55 | if (tr->ctrl) { | 55 | mmio_reset_data(tr); |
56 | mmio_reset_data(tr); | ||
57 | enable_mmiotrace(); | ||
58 | } else { | ||
59 | disable_mmiotrace(); | ||
60 | } | ||
61 | } | 56 | } |
62 | 57 | ||
63 | static int mmio_print_pcidev(struct trace_seq *s, const struct pci_dev *dev) | 58 | static int mmio_print_pcidev(struct trace_seq *s, const struct pci_dev *dev) |
@@ -298,10 +293,10 @@ static struct tracer mmio_tracer __read_mostly = | |||
298 | .name = "mmiotrace", | 293 | .name = "mmiotrace", |
299 | .init = mmio_trace_init, | 294 | .init = mmio_trace_init, |
300 | .reset = mmio_trace_reset, | 295 | .reset = mmio_trace_reset, |
296 | .start = mmio_trace_start, | ||
301 | .pipe_open = mmio_pipe_open, | 297 | .pipe_open = mmio_pipe_open, |
302 | .close = mmio_close, | 298 | .close = mmio_close, |
303 | .read = mmio_read, | 299 | .read = mmio_read, |
304 | .ctrl_update = mmio_trace_ctrl_update, | ||
305 | .print_line = mmio_print_line, | 300 | .print_line = mmio_print_line, |
306 | }; | 301 | }; |
307 | 302 | ||
diff --git a/kernel/trace/trace_nop.c b/kernel/trace/trace_nop.c index 4592b4862515..e3c5fbfcdd36 100644 --- a/kernel/trace/trace_nop.c +++ b/kernel/trace/trace_nop.c | |||
@@ -42,21 +42,11 @@ static void nop_trace_reset(struct trace_array *tr) | |||
42 | stop_nop_trace(tr); | 42 | stop_nop_trace(tr); |
43 | } | 43 | } |
44 | 44 | ||
45 | static void nop_trace_ctrl_update(struct trace_array *tr) | ||
46 | { | ||
47 | /* When starting a new trace, reset the buffers */ | ||
48 | if (tr->ctrl) | ||
49 | start_nop_trace(tr); | ||
50 | else | ||
51 | stop_nop_trace(tr); | ||
52 | } | ||
53 | |||
54 | struct tracer nop_trace __read_mostly = | 45 | struct tracer nop_trace __read_mostly = |
55 | { | 46 | { |
56 | .name = "nop", | 47 | .name = "nop", |
57 | .init = nop_trace_init, | 48 | .init = nop_trace_init, |
58 | .reset = nop_trace_reset, | 49 | .reset = nop_trace_reset, |
59 | .ctrl_update = nop_trace_ctrl_update, | ||
60 | #ifdef CONFIG_FTRACE_SELFTEST | 50 | #ifdef CONFIG_FTRACE_SELFTEST |
61 | .selftest = trace_selftest_startup_nop, | 51 | .selftest = trace_selftest_startup_nop, |
62 | #endif | 52 | #endif |
diff --git a/kernel/trace/trace_sched_switch.c b/kernel/trace/trace_sched_switch.c index 79410db64d6f..7b73fd11e4aa 100644 --- a/kernel/trace/trace_sched_switch.c +++ b/kernel/trace/trace_sched_switch.c | |||
@@ -220,15 +220,6 @@ static void sched_switch_trace_reset(struct trace_array *tr) | |||
220 | stop_sched_trace(tr); | 220 | stop_sched_trace(tr); |
221 | } | 221 | } |
222 | 222 | ||
223 | static void sched_switch_trace_ctrl_update(struct trace_array *tr) | ||
224 | { | ||
225 | /* When starting a new trace, reset the buffers */ | ||
226 | if (tr->ctrl) | ||
227 | start_sched_trace(tr); | ||
228 | else | ||
229 | stop_sched_trace(tr); | ||
230 | } | ||
231 | |||
232 | static void sched_switch_trace_start(struct trace_array *tr) | 223 | static void sched_switch_trace_start(struct trace_array *tr) |
233 | { | 224 | { |
234 | sched_switch_reset(tr); | 225 | sched_switch_reset(tr); |
@@ -247,7 +238,6 @@ static struct tracer sched_switch_trace __read_mostly = | |||
247 | .reset = sched_switch_trace_reset, | 238 | .reset = sched_switch_trace_reset, |
248 | .start = sched_switch_trace_start, | 239 | .start = sched_switch_trace_start, |
249 | .stop = sched_switch_trace_stop, | 240 | .stop = sched_switch_trace_stop, |
250 | .ctrl_update = sched_switch_trace_ctrl_update, | ||
251 | #ifdef CONFIG_FTRACE_SELFTEST | 241 | #ifdef CONFIG_FTRACE_SELFTEST |
252 | .selftest = trace_selftest_startup_sched_switch, | 242 | .selftest = trace_selftest_startup_sched_switch, |
253 | #endif | 243 | #endif |
diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c index 240577bc8ba5..23e54d4e4d92 100644 --- a/kernel/trace/trace_sched_wakeup.c +++ b/kernel/trace/trace_sched_wakeup.c | |||
@@ -348,14 +348,6 @@ static void wakeup_tracer_reset(struct trace_array *tr) | |||
348 | } | 348 | } |
349 | } | 349 | } |
350 | 350 | ||
351 | static void wakeup_tracer_ctrl_update(struct trace_array *tr) | ||
352 | { | ||
353 | if (tr->ctrl) | ||
354 | start_wakeup_tracer(tr); | ||
355 | else | ||
356 | stop_wakeup_tracer(tr); | ||
357 | } | ||
358 | |||
359 | static void wakeup_tracer_start(struct trace_array *tr) | 351 | static void wakeup_tracer_start(struct trace_array *tr) |
360 | { | 352 | { |
361 | wakeup_reset(tr); | 353 | wakeup_reset(tr); |
@@ -393,7 +385,6 @@ static struct tracer wakeup_tracer __read_mostly = | |||
393 | .stop = wakeup_tracer_stop, | 385 | .stop = wakeup_tracer_stop, |
394 | .open = wakeup_tracer_open, | 386 | .open = wakeup_tracer_open, |
395 | .close = wakeup_tracer_close, | 387 | .close = wakeup_tracer_close, |
396 | .ctrl_update = wakeup_tracer_ctrl_update, | ||
397 | .print_max = 1, | 388 | .print_max = 1, |
398 | #ifdef CONFIG_FTRACE_SELFTEST | 389 | #ifdef CONFIG_FTRACE_SELFTEST |
399 | .selftest = trace_selftest_startup_wakeup, | 390 | .selftest = trace_selftest_startup_wakeup, |
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c index 90bc752a7580..746934340474 100644 --- a/kernel/trace/trace_selftest.c +++ b/kernel/trace/trace_selftest.c | |||
@@ -134,13 +134,13 @@ int trace_selftest_startup_dynamic_tracing(struct tracer *trace, | |||
134 | msleep(100); | 134 | msleep(100); |
135 | 135 | ||
136 | /* stop the tracing. */ | 136 | /* stop the tracing. */ |
137 | tr->ctrl = 0; | 137 | tracing_stop(); |
138 | trace->ctrl_update(tr); | ||
139 | ftrace_enabled = 0; | 138 | ftrace_enabled = 0; |
140 | 139 | ||
141 | /* check the trace buffer */ | 140 | /* check the trace buffer */ |
142 | ret = trace_test_buffer(tr, &count); | 141 | ret = trace_test_buffer(tr, &count); |
143 | trace->reset(tr); | 142 | trace->reset(tr); |
143 | tracing_start(); | ||
144 | 144 | ||
145 | /* we should only have one item */ | 145 | /* we should only have one item */ |
146 | if (!ret && count != 1) { | 146 | if (!ret && count != 1) { |
@@ -148,6 +148,7 @@ int trace_selftest_startup_dynamic_tracing(struct tracer *trace, | |||
148 | ret = -1; | 148 | ret = -1; |
149 | goto out; | 149 | goto out; |
150 | } | 150 | } |
151 | |||
151 | out: | 152 | out: |
152 | ftrace_enabled = save_ftrace_enabled; | 153 | ftrace_enabled = save_ftrace_enabled; |
153 | tracer_enabled = save_tracer_enabled; | 154 | tracer_enabled = save_tracer_enabled; |
@@ -185,13 +186,13 @@ trace_selftest_startup_function(struct tracer *trace, struct trace_array *tr) | |||
185 | /* Sleep for a 1/10 of a second */ | 186 | /* Sleep for a 1/10 of a second */ |
186 | msleep(100); | 187 | msleep(100); |
187 | /* stop the tracing. */ | 188 | /* stop the tracing. */ |
188 | tr->ctrl = 0; | 189 | tracing_stop(); |
189 | trace->ctrl_update(tr); | ||
190 | ftrace_enabled = 0; | 190 | ftrace_enabled = 0; |
191 | 191 | ||
192 | /* check the trace buffer */ | 192 | /* check the trace buffer */ |
193 | ret = trace_test_buffer(tr, &count); | 193 | ret = trace_test_buffer(tr, &count); |
194 | trace->reset(tr); | 194 | trace->reset(tr); |
195 | tracing_start(); | ||
195 | 196 | ||
196 | if (!ret && !count) { | 197 | if (!ret && !count) { |
197 | printk(KERN_CONT ".. no entries found .."); | 198 | printk(KERN_CONT ".. no entries found .."); |
@@ -232,13 +233,13 @@ trace_selftest_startup_irqsoff(struct tracer *trace, struct trace_array *tr) | |||
232 | udelay(100); | 233 | udelay(100); |
233 | local_irq_enable(); | 234 | local_irq_enable(); |
234 | /* stop the tracing. */ | 235 | /* stop the tracing. */ |
235 | tr->ctrl = 0; | 236 | tracing_stop(); |
236 | trace->ctrl_update(tr); | ||
237 | /* check both trace buffers */ | 237 | /* check both trace buffers */ |
238 | ret = trace_test_buffer(tr, NULL); | 238 | ret = trace_test_buffer(tr, NULL); |
239 | if (!ret) | 239 | if (!ret) |
240 | ret = trace_test_buffer(&max_tr, &count); | 240 | ret = trace_test_buffer(&max_tr, &count); |
241 | trace->reset(tr); | 241 | trace->reset(tr); |
242 | tracing_start(); | ||
242 | 243 | ||
243 | if (!ret && !count) { | 244 | if (!ret && !count) { |
244 | printk(KERN_CONT ".. no entries found .."); | 245 | printk(KERN_CONT ".. no entries found .."); |
@@ -269,13 +270,13 @@ trace_selftest_startup_preemptoff(struct tracer *trace, struct trace_array *tr) | |||
269 | udelay(100); | 270 | udelay(100); |
270 | preempt_enable(); | 271 | preempt_enable(); |
271 | /* stop the tracing. */ | 272 | /* stop the tracing. */ |
272 | tr->ctrl = 0; | 273 | tracing_stop(); |
273 | trace->ctrl_update(tr); | ||
274 | /* check both trace buffers */ | 274 | /* check both trace buffers */ |
275 | ret = trace_test_buffer(tr, NULL); | 275 | ret = trace_test_buffer(tr, NULL); |
276 | if (!ret) | 276 | if (!ret) |
277 | ret = trace_test_buffer(&max_tr, &count); | 277 | ret = trace_test_buffer(&max_tr, &count); |
278 | trace->reset(tr); | 278 | trace->reset(tr); |
279 | tracing_start(); | ||
279 | 280 | ||
280 | if (!ret && !count) { | 281 | if (!ret && !count) { |
281 | printk(KERN_CONT ".. no entries found .."); | 282 | printk(KERN_CONT ".. no entries found .."); |
@@ -312,27 +313,30 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array * | |||
312 | local_irq_enable(); | 313 | local_irq_enable(); |
313 | 314 | ||
314 | /* stop the tracing. */ | 315 | /* stop the tracing. */ |
315 | tr->ctrl = 0; | 316 | tracing_stop(); |
316 | trace->ctrl_update(tr); | ||
317 | /* check both trace buffers */ | 317 | /* check both trace buffers */ |
318 | ret = trace_test_buffer(tr, NULL); | 318 | ret = trace_test_buffer(tr, NULL); |
319 | if (ret) | 319 | if (ret) { |
320 | tracing_start(); | ||
320 | goto out; | 321 | goto out; |
322 | } | ||
321 | 323 | ||
322 | ret = trace_test_buffer(&max_tr, &count); | 324 | ret = trace_test_buffer(&max_tr, &count); |
323 | if (ret) | 325 | if (ret) { |
326 | tracing_start(); | ||
324 | goto out; | 327 | goto out; |
328 | } | ||
325 | 329 | ||
326 | if (!ret && !count) { | 330 | if (!ret && !count) { |
327 | printk(KERN_CONT ".. no entries found .."); | 331 | printk(KERN_CONT ".. no entries found .."); |
328 | ret = -1; | 332 | ret = -1; |
333 | tracing_start(); | ||
329 | goto out; | 334 | goto out; |
330 | } | 335 | } |
331 | 336 | ||
332 | /* do the test by disabling interrupts first this time */ | 337 | /* do the test by disabling interrupts first this time */ |
333 | tracing_max_latency = 0; | 338 | tracing_max_latency = 0; |
334 | tr->ctrl = 1; | 339 | tracing_start(); |
335 | trace->ctrl_update(tr); | ||
336 | preempt_disable(); | 340 | preempt_disable(); |
337 | local_irq_disable(); | 341 | local_irq_disable(); |
338 | udelay(100); | 342 | udelay(100); |
@@ -341,8 +345,7 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array * | |||
341 | local_irq_enable(); | 345 | local_irq_enable(); |
342 | 346 | ||
343 | /* stop the tracing. */ | 347 | /* stop the tracing. */ |
344 | tr->ctrl = 0; | 348 | tracing_stop(); |
345 | trace->ctrl_update(tr); | ||
346 | /* check both trace buffers */ | 349 | /* check both trace buffers */ |
347 | ret = trace_test_buffer(tr, NULL); | 350 | ret = trace_test_buffer(tr, NULL); |
348 | if (ret) | 351 | if (ret) |
@@ -358,6 +361,7 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array * | |||
358 | 361 | ||
359 | out: | 362 | out: |
360 | trace->reset(tr); | 363 | trace->reset(tr); |
364 | tracing_start(); | ||
361 | tracing_max_latency = save_max; | 365 | tracing_max_latency = save_max; |
362 | 366 | ||
363 | return ret; | 367 | return ret; |
@@ -448,8 +452,7 @@ trace_selftest_startup_wakeup(struct tracer *trace, struct trace_array *tr) | |||
448 | msleep(100); | 452 | msleep(100); |
449 | 453 | ||
450 | /* stop the tracing. */ | 454 | /* stop the tracing. */ |
451 | tr->ctrl = 0; | 455 | tracing_stop(); |
452 | trace->ctrl_update(tr); | ||
453 | /* check both trace buffers */ | 456 | /* check both trace buffers */ |
454 | ret = trace_test_buffer(tr, NULL); | 457 | ret = trace_test_buffer(tr, NULL); |
455 | if (!ret) | 458 | if (!ret) |
@@ -457,6 +460,7 @@ trace_selftest_startup_wakeup(struct tracer *trace, struct trace_array *tr) | |||
457 | 460 | ||
458 | 461 | ||
459 | trace->reset(tr); | 462 | trace->reset(tr); |
463 | tracing_start(); | ||
460 | 464 | ||
461 | tracing_max_latency = save_max; | 465 | tracing_max_latency = save_max; |
462 | 466 | ||
@@ -485,11 +489,11 @@ trace_selftest_startup_sched_switch(struct tracer *trace, struct trace_array *tr | |||
485 | /* Sleep for a 1/10 of a second */ | 489 | /* Sleep for a 1/10 of a second */ |
486 | msleep(100); | 490 | msleep(100); |
487 | /* stop the tracing. */ | 491 | /* stop the tracing. */ |
488 | tr->ctrl = 0; | 492 | tracing_stop(); |
489 | trace->ctrl_update(tr); | ||
490 | /* check the trace buffer */ | 493 | /* check the trace buffer */ |
491 | ret = trace_test_buffer(tr, &count); | 494 | ret = trace_test_buffer(tr, &count); |
492 | trace->reset(tr); | 495 | trace->reset(tr); |
496 | tracing_start(); | ||
493 | 497 | ||
494 | if (!ret && !count) { | 498 | if (!ret && !count) { |
495 | printk(KERN_CONT ".. no entries found .."); | 499 | printk(KERN_CONT ".. no entries found .."); |
@@ -513,11 +517,11 @@ trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr) | |||
513 | /* Sleep for a 1/10 of a second */ | 517 | /* Sleep for a 1/10 of a second */ |
514 | msleep(100); | 518 | msleep(100); |
515 | /* stop the tracing. */ | 519 | /* stop the tracing. */ |
516 | tr->ctrl = 0; | 520 | tracing_stop(); |
517 | trace->ctrl_update(tr); | ||
518 | /* check the trace buffer */ | 521 | /* check the trace buffer */ |
519 | ret = trace_test_buffer(tr, &count); | 522 | ret = trace_test_buffer(tr, &count); |
520 | trace->reset(tr); | 523 | trace->reset(tr); |
524 | tracing_start(); | ||
521 | 525 | ||
522 | return ret; | 526 | return ret; |
523 | } | 527 | } |
diff --git a/kernel/trace/trace_sysprof.c b/kernel/trace/trace_sysprof.c index 9587d3bcba55..8097430edff9 100644 --- a/kernel/trace/trace_sysprof.c +++ b/kernel/trace/trace_sysprof.c | |||
@@ -275,21 +275,11 @@ static void stack_trace_reset(struct trace_array *tr) | |||
275 | stop_stack_trace(tr); | 275 | stop_stack_trace(tr); |
276 | } | 276 | } |
277 | 277 | ||
278 | static void stack_trace_ctrl_update(struct trace_array *tr) | ||
279 | { | ||
280 | /* When starting a new trace, reset the buffers */ | ||
281 | if (tr->ctrl) | ||
282 | start_stack_trace(tr); | ||
283 | else | ||
284 | stop_stack_trace(tr); | ||
285 | } | ||
286 | |||
287 | static struct tracer stack_trace __read_mostly = | 278 | static struct tracer stack_trace __read_mostly = |
288 | { | 279 | { |
289 | .name = "sysprof", | 280 | .name = "sysprof", |
290 | .init = stack_trace_init, | 281 | .init = stack_trace_init, |
291 | .reset = stack_trace_reset, | 282 | .reset = stack_trace_reset, |
292 | .ctrl_update = stack_trace_ctrl_update, | ||
293 | #ifdef CONFIG_FTRACE_SELFTEST | 283 | #ifdef CONFIG_FTRACE_SELFTEST |
294 | .selftest = trace_selftest_startup_sysprof, | 284 | .selftest = trace_selftest_startup_sysprof, |
295 | #endif | 285 | #endif |