Skip to contentSkip to conversation

x86, hw-branch-tracer: add selftest

PATCH In review Markus Metzger 2 participants 2 messages Mar 5, 2009 – Mar 6, 2009 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 4/4 x86, hw-branch-tracer: add selftest

Add a selftest to the hw-branch-tracer.

---

kernel/trace/trace_hw_branches.c +4 -1
Index: gits/kernel/trace/trace_hw_branches.c
===================================================================
@@ -344,7 +344,10 @@ struct tracer bts_tracer __read_mostly =
 	.start		= bts_trace_start,
 	.stop		= bts_trace_stop,
 	.open		= trace_bts_prepare,
-	.close		= trace_bts_close
+	.close		= trace_bts_close,
+#ifdef CONFIG_FTRACE_SELFTEST
+	.selftest	= trace_selftest_startup_hw_branches,
+#endif /* CONFIG_FTRACE_SELFTEST */
 };
 
 __init static int init_bts_trace(void)
kernel/trace/trace_selftest.c +54 -0

63 lines not on this page · raw message

kernel/trace/trace.h +2 -0
Index: gits/kernel/trace/trace.h
===================================================================
@@ -555,6 +555,8 @@ extern int trace_selftest_startup_syspro
 					       struct trace_array *tr);
 extern int trace_selftest_startup_branch(struct tracer *trace,
 					 struct trace_array *tr);
+extern int trace_selftest_startup_hw_branches(struct tracer *trace,
+					      struct trace_array *tr);
 #endif /* CONFIG_FTRACE_STARTUP_TEST */
 
 extern void *head_page(struct trace_array_cpu *data);

---------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen Germany
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456 Ust.-IdNr.
VAT Registration No.: DE129385895
Citibank Frankfurt (BLZ 502 109 00) 600119052

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

#1 lore raw

kernel/trace/trace_selftest.c trace_selftest_startup_branch(struct tra · line 721

Quoted 2 lines · Markus Metzger
kernel/trace/trace_selftest.c +2 -0
+	/* the hw-branch tracer needs to collect the trace from the various
+	 * cpu trace buffers - before tracing is stopped. */

The comment style is wrong here too.

Ingo