Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0cc1ba88 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "stack::btm Move dumpsys to proper module" into main am: 6a6d7688 am: 29815333

parents 34c494db 29815333
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -908,6 +908,7 @@ static void dump(int fd, const char** arguments) {
  SDP_Dumpsys(fd);
  DumpsysRecord(fd);
  L2CA_Dumpsys(fd);
  DumpsysBtm(fd);
  bluetooth::shim::Dump(fd, arguments);
  power_telemetry::GetInstance().Dumpsys(fd);
  log::debug("Finished bluetooth dumpsys");
+0 −21
Original line number Diff line number Diff line
@@ -1203,26 +1203,6 @@ void DumpsysAcl(int fd) {
}
#undef DUMPSYS_TAG

using Record = common::TimestampedEntry<std::string>;
const std::string kTimeFormat("%Y-%m-%d %H:%M:%S");

#define DUMPSYS_TAG "shim::btm"
void DumpsysBtm(int fd) {
  LOG_DUMPSYS_TITLE(fd, DUMPSYS_TAG);
  if (btm_cb.history_ != nullptr) {
    std::vector<Record> history = btm_cb.history_->Pull();
    for (auto& record : history) {
      time_t then = record.timestamp / 1000;
      struct tm tm;
      localtime_r(&then, &tm);
      auto s2 = common::StringFormatTime(kTimeFormat, tm);
      LOG_DUMPSYS(fd, " %s.%03u %s", s2.c_str(), static_cast<unsigned int>(record.timestamp % 1000),
                  record.entry.c_str());
    }
  }
}
#undef DUMPSYS_TAG

#define DUMPSYS_TAG "shim::stack"
void DumpsysNeighbor(int fd) {
  LOG_DUMPSYS(fd, "Stack information %lc%lc", kRunicBjarkan, kRunicHagall);
@@ -1263,7 +1243,6 @@ void DumpsysNeighbor(int fd) {
void shim::Acl::Dump(int fd) const {
  DumpsysNeighbor(fd);
  DumpsysAcl(fd);
  DumpsysBtm(fd);
}

shim::Acl::Acl(os::Handler* handler, const acl_interface_t& acl_interface,
+23 −3
Original line number Diff line number Diff line
@@ -27,9 +27,9 @@
#include <memory>
#include <string>

#include "btm_int_types.h"
#include "internal_include/bt_target.h"
#include "os/log.h"
#include "common/strings.h"
#include "main/shim/dumpsys.h"
#include "stack/btm/btm_int_types.h"
#include "stack/include/security_client_callbacks.h"
#include "types/raw_address.h"

@@ -96,3 +96,23 @@ void BTM_LogHistory(const std::string& tag, const tBLE_BD_ADDR& ble_bd_addr,
}

bluetooth::common::TimestamperInMilliseconds timestamper_in_milliseconds;

using Record = common::TimestampedEntry<std::string>;
const std::string kTimeFormat("%Y-%m-%d %H:%M:%S");

#define DUMPSYS_TAG "shim::btm"
void DumpsysBtm(int fd) {
  LOG_DUMPSYS_TITLE(fd, DUMPSYS_TAG);
  if (btm_cb.history_ != nullptr) {
    std::vector<Record> history = btm_cb.history_->Pull();
    for (auto& record : history) {
      time_t then = record.timestamp / 1000;
      struct tm tm;
      localtime_r(&then, &tm);
      auto s2 = common::StringFormatTime(kTimeFormat, tm);
      LOG_DUMPSYS(fd, " %s.%03u %s", s2.c_str(), static_cast<unsigned int>(record.timestamp % 1000),
                  record.entry.c_str());
    }
  }
}
#undef DUMPSYS_TAG
+2 −0
Original line number Diff line number Diff line
@@ -156,3 +156,5 @@ struct btm_client_interface_t {
};

struct btm_client_interface_t& get_btm_client_interface();

void DumpsysBtm(int fd);
+0 −3
Original line number Diff line number Diff line
@@ -39,8 +39,6 @@ void DumpsysL2cap(int /* fd */) { inc_func_call_count(__func__); }

void DumpsysAcl(int /* fd */) { inc_func_call_count(__func__); }

void DumpsysBtm(int /* fd */) { inc_func_call_count(__func__); }

void DumpsysNeighbor(int /* fd */) { inc_func_call_count(__func__); }

void shim::Acl::Dump(int /* fd */) const { inc_func_call_count(__func__); }
@@ -101,7 +99,6 @@ bluetooth::hci::AddressWithType shim::Acl::GetConnectionPeerAddress(uint16_t /*
std::optional<uint8_t> shim::Acl::GetAdvertisingSetConnectedTo(const RawAddress& /* remote_bda */) {
  inc_func_call_count(__func__);
  return std::nullopt;
  ;
}

void shim::Acl::OnLeLinkDisconnected(HciHandle /* handle */, hci::ErrorCode /* reason */) {
Loading