mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
change(esp_trace): compile hot path at -O2 regardless of project optimization
Every event record runs through this component, so -Og on the rest of the
project should not set the per-event tracing overhead.
(cherry picked from commit 44a38047bb)
This commit is contained in:
@@ -40,3 +40,7 @@ idf_component_register(SRCS ${srcs}
|
||||
REQUIRES ${requires}
|
||||
WHOLE_ARCHIVE TRUE
|
||||
LDFRAGMENTS linker.lf)
|
||||
|
||||
if(CONFIG_ESP_TRACE_OPTIMIZE_SPEED)
|
||||
target_compile_options(${COMPONENT_LIB} PRIVATE -O2)
|
||||
endif()
|
||||
|
||||
@@ -108,4 +108,14 @@ menu "ESP Trace Configuration"
|
||||
|
||||
endchoice
|
||||
|
||||
config ESP_TRACE_OPTIMIZE_SPEED
|
||||
bool "Compile trace hot path for speed (-O2)"
|
||||
depends on ESP_TRACE_ENABLE
|
||||
default y
|
||||
help
|
||||
Compile this component with -O2 regardless of the project-wide
|
||||
optimization level. The per-event trace path (locking, timestamps)
|
||||
runs through this code, so its speed directly contributes to the
|
||||
per-event tracing overhead.
|
||||
|
||||
endmenu
|
||||
|
||||
Reference in New Issue
Block a user