zephyr/subsys/tracing/CMakeLists.txt
Ederson de Souza bdaac354f4 kernel: Bring back object tracking
When CONFIG_TRACING_OBJECT_TRACKING is enabled, the kernel will keep
lists of some objects (detailed below), so that debuggers or other tools
can keep track of them.

The lists of objects are:

struct k_timer *_track_list_k_timer;
struct k_mem_slab *_track_list_k_mem_slab;
struct k_sem *_track_list_k_sem;
struct k_mutex *_track_list_k_mutex;
struct k_stack *_track_list_k_stack;
struct k_msgq *_track_list_k_msgq;
struct k_mbox *_track_list_k_mbox;
struct k_pipe *_track_list_k_pipe;
struct k_queue *_track_list_k_queue;

Note that while CONFIG_TRACING is needed, one can always use
CONFIG_TRACE_NONE=y. Also, tracking will only be done for objects that
are also being traced (so, to prevent tracking of some type of object,
such as k_timer, just make CONFIG_TRACING_TIMER=n).

Some simple "sanity checking" tests are also added in this patch.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2021-12-14 07:42:31 -05:00

64 lines
1.3 KiB
CMake

# SPDX-License-Identifier: Apache-2.0
zephyr_sources_ifdef(
CONFIG_TRACING_CORE
tracing_buffer.c
tracing_core.c
tracing_format_common.c
)
if(CONFIG_TRACING_CORE)
zephyr_sources_ifdef(
CONFIG_TRACING_SYNC
tracing_format_sync.c
)
zephyr_sources_ifdef(
CONFIG_TRACING_ASYNC
tracing_format_async.c
)
zephyr_sources_ifdef(
CONFIG_TRACING_BACKEND_USB
tracing_backend_usb.c
)
zephyr_sources_ifdef(
CONFIG_TRACING_BACKEND_UART
tracing_backend_uart.c
)
zephyr_sources_ifdef(
CONFIG_TRACING_BACKEND_POSIX
tracing_backend_posix.c
)
zephyr_sources_ifdef(
CONFIG_TRACING_BACKEND_RAM
tracing_backend_ram.c
)
endif()
if(NOT CONFIG_PERCEPIO_TRACERECORDER AND NOT CONFIG_TRACING_CTF
AND NOT CONFIG_SEGGER_SYSTEMVIEW AND NOT CONFIG_TRACING_TEST
AND NOT CONFIG_TRACING_USER)
zephyr_sources(tracing_none.c)
endif()
zephyr_sources_ifdef(
CONFIG_TRACING_OBJECT_TRACKING
tracing_tracking.c
)
zephyr_include_directories_ifdef(
CONFIG_TRACING
${ZEPHYR_BASE}/kernel/include
${ARCH_DIR}/${ARCH}/include
)
zephyr_include_directories_ifdef(CONFIG_TRACING include)
add_subdirectory_ifdef(CONFIG_TRACING_CTF ctf)
add_subdirectory_ifdef(CONFIG_SEGGER_SYSTEMVIEW sysview)
add_subdirectory_ifdef(CONFIG_TRACING_TEST test)
add_subdirectory_ifdef(CONFIG_TRACING_USER user)