diff --git a/samples/subsys/tracing/src/main.c b/samples/subsys/tracing/src/main.c index 58523d9ff092a63..28606b12199d3ad 100644 --- a/samples/subsys/tracing/src/main.c +++ b/samples/subsys/tracing/src/main.c @@ -27,6 +27,7 @@ /* delay between greetings (in ms) */ #define SLEEPTIME 500 +static uint32_t counter; /* * @param my_name thread identification string @@ -42,6 +43,10 @@ void helloLoop(const char *my_name, /* take my semaphore */ k_sem_take(my_sem, K_FOREVER); + /* Provide a user-defined trace, with the counter value */ + sys_trace_user_event("counter_value", counter, 0); + counter++; + /* say "hello" */ tname = k_thread_name_get(k_current_get()); if (tname == NULL) {