diff --git a/samples/subsys/tracing/CMakeLists.txt b/samples/subsys/tracing/CMakeLists.txt index 79e47acc01b..b42587f68a1 100644 --- a/samples/subsys/tracing/CMakeLists.txt +++ b/samples/subsys/tracing/CMakeLists.txt @@ -10,3 +10,4 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(tracing_tests) target_sources(app PRIVATE src/main.c) +target_sources_ifdef(CONFIG_TRACING_USER app PRIVATE src/tracing_user.c) diff --git a/samples/subsys/tracing/prj_user.conf b/samples/subsys/tracing/prj_user.conf new file mode 100644 index 00000000000..843bd16a8d2 --- /dev/null +++ b/samples/subsys/tracing/prj_user.conf @@ -0,0 +1,2 @@ +CONFIG_TRACING=y +CONFIG_TRACING_USER=y diff --git a/samples/subsys/tracing/src/tracing_user.c b/samples/subsys/tracing/src/tracing_user.c new file mode 100644 index 00000000000..a4a5d000442 --- /dev/null +++ b/samples/subsys/tracing/src/tracing_user.c @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 Lexmark International, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +void sys_trace_thread_switched_in_user(struct k_thread *thread) +{ + printk("%s: %p\n", __func__, thread); +} + +void sys_trace_thread_switched_out_user(struct k_thread *thread) +{ + printk("%s: %p\n", __func__, thread); +} + +void sys_trace_isr_enter_user(void) +{ + printk("%s\n", __func__); +} + +void sys_trace_isr_exit_user(void) +{ + printk("%s\n", __func__); +} + +void sys_trace_idle_user(void) +{ + printk("%s\n", __func__); +}