Skip to content

Commit f05dbf9

Browse files
committed
tracing: avoid building tracing code when not applicable
Do not build tracing system if provided otherwise, for example right now systemview does not need any of the zephyr interfaces. Signed-off-by: Anas Nashif <[email protected]>
1 parent d9be19e commit f05dbf9

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

subsys/tracing/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ zephyr_sources_ifdef(
66
)
77

88
zephyr_sources_ifdef(
9-
CONFIG_TRACING
9+
CONFIG_TRACING_CORE
1010
tracing_buffer.c
1111
tracing_core.c
1212
tracing_format_common.c
1313
)
14-
14+
if(CONFIG_TRACING_CORE)
1515
zephyr_sources_ifdef(
1616
CONFIG_TRACING_SYNC
1717
tracing_format_sync.c
@@ -36,6 +36,7 @@ zephyr_sources_ifdef(
3636
CONFIG_TRACING_BACKEND_POSIX
3737
tracing_backend_posix.c
3838
)
39+
endif()
3940

4041
zephyr_include_directories_ifdef(
4142
CONFIG_TRACING

subsys/tracing/Kconfig

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ config TRACING
1616

1717
if TRACING
1818

19+
config TRACING_CORE
20+
bool
21+
help
22+
Automatically selected by formats that require the core
23+
tracing infrastructure.
1924

2025
choice
2126
prompt "Tracing Format"
@@ -32,18 +37,15 @@ config SEGGER_SYSTEMVIEW
3237
select RTT_CONSOLE
3338
select USE_SEGGER_RTT
3439

35-
config TRACING_SYSTEMVIEW
36-
bool "Tracing via SEGGER Systemview support"
37-
help
38-
Enable tracing using SEGGER Systemview.
39-
4040
config TRACING_CTF
4141
bool "Tracing via Common Trace Format support"
42+
select TRACING_CORE
4243
help
4344
Enable tracing to a Common Trace Format stream.
4445

4546
config TRACING_CPU_STATS
4647
bool "Enable CPU usage tracing"
48+
select TRACING_CORE
4749
help
4850
Module provides information about percent of CPU usage based on
4951
tracing hooks for threads switching in and out, interrupts enters
@@ -53,6 +55,7 @@ config TRACING_CPU_STATS
5355

5456
config TRACING_TEST
5557
bool "Tracing for test usage"
58+
select TRACING_CORE
5659
help
5760
Enable tracing for testing kinds of format purpose. It must
5861
implement the tracing hooks defined in tracing_test.h

0 commit comments

Comments
 (0)