summaryrefslogtreecommitdiff
path: root/samples/trace_events/trace-events-sample.c
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2015-02-09 20:27:04 (GMT)
committerSteven Rostedt <rostedt@goodmis.org>2015-02-09 20:27:04 (GMT)
commit4e20e3a60b57efa1e5c26324ce0260d58be6c81b (patch)
tree02f4d3be1dd9038d59be74f4a90cffa0575e2b75 /samples/trace_events/trace-events-sample.c
parent7eeafbcab47fe9860e5106286db83d60e3f35644 (diff)
downloadlinux-4e20e3a60b57efa1e5c26324ce0260d58be6c81b.tar.xz
tracing: Update the TRACE_EVENT fields available in the sample code
The sample code in samples/trace_events/ is extremely out of date and does not show all the new fields that have been added since the sample code was written. As most people are unaware of these new fields, adding sample code and explanations of those fields should help out. 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.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/samples/trace_events/trace-events-sample.c b/samples/trace_events/trace-events-sample.c
index aabc4e9..16c15c0 100644
--- a/samples/trace_events/trace-events-sample.c
+++ b/samples/trace_events/trace-events-sample.c
@@ -10,12 +10,29 @@
#define CREATE_TRACE_POINTS
#include "trace-events-sample.h"
+static const char *random_strings[] = {
+ "Mother Goose",
+ "Snoopy",
+ "Gandalf",
+ "Frodo",
+ "One ring to rule them all"
+};
static void simple_thread_func(int cnt)
{
+ int array[6];
+ int len = cnt % 5;
+ int i;
+
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ);
- trace_foo_bar("hello", cnt);
+
+ for (i = 0; i < len; i++)
+ array[i] = i + 1;
+ array[i] = 0;
+
+ trace_foo_bar("hello", cnt, array, random_strings[len],
+ tsk_cpus_allowed(current));
}
static int simple_thread(void *arg)