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
44zephyr_sources_ifdef(
45  CONFIG_TRACING_BACKEND_ADSP_MEMORY_WINDOW
46  tracing_backend_adsp_memory_window.c
47  )
48
49endif()
50
51if(NOT CONFIG_PERCEPIO_TRACERECORDER AND NOT CONFIG_TRACING_CTF
52  AND NOT CONFIG_SEGGER_SYSTEMVIEW AND NOT CONFIG_TRACING_TEST
53  AND NOT CONFIG_TRACING_USER)
54  zephyr_sources(tracing_none.c)
55endif()
56
57zephyr_sources_ifdef(
58  CONFIG_TRACING_OBJECT_TRACKING
59  tracing_tracking.c
60  )
61
62zephyr_include_directories_ifdef(
63  CONFIG_TRACING
64  ${ZEPHYR_BASE}/kernel/include
65  ${ARCH_DIR}/${ARCH}/include
66)
67
68zephyr_include_directories_ifdef(CONFIG_TRACING include)
69
70add_subdirectory_ifdef(CONFIG_TRACING_CTF ctf)
71add_subdirectory_ifdef(CONFIG_SEGGER_SYSTEMVIEW sysview)
72add_subdirectory_ifdef(CONFIG_TRACING_TEST test)
73add_subdirectory_ifdef(CONFIG_TRACING_USER user)
74