diff options
Diffstat (limited to 'kernel/trace/trace_selftest.c')
| -rw-r--r-- | kernel/trace/trace_selftest.c | 48 | 
1 files changed, 26 insertions, 22 deletions
| 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 | } | 
