feat(ble): update bluedroid log compression configs to including btc and osi

This commit is contained in:
luoxu
2026-08-26 14:50:04 +08:00
parent 27322efe3b
commit 4dcd9d3e13
4 changed files with 23 additions and 8 deletions

View File

@@ -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)

View File

@@ -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@]

View File

@@ -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_ */

View File

@@ -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"