ftrace: reset selftests
authorSteven Rostedt <srostedt@redhat.com>
Mon, 12 May 2008 19:20:45 +0000 (21:20 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 23 May 2008 18:41:29 +0000 (20:41 +0200)
The tests may leave stuff in the buffers. This resets the buffers
after each test is run. If a test fails, it does not reset the
buffer to avoid touching a buffer that is corrupted.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/trace/trace.c

index 8755a4370484ec84f4b947efcf81a570ad0297cc..6580e7ed04beb786ebe31e763267718251072470 100644 (file)
@@ -289,6 +289,13 @@ int register_tracer(struct tracer *type)
                        printk(KERN_CONT "FAILED!\n");
                        goto out;
                }
+               /* Only reset on passing, to avoid touching corrupted buffers */
+               for_each_possible_cpu(i) {
+                       data = tr->data[i];
+                       if (!head_page(data))
+                               continue;
+                       tracing_reset(data);
+               }
                printk(KERN_CONT "PASSED\n");
        }
 #endif
This page took 0.025944 seconds and 5 git commands to generate.