summaryrefslogtreecommitdiffstats
path: root/samples/trace_events/trace-events-sample.c
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat)2015-02-09 23:14:04 +0100
committerSteven Rostedt2015-02-10 00:05:51 +0100
commit7496946a88ab48830f3101c08f8e770cc0902bbb (patch)
tree1fc88b3e2cdeb598b5dfe03d9aa2766d1f8f8048 /samples/trace_events/trace-events-sample.c
parenttracing: Add TRACE_EVENT_FN example (diff)
downloadkernel-qcow2-linux-7496946a88ab48830f3101c08f8e770cc0902bbb.tar.gz
kernel-qcow2-linux-7496946a88ab48830f3101c08f8e770cc0902bbb.tar.xz
kernel-qcow2-linux-7496946a88ab48830f3101c08f8e770cc0902bbb.zip
tracing: Add samples of DECLARE_EVENT_CLASS() and DEFINE_EVENT()
Add to samples/trace_events/ the macros DECLARE_EVENT_CLASS() and DEFINE_EVENT() and recommend using them over multiple TRACE_EVENT() macros if the multiple events have the same format. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'samples/trace_events/trace-events-sample.c')
-rw-r--r--samples/trace_events/trace-events-sample.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/samples/trace_events/trace-events-sample.c b/samples/trace_events/trace-events-sample.c
index 39d4484aef53..880a7d1d27d2 100644
--- a/samples/trace_events/trace-events-sample.c
+++ b/samples/trace_events/trace-events-sample.c
@@ -35,7 +35,13 @@ static void simple_thread_func(int cnt)
trace_foo_bar("hello", cnt, array, random_strings[len],
tsk_cpus_allowed(current));
+ trace_foo_with_template_simple("HELLO", cnt);
+
trace_foo_bar_with_cond("Some times print", cnt);
+
+ trace_foo_with_template_cond("prints other times", cnt);
+
+ trace_foo_with_template_print("I have to be different", cnt);
}
static int simple_thread(void *arg)
@@ -58,6 +64,7 @@ static void simple_thread_func_fn(int cnt)
/* More silly tracepoints */
trace_foo_bar_with_fn("Look at me", cnt);
+ trace_foo_with_template_fn("Look at me too", cnt);
}
static int simple_thread_fn(void *arg)