@@ -134,20 +134,21 @@ int trace_selftest_startup_dynamic_tracing(struct tracer *trace,
134134 msleep (100 );
135135
136136 /* stop the tracing. */
137- tr -> ctrl = 0 ;
138- trace -> ctrl_update (tr );
137+ tracing_stop ();
139138 ftrace_enabled = 0 ;
140139
141140 /* check the trace buffer */
142141 ret = trace_test_buffer (tr , & count );
143142 trace -> reset (tr );
143+ tracing_start ();
144144
145145 /* we should only have one item */
146146 if (!ret && count != 1 ) {
147147 printk (KERN_CONT ".. filter failed count=%ld .." , count );
148148 ret = -1 ;
149149 goto out ;
150150 }
151+
151152 out :
152153 ftrace_enabled = save_ftrace_enabled ;
153154 tracer_enabled = save_tracer_enabled ;
@@ -185,13 +186,13 @@ trace_selftest_startup_function(struct tracer *trace, struct trace_array *tr)
185186 /* Sleep for a 1/10 of a second */
186187 msleep (100 );
187188 /* stop the tracing. */
188- tr -> ctrl = 0 ;
189- trace -> ctrl_update (tr );
189+ tracing_stop ();
190190 ftrace_enabled = 0 ;
191191
192192 /* check the trace buffer */
193193 ret = trace_test_buffer (tr , & count );
194194 trace -> reset (tr );
195+ tracing_start ();
195196
196197 if (!ret && !count ) {
197198 printk (KERN_CONT ".. no entries found .." );
@@ -232,13 +233,13 @@ trace_selftest_startup_irqsoff(struct tracer *trace, struct trace_array *tr)
232233 udelay (100 );
233234 local_irq_enable ();
234235 /* stop the tracing. */
235- tr -> ctrl = 0 ;
236- trace -> ctrl_update (tr );
236+ tracing_stop ();
237237 /* check both trace buffers */
238238 ret = trace_test_buffer (tr , NULL );
239239 if (!ret )
240240 ret = trace_test_buffer (& max_tr , & count );
241241 trace -> reset (tr );
242+ tracing_start ();
242243
243244 if (!ret && !count ) {
244245 printk (KERN_CONT ".. no entries found .." );
@@ -269,13 +270,13 @@ trace_selftest_startup_preemptoff(struct tracer *trace, struct trace_array *tr)
269270 udelay (100 );
270271 preempt_enable ();
271272 /* stop the tracing. */
272- tr -> ctrl = 0 ;
273- trace -> ctrl_update (tr );
273+ tracing_stop ();
274274 /* check both trace buffers */
275275 ret = trace_test_buffer (tr , NULL );
276276 if (!ret )
277277 ret = trace_test_buffer (& max_tr , & count );
278278 trace -> reset (tr );
279+ tracing_start ();
279280
280281 if (!ret && !count ) {
281282 printk (KERN_CONT ".. no entries found .." );
@@ -312,27 +313,30 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *
312313 local_irq_enable ();
313314
314315 /* stop the tracing. */
315- tr -> ctrl = 0 ;
316- trace -> ctrl_update (tr );
316+ tracing_stop ();
317317 /* check both trace buffers */
318318 ret = trace_test_buffer (tr , NULL );
319- if (ret )
319+ if (ret ) {
320+ tracing_start ();
320321 goto out ;
322+ }
321323
322324 ret = trace_test_buffer (& max_tr , & count );
323- if (ret )
325+ if (ret ) {
326+ tracing_start ();
324327 goto out ;
328+ }
325329
326330 if (!ret && !count ) {
327331 printk (KERN_CONT ".. no entries found .." );
328332 ret = -1 ;
333+ tracing_start ();
329334 goto out ;
330335 }
331336
332337 /* do the test by disabling interrupts first this time */
333338 tracing_max_latency = 0 ;
334- tr -> ctrl = 1 ;
335- trace -> ctrl_update (tr );
339+ tracing_start ();
336340 preempt_disable ();
337341 local_irq_disable ();
338342 udelay (100 );
@@ -341,8 +345,7 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *
341345 local_irq_enable ();
342346
343347 /* stop the tracing. */
344- tr -> ctrl = 0 ;
345- trace -> ctrl_update (tr );
348+ tracing_stop ();
346349 /* check both trace buffers */
347350 ret = trace_test_buffer (tr , NULL );
348351 if (ret )
@@ -358,6 +361,7 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *
358361
359362 out :
360363 trace -> reset (tr );
364+ tracing_start ();
361365 tracing_max_latency = save_max ;
362366
363367 return ret ;
@@ -448,15 +452,15 @@ trace_selftest_startup_wakeup(struct tracer *trace, struct trace_array *tr)
448452 msleep (100 );
449453
450454 /* stop the tracing. */
451- tr -> ctrl = 0 ;
452- trace -> ctrl_update (tr );
455+ tracing_stop ();
453456 /* check both trace buffers */
454457 ret = trace_test_buffer (tr , NULL );
455458 if (!ret )
456459 ret = trace_test_buffer (& max_tr , & count );
457460
458461
459462 trace -> reset (tr );
463+ tracing_start ();
460464
461465 tracing_max_latency = save_max ;
462466
@@ -485,11 +489,11 @@ trace_selftest_startup_sched_switch(struct tracer *trace, struct trace_array *tr
485489 /* Sleep for a 1/10 of a second */
486490 msleep (100 );
487491 /* stop the tracing. */
488- tr -> ctrl = 0 ;
489- trace -> ctrl_update (tr );
492+ tracing_stop ();
490493 /* check the trace buffer */
491494 ret = trace_test_buffer (tr , & count );
492495 trace -> reset (tr );
496+ tracing_start ();
493497
494498 if (!ret && !count ) {
495499 printk (KERN_CONT ".. no entries found .." );
@@ -513,11 +517,11 @@ trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr)
513517 /* Sleep for a 1/10 of a second */
514518 msleep (100 );
515519 /* stop the tracing. */
516- tr -> ctrl = 0 ;
517- trace -> ctrl_update (tr );
520+ tracing_stop ();
518521 /* check the trace buffer */
519522 ret = trace_test_buffer (tr , & count );
520523 trace -> reset (tr );
524+ tracing_start ();
521525
522526 return ret ;
523527}
0 commit comments