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

Commit 1b652bd8 authored by Ying Hsu's avatar Ying Hsu Committed by Gerrit Code Review
Browse files

Merge "floss: Add kBtSnoopLogModeKernel for btsnoop mode in kernel" into main

parents 9d8ed932 a3606b32
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -446,6 +446,7 @@ const std::string SnoopLogger::kBtSnoopLogFilterProfileRfcommProperty =
const std::string SnoopLogger::kSoCManufacturerProperty = "ro.soc.manufacturer";

// persist.bluetooth.btsnooplogmode
const std::string SnoopLogger::kBtSnoopLogModeKernel = "kernel";
const std::string SnoopLogger::kBtSnoopLogModeDisabled = "disabled";
const std::string SnoopLogger::kBtSnoopLogModeFiltered = "filtered";
const std::string SnoopLogger::kBtSnoopLogModeFull = "full";
@@ -1165,6 +1166,9 @@ void SnoopLogger::Capture(const HciPacket& immutable_packet, Direction direction
      }
      btsnooz_buffer_.Push(ss.str());
      return;
    } else if (btsnoop_mode_ == kBtSnoopLogModeKernel) {
      // Skip logging as btsnoop is done in kernel space
      return;
    }

    FilterCapturedPacket(packet, direction, type, length, header);
@@ -1250,7 +1254,7 @@ void SnoopLogger::ListDependencies(ModuleList* /* list */) const {

void SnoopLogger::Start() {
  std::lock_guard<std::recursive_mutex> lock(file_mutex_);
  if (btsnoop_mode_ != kBtSnoopLogModeDisabled) {
  if (btsnoop_mode_ != kBtSnoopLogModeDisabled && btsnoop_mode_ != kBtSnoopLogModeKernel) {
    OpenNextSnoopLogFile();

    if (btsnoop_mode_ == kBtSnoopLogModeFiltered) {
+1 −0
Original line number Diff line number Diff line
@@ -155,6 +155,7 @@ public:
  static const std::string kBtSnoopLogFilterProfileRfcommProperty;
  static const std::string kSoCManufacturerProperty;

  static const std::string kBtSnoopLogModeKernel;
  static const std::string kBtSnoopLogModeDisabled;
  static const std::string kBtSnoopLogModeFiltered;
  static const std::string kBtSnoopLogModeFull;
+2 −0
Original line number Diff line number Diff line
@@ -122,6 +122,8 @@ void SyspropsModule::parse_config(std::string file_path) {
          // Profile
          "bluetooth.hid.wait_ms_after_uhid_open",
          "persist.bluetooth.avrcpcontrolversion",
          // btsnoop logger
          "persist.bluetooth.btsnooplogmode",
  };

  auto config = storage::LegacyConfigFile::FromPath(file_path).Read(kDefaultCapacity);
+3 −3
Original line number Diff line number Diff line
@@ -74,14 +74,14 @@ void Stack::StartEverything() {
  log::info("Starting Gd stack");
  ModuleList modules;

#if TARGET_FLOSS
  modules.add<sysprops::SyspropsModule>();
#endif
  modules.add<metrics::CounterMetrics>();
  modules.add<hal::HciHal>();
  modules.add<hci::HciLayer>();
  modules.add<storage::StorageModule>();
  modules.add<shim::Dumpsys>();
#if TARGET_FLOSS
  modules.add<sysprops::SyspropsModule>();
#endif

  modules.add<hci::Controller>();
  modules.add<hci::acl_manager::AclScheduler>();