summaryrefslogtreecommitdiff
path: root/samples/trace_events/trace-events-sample.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/trace_events/trace-events-sample.c')
-rw-r--r--samples/trace_events/trace-events-sample.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/samples/trace_events/trace-events-sample.c b/samples/trace_events/trace-events-sample.c
index 5522692100ba..ecc7db237f2e 100644
--- a/samples/trace_events/trace-events-sample.c
+++ b/samples/trace_events/trace-events-sample.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-only
#include <linux/module.h>
#include <linux/kthread.h>
@@ -18,8 +19,10 @@ static const char *random_strings[] = {
"One ring to rule them all"
};
-static void simple_thread_func(int cnt)
+static void do_simple_thread_func(int cnt, const char *fmt, ...)
{
+ unsigned long bitmask[1] = {0xdeadbeefUL};
+ va_list va;
int array[6];
int len = cnt % 5;
int i;
@@ -31,9 +34,13 @@ static void simple_thread_func(int cnt)
array[i] = i + 1;
array[i] = 0;
+ va_start(va, fmt);
+
/* Silly tracepoints */
trace_foo_bar("hello", cnt, array, random_strings[len],
- &current->cpus_allowed);
+ current->cpus_ptr, fmt, &va);
+
+ va_end(va);
trace_foo_with_template_simple("HELLO", cnt);
@@ -42,6 +49,13 @@ static void simple_thread_func(int cnt)
trace_foo_with_template_cond("prints other times", cnt);
trace_foo_with_template_print("I have to be different", cnt);
+
+ trace_foo_rel_loc("Hello __rel_loc", cnt, bitmask, current->cpus_ptr);
+}
+
+static void simple_thread_func(int cnt)
+{
+ do_simple_thread_func(cnt, "iter=%d", cnt);
}
static int simple_thread(void *arg)