diff --git a/components/bt/common/ble_log/extension/log_compression/CMakeLists.txt b/components/bt/common/ble_log/extension/log_compression/CMakeLists.txt index cc5962dbcce..f7c6164e851 100644 --- a/components/bt/common/ble_log/extension/log_compression/CMakeLists.txt +++ b/components/bt/common/ble_log/extension/log_compression/CMakeLists.txt @@ -65,7 +65,15 @@ if(CONFIG_BLE_HOST_COMPRESSED_LOG_ENABLE AND CONFIG_BT_BLUEDROID_ENABLED) list(APPEND LOG_COMPRESSED_MODULE "BLE_HOST") # update config file - set(HOST_CODE_PATH "host/bluedroid") + # BTC and OSI are shared at the source-tree level, but their TRACE macros + # and runtime log-level controls belong to Bluedroid. Keep them in the + # same compression module so they share host_log_index.h and follow the + # Bluedroid host-compression switch. + set(HOST_CODE_PATH + "host/bluedroid" + "common/btc" + "common/osi" + ) set(HOST_LOG_INDEX_HEADER "host_log_index.h") set(BLE_HOST_LOG_SCRIPT_PATH "${CMAKE_CURRENT_LIST_DIR}/scripts/module_scripts/bluedroid/make_bluedroid_log_macro.py") @@ -158,9 +166,10 @@ if(LOG_COMPRESSED_MODULE) endif() set(YML_IN "${BT_ROOT_PATH}/common/ble_log/extension/log_compression/scripts/configs/module_info.yml.in") - # BLE_ISO has multiple code paths; rewrite CMake list ";" → YAML ", " - # into a sibling variable so BLE_ISO_CODE_PATH itself stays a CMake - # list usable by any later code that wants to iterate or append. + # Modules may have multiple code paths; rewrite CMake lists ";" → + # YAML ", " into sibling variables so the originals remain CMake + # lists usable by any later code that wants to iterate or append. + string(REPLACE ";" ", " HOST_CODE_PATH_YAML "${HOST_CODE_PATH}") string(REPLACE ";" ", " BLE_ISO_CODE_PATH_YAML "${BLE_ISO_CODE_PATH}") configure_file(${YML_IN} ${CONFIG_FILE_PATH} @ONLY) diff --git a/components/bt/common/ble_log/extension/log_compression/scripts/configs/module_info.yml.in b/components/bt/common/ble_log/extension/log_compression/scripts/configs/module_info.yml.in index 9d92d65bde2..a12faa45f3f 100644 --- a/components/bt/common/ble_log/extension/log_compression/scripts/configs/module_info.yml.in +++ b/components/bt/common/ble_log/extension/log_compression/scripts/configs/module_info.yml.in @@ -12,7 +12,7 @@ log_config: BLE_HOST: description: "BLE Host" - code_path: [@HOST_CODE_PATH@] + code_path: [@HOST_CODE_PATH_YAML@] log_index_file: @HOST_LOG_INDEX_HEADER@ script: @BLE_HOST_LOG_SCRIPT_PATH@ tags: [@BLE_HOST_TAGS@] diff --git a/components/bt/common/include/bt_common.h b/components/bt/common/include/bt_common.h index 343600f36e6..c266faf653e 100644 --- a/components/bt/common/include/bt_common.h +++ b/components/bt/common/include/bt_common.h @@ -288,4 +288,13 @@ typedef UINT8 BD_ADDR[BD_ADDR_LEN]; /* Device address */ void bt_hci_log_record_insights(uint8_t data_type, const uint8_t *data, uint16_t data_len); #endif +#if CONFIG_BT_BLUEDROID_ENABLED && CONFIG_BLE_HOST_COMPRESSED_LOG_ENABLE +/* + * The generated Bluedroid index also owns the BTC/OSI/BLUFI TRACE macros + * declared by this header, including those used from common/btc and + * common/osi sources. + */ +#include "host_log_index.h" +#endif + #endif /* _BT_COMMON_H_ */ diff --git a/components/bt/host/bluedroid/common/include/common/bt_trace.h b/components/bt/host/bluedroid/common/include/common/bt_trace.h index 85ddbe58d46..b4dc1b63645 100644 --- a/components/bt/host/bluedroid/common/include/common/bt_trace.h +++ b/components/bt/host/bluedroid/common/include/common/bt_trace.h @@ -24,9 +24,6 @@ #include "bluedroid_user_config.h" #include "stack/bt_types.h" #include "bt_common.h" -#if CONFIG_BLE_HOST_COMPRESSED_LOG_ENABLE -#include "host_log_index.h" -#endif #if (BT_BLE_LOG_SPI_OUT_HOST_ENABLED && !CLASSIC_BT_INCLUDED) #include "ble_log/ble_log_spi_out.h"