Loading system/btif/src/bluetooth.cc +2 −0 Original line number Original line Diff line number Diff line Loading @@ -96,6 +96,7 @@ #include "osi/include/allocator.h" #include "osi/include/allocator.h" #include "osi/include/stack_power_telemetry.h" #include "osi/include/stack_power_telemetry.h" #include "osi/include/wakelock.h" #include "osi/include/wakelock.h" #include "stack/btm/btm_dev.h" #include "stack/btm/btm_sco_hfp_hal.h" #include "stack/btm/btm_sco_hfp_hal.h" #include "stack/gatt/connection_manager.h" #include "stack/gatt/connection_manager.h" #include "stack/include/a2dp_api.h" #include "stack/include/a2dp_api.h" Loading Loading @@ -902,6 +903,7 @@ static void dump(int fd, const char** arguments) { DumpsysHid(fd); DumpsysHid(fd); DumpsysBtaDm(fd); DumpsysBtaDm(fd); SDP_Dumpsys(fd); SDP_Dumpsys(fd); DumpsysRecord(fd); bluetooth::shim::Dump(fd, arguments); bluetooth::shim::Dump(fd, arguments); power_telemetry::GetInstance().Dumpsys(fd); power_telemetry::GetInstance().Dumpsys(fd); log::debug("Finished bluetooth dumpsys"); log::debug("Finished bluetooth dumpsys"); Loading system/main/shim/acl.cc +0 −21 Original line number Original line Diff line number Diff line Loading @@ -1225,26 +1225,6 @@ void DumpsysBtm(int fd) { } } #undef DUMPSYS_TAG #undef DUMPSYS_TAG #define DUMPSYS_TAG "shim::record" void DumpsysRecord(int fd) { LOG_DUMPSYS_TITLE(fd, DUMPSYS_TAG); if (btm_sec_cb.sec_dev_rec == nullptr) { LOG_DUMPSYS(fd, "Record is empty - no devices"); return; } unsigned cnt = 0; list_node_t* end = list_end(btm_sec_cb.sec_dev_rec); for (list_node_t* node = list_begin(btm_sec_cb.sec_dev_rec); node != end; node = list_next(node)) { tBTM_SEC_DEV_REC* p_dev_rec = static_cast<tBTM_SEC_DEV_REC*>(list_node(node)); // TODO: handle in tBTM_SEC_DEV_REC.ToString LOG_DUMPSYS(fd, "%03u %s", ++cnt, p_dev_rec->ToString().c_str()); } } #undef DUMPSYS_TAG #define DUMPSYS_TAG "shim::stack" #define DUMPSYS_TAG "shim::stack" void DumpsysNeighbor(int fd) { void DumpsysNeighbor(int fd) { LOG_DUMPSYS(fd, "Stack information %lc%lc", kRunicBjarkan, kRunicHagall); LOG_DUMPSYS(fd, "Stack information %lc%lc", kRunicBjarkan, kRunicHagall); Loading Loading @@ -1283,7 +1263,6 @@ void DumpsysNeighbor(int fd) { #undef DUMPSYS_TAG #undef DUMPSYS_TAG void shim::Acl::Dump(int fd) const { void shim::Acl::Dump(int fd) const { DumpsysRecord(fd); DumpsysNeighbor(fd); DumpsysNeighbor(fd); DumpsysAcl(fd); DumpsysAcl(fd); L2CA_Dumpsys(fd); L2CA_Dumpsys(fd); Loading system/stack/btm/btm_dev.cc +21 −0 Original line number Original line Diff line number Diff line Loading @@ -38,6 +38,7 @@ #include "common/init_flags.h" #include "common/init_flags.h" #include "internal_include/bt_target.h" #include "internal_include/bt_target.h" #include "l2c_api.h" #include "l2c_api.h" #include "main/shim/dumpsys.h" #include "osi/include/allocator.h" #include "osi/include/allocator.h" #include "rust/src/connection/ffi/connection_shim.h" #include "rust/src/connection/ffi/connection_shim.h" #include "stack/btm/btm_sec.h" #include "stack/btm/btm_sec.h" Loading Loading @@ -778,6 +779,26 @@ const tBLE_BD_ADDR BTM_Sec_GetAddressWithType(const RawAddress& bd_addr) { } } } } #define DUMPSYS_TAG "shim::record" void DumpsysRecord(int fd) { LOG_DUMPSYS_TITLE(fd, DUMPSYS_TAG); if (btm_sec_cb.sec_dev_rec == nullptr) { LOG_DUMPSYS(fd, "Record is empty - no devices"); return; } unsigned cnt = 0; list_node_t* end = list_end(btm_sec_cb.sec_dev_rec); for (list_node_t* node = list_begin(btm_sec_cb.sec_dev_rec); node != end; node = list_next(node)) { tBTM_SEC_DEV_REC* p_dev_rec = static_cast<tBTM_SEC_DEV_REC*>(list_node(node)); // TODO: handle in tBTM_SEC_DEV_REC.ToString LOG_DUMPSYS(fd, "%03u %s", ++cnt, p_dev_rec->ToString().c_str()); } } #undef DUMPSYS_TAG namespace bluetooth { namespace bluetooth { namespace testing { namespace testing { namespace legacy { namespace legacy { Loading system/stack/btm/btm_dev.h +11 −0 Original line number Original line Diff line number Diff line Loading @@ -192,3 +192,14 @@ std::vector<tBTM_SEC_DEV_REC*> btm_get_sec_dev_rec(); bool BTM_Sec_AddressKnown(const RawAddress& address); bool BTM_Sec_AddressKnown(const RawAddress& address); const tBLE_BD_ADDR BTM_Sec_GetAddressWithType(const RawAddress& bd_addr); const tBLE_BD_ADDR BTM_Sec_GetAddressWithType(const RawAddress& bd_addr); /******************************************************************************* * * Function DumpsysRecord * * Description Provides dumpsys access to device records. * * Returns void * ******************************************************************************/ void DumpsysRecord(int fd); system/stack/test/btm/stack_btm_dev_test.cc +3 −0 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,7 @@ #include <gmock/gmock.h> #include <gmock/gmock.h> #include <gtest/gtest.h> #include <gtest/gtest.h> #include <unistd.h> #include "stack/btm/btm_dev.h" #include "stack/btm/btm_dev.h" #include "stack/btm/btm_sec_cb.h" #include "stack/btm/btm_sec_cb.h" Loading @@ -41,3 +42,5 @@ TEST_F(StackBtmDevTest, btm_sec_allocate_dev_rec__with_list) { ASSERT_NE(nullptr, btm_sec_allocate_dev_rec()); ASSERT_NE(nullptr, btm_sec_allocate_dev_rec()); ::btm_sec_cb.Free(); ::btm_sec_cb.Free(); } } TEST_F(StackBtmDevTest, DumpsysRecord) { DumpsysRecord(STDOUT_FILENO); } Loading
system/btif/src/bluetooth.cc +2 −0 Original line number Original line Diff line number Diff line Loading @@ -96,6 +96,7 @@ #include "osi/include/allocator.h" #include "osi/include/allocator.h" #include "osi/include/stack_power_telemetry.h" #include "osi/include/stack_power_telemetry.h" #include "osi/include/wakelock.h" #include "osi/include/wakelock.h" #include "stack/btm/btm_dev.h" #include "stack/btm/btm_sco_hfp_hal.h" #include "stack/btm/btm_sco_hfp_hal.h" #include "stack/gatt/connection_manager.h" #include "stack/gatt/connection_manager.h" #include "stack/include/a2dp_api.h" #include "stack/include/a2dp_api.h" Loading Loading @@ -902,6 +903,7 @@ static void dump(int fd, const char** arguments) { DumpsysHid(fd); DumpsysHid(fd); DumpsysBtaDm(fd); DumpsysBtaDm(fd); SDP_Dumpsys(fd); SDP_Dumpsys(fd); DumpsysRecord(fd); bluetooth::shim::Dump(fd, arguments); bluetooth::shim::Dump(fd, arguments); power_telemetry::GetInstance().Dumpsys(fd); power_telemetry::GetInstance().Dumpsys(fd); log::debug("Finished bluetooth dumpsys"); log::debug("Finished bluetooth dumpsys"); Loading
system/main/shim/acl.cc +0 −21 Original line number Original line Diff line number Diff line Loading @@ -1225,26 +1225,6 @@ void DumpsysBtm(int fd) { } } #undef DUMPSYS_TAG #undef DUMPSYS_TAG #define DUMPSYS_TAG "shim::record" void DumpsysRecord(int fd) { LOG_DUMPSYS_TITLE(fd, DUMPSYS_TAG); if (btm_sec_cb.sec_dev_rec == nullptr) { LOG_DUMPSYS(fd, "Record is empty - no devices"); return; } unsigned cnt = 0; list_node_t* end = list_end(btm_sec_cb.sec_dev_rec); for (list_node_t* node = list_begin(btm_sec_cb.sec_dev_rec); node != end; node = list_next(node)) { tBTM_SEC_DEV_REC* p_dev_rec = static_cast<tBTM_SEC_DEV_REC*>(list_node(node)); // TODO: handle in tBTM_SEC_DEV_REC.ToString LOG_DUMPSYS(fd, "%03u %s", ++cnt, p_dev_rec->ToString().c_str()); } } #undef DUMPSYS_TAG #define DUMPSYS_TAG "shim::stack" #define DUMPSYS_TAG "shim::stack" void DumpsysNeighbor(int fd) { void DumpsysNeighbor(int fd) { LOG_DUMPSYS(fd, "Stack information %lc%lc", kRunicBjarkan, kRunicHagall); LOG_DUMPSYS(fd, "Stack information %lc%lc", kRunicBjarkan, kRunicHagall); Loading Loading @@ -1283,7 +1263,6 @@ void DumpsysNeighbor(int fd) { #undef DUMPSYS_TAG #undef DUMPSYS_TAG void shim::Acl::Dump(int fd) const { void shim::Acl::Dump(int fd) const { DumpsysRecord(fd); DumpsysNeighbor(fd); DumpsysNeighbor(fd); DumpsysAcl(fd); DumpsysAcl(fd); L2CA_Dumpsys(fd); L2CA_Dumpsys(fd); Loading
system/stack/btm/btm_dev.cc +21 −0 Original line number Original line Diff line number Diff line Loading @@ -38,6 +38,7 @@ #include "common/init_flags.h" #include "common/init_flags.h" #include "internal_include/bt_target.h" #include "internal_include/bt_target.h" #include "l2c_api.h" #include "l2c_api.h" #include "main/shim/dumpsys.h" #include "osi/include/allocator.h" #include "osi/include/allocator.h" #include "rust/src/connection/ffi/connection_shim.h" #include "rust/src/connection/ffi/connection_shim.h" #include "stack/btm/btm_sec.h" #include "stack/btm/btm_sec.h" Loading Loading @@ -778,6 +779,26 @@ const tBLE_BD_ADDR BTM_Sec_GetAddressWithType(const RawAddress& bd_addr) { } } } } #define DUMPSYS_TAG "shim::record" void DumpsysRecord(int fd) { LOG_DUMPSYS_TITLE(fd, DUMPSYS_TAG); if (btm_sec_cb.sec_dev_rec == nullptr) { LOG_DUMPSYS(fd, "Record is empty - no devices"); return; } unsigned cnt = 0; list_node_t* end = list_end(btm_sec_cb.sec_dev_rec); for (list_node_t* node = list_begin(btm_sec_cb.sec_dev_rec); node != end; node = list_next(node)) { tBTM_SEC_DEV_REC* p_dev_rec = static_cast<tBTM_SEC_DEV_REC*>(list_node(node)); // TODO: handle in tBTM_SEC_DEV_REC.ToString LOG_DUMPSYS(fd, "%03u %s", ++cnt, p_dev_rec->ToString().c_str()); } } #undef DUMPSYS_TAG namespace bluetooth { namespace bluetooth { namespace testing { namespace testing { namespace legacy { namespace legacy { Loading
system/stack/btm/btm_dev.h +11 −0 Original line number Original line Diff line number Diff line Loading @@ -192,3 +192,14 @@ std::vector<tBTM_SEC_DEV_REC*> btm_get_sec_dev_rec(); bool BTM_Sec_AddressKnown(const RawAddress& address); bool BTM_Sec_AddressKnown(const RawAddress& address); const tBLE_BD_ADDR BTM_Sec_GetAddressWithType(const RawAddress& bd_addr); const tBLE_BD_ADDR BTM_Sec_GetAddressWithType(const RawAddress& bd_addr); /******************************************************************************* * * Function DumpsysRecord * * Description Provides dumpsys access to device records. * * Returns void * ******************************************************************************/ void DumpsysRecord(int fd);
system/stack/test/btm/stack_btm_dev_test.cc +3 −0 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,7 @@ #include <gmock/gmock.h> #include <gmock/gmock.h> #include <gtest/gtest.h> #include <gtest/gtest.h> #include <unistd.h> #include "stack/btm/btm_dev.h" #include "stack/btm/btm_dev.h" #include "stack/btm/btm_sec_cb.h" #include "stack/btm/btm_sec_cb.h" Loading @@ -41,3 +42,5 @@ TEST_F(StackBtmDevTest, btm_sec_allocate_dev_rec__with_list) { ASSERT_NE(nullptr, btm_sec_allocate_dev_rec()); ASSERT_NE(nullptr, btm_sec_allocate_dev_rec()); ::btm_sec_cb.Free(); ::btm_sec_cb.Free(); } } TEST_F(StackBtmDevTest, DumpsysRecord) { DumpsysRecord(STDOUT_FILENO); }