feat(ble): Support ble log compression(draft)

This commit is contained in:
luoxu
2025-07-09 17:40:45 +08:00
committed by BLE BOT
parent fa08f239c0
commit 2d2ec6c34e
21 changed files with 3850 additions and 1 deletions
+22
View File
@@ -954,6 +954,22 @@ set(bt_priv_requires
esp_gdbstub
)
if(CONFIG_BLE_COMPRESSED_LOG_ENABLE)
set(BT_ROOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
# When log compression is enabled, selected logs are replaced
# by auto-generated macros that emit pre-encoded data.
# This eliminates the original format strings, reducing firmware size and
# removing runtime formatting overhead, so logs are produced faster and
# with less system impact.
add_subdirectory(common/ble_log/extension/log_compression)
if(LOG_COMPRESSION_TARGET)
set(srcs ${LOG_COMPRESS_SRCS})
set(include_dirs ${LOG_COMPRESS_INCLUDE_DIRS})
else()
list(APPEND include_dirs ${LOG_COMPRESS_INCLUDE_DIRS})
endif()
endif()
idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS "${include_dirs}"
PRIV_INCLUDE_DIRS "${priv_include_dirs}"
@@ -961,6 +977,12 @@ idf_component_register(SRCS "${srcs}"
PRIV_REQUIRES "${bt_priv_requires}"
LDFRAGMENTS "${ldscripts}")
if(CONFIG_BLE_COMPRESSED_LOG_ENABLE)
if(LOG_COMPRESSION_TARGET)
add_dependencies(${COMPONENT_LIB} ${LOG_COMPRESSION_TARGET})
endif()
endif()
if(CONFIG_BT_ENABLED)
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-implicit-fallthrough -Wno-unused-const-variable)
if(CONFIG_IDF_TARGET_ESP32)