1# SPDX-License-Identifier: Apache-2.0
2
3zephyr_sources_ifdef(
4  CONFIG_TRACING_CORE
5  tracing_buffer.c
6  tracing_core.c
7  tracing_format_common.c
8  )
9if(CONFIG_TRACING_CORE)
10zephyr_sources_ifdef(
11  CONFIG_TRACING_SYNC
12  tracing_format_sync.c
13  )
14
15zephyr_sources_ifdef(
16  CONFIG_TRACING_ASYNC
17  tracing_format_async.c
18  )
19
20zephyr_sources_ifdef(
21  CONFIG_TRACING_BACKEND_USB
22  tracing_backend_usb.c
23  )
24
25zephyr_sources_ifdef(
26  CONFIG_TRACING_BACKEND_UART
27  tracing_backend_uart.c
28  )
29
30if (CONFIG_TRACING_BACKEND_POSIX)
31  zephyr_sources(tracing_backend_posix.c)
32  if (CONFIG_NATIVE_APPLICATION)
33    zephyr_library_sources(tracing_backend_posix_bottom.c)
34  else()
35    target_sources(native_simulator INTERFACE tracing_backend_posix_bottom.c)
36  endif()
37endif()
38
39zephyr_sources_ifdef(
40  CONFIG_TRACING_BACKEND_RAM
41  tracing_backend_ram.c
42  )
43
44endif()
45
46if(NOT CONFIG_PERCEPIO_TRACERECORDER AND NOT CONFIG_TRACING_CTF
47  AND NOT CONFIG_SEGGER_SYSTEMVIEW AND NOT CONFIG_TRACING_TEST
48  AND NOT CONFIG_TRACING_USER)
49  zephyr_sources(tracing_none.c)
50endif()
51
52zephyr_sources_ifdef(
53  CONFIG_TRACING_OBJECT_TRACKING
54  tracing_tracking.c
55  )
56
57zephyr_include_directories_ifdef(
58  CONFIG_TRACING
59  ${ZEPHYR_BASE}/kernel/include
60  ${ARCH_DIR}/${ARCH}/include
61)
62
63zephyr_include_directories_ifdef(CONFIG_TRACING include)
64
65add_subdirectory_ifdef(CONFIG_TRACING_CTF ctf)
66add_subdirectory_ifdef(CONFIG_SEGGER_SYSTEMVIEW sysview)
67add_subdirectory_ifdef(CONFIG_TRACING_TEST test)
68add_subdirectory_ifdef(CONFIG_TRACING_USER user)
69