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

Commit ac0fc3f6 authored by Henri Chataing's avatar Henri Chataing Committed by Gerrit Code Review
Browse files

Merge changes I4ae1e688,I04c9c51f into main

* changes:
  gd/hal/snoop_logger: Make explicit call to DumpSnoozLogToFile
  dumpsys: Remove shim dumpsys output
parents b7170eef 583d1838
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -641,10 +641,8 @@ genrule {
        "dumpsys_data.fbs",
        "module_unittest.fbs",
        "os/wakelock_manager.fbs",
        "shim/dumpsys.fbs",
    ],
    out: [
        "dumpsys.bfbs",
        "dumpsys_data.bfbs",
        "wakelock_manager.bfbs",
    ],
@@ -660,11 +658,9 @@ genrule {
        "dumpsys_data.fbs",
        "module_unittest.fbs",
        "os/wakelock_manager.fbs",
        "shim/dumpsys.fbs",
    ],
    out: [
        "dumpsys_data_generated.h",
        "dumpsys_generated.h",
        "wakelock_manager_generated.h",
    ],
}
+0 −2
Original line number Diff line number Diff line
@@ -82,7 +82,6 @@ flatbuffer("BluetoothGeneratedDumpsysDataSchema_h") {
  sources = [
    "dumpsys_data.fbs",
    "os/wakelock_manager.fbs",
    "shim/dumpsys.fbs",
  ]
}

@@ -90,7 +89,6 @@ bt_flatc_binary_schema("BluetoothGeneratedDumpsysBinarySchema_bfbs") {
  sources = [
    "dumpsys_data.fbs",
    "os/wakelock_manager.fbs",
    "shim/dumpsys.fbs",
  ]

  include_dir = "system/gd"
+0 −2
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@

include "module_unittest.fbs";
include "os/wakelock_manager.fbs";
include "shim/dumpsys.fbs";

namespace bluetooth;

@@ -20,7 +19,6 @@ attribute "privacy";
table DumpsysData {
    title:string (privacy:"Any");
    wakelock_manager_data:bluetooth.os.WakelockManagerData (privacy:"Any");
    shim_dumpsys_data:bluetooth.shim.DumpsysModuleData (privacy:"Any");
    module_unittest_data:bluetooth.ModuleUnitTestData; // private
}

+3 −7
Original line number Diff line number Diff line
@@ -1221,8 +1221,10 @@ void SnoopLogger::Capture(const HciPacket& immutable_packet, Direction direction
  }
}

void SnoopLogger::DumpSnoozLogToFile(const std::vector<std::string>& data) const {
void SnoopLogger::DumpSnoozLogToFile() {
  std::lock_guard<std::recursive_mutex> lock(file_mutex_);
  std::vector<std::string> data = btsnooz_buffer_.Pull();

  if (btsnoop_mode_ != kBtSnoopLogModeDisabled) {
    log::debug("btsnoop log is enabled, skip dumping btsnooz log");
    return;
@@ -1319,12 +1321,6 @@ void SnoopLogger::Stop() {
  }
}

DumpsysDataFinisher SnoopLogger::GetDumpsysData(
        flatbuffers::FlatBufferBuilder* /* builder */) const {
  DumpSnoozLogToFile(btsnooz_buffer_.Pull());
  return EmptyDumpsysDataFinisher;
}

size_t SnoopLogger::GetMaxPacketsPerFile() {
  // Allow override max packet per file via system property
  auto max_packets_per_file = kDefaultBtSnoopMaxPacketsPerFile;
+3 −2
Original line number Diff line number Diff line
@@ -264,6 +264,9 @@ public:

  void RegisterSocket(SnoopLoggerSocketInterface* socket);

  // Dump the contents of the snooz buffer to a file.
  void DumpSnoozLogToFile();

protected:
  // Packet type length
  static const size_t PACKET_TYPE_LENGTH;
@@ -276,7 +279,6 @@ protected:
  void ListDependencies(ModuleList* list) const override;
  void Start() override;
  void Stop() override;
  DumpsysDataFinisher GetDumpsysData(flatbuffers::FlatBufferBuilder* builder) const override;
  std::string ToString() const override { return std::string("SnoopLogger"); }

  SnoopLogger(std::string snoop_log_path, std::string snooz_log_path, size_t max_packets_per_file,
@@ -286,7 +288,6 @@ protected:
              bool snoop_log_persists);
  void CloseCurrentSnoopLogFile();
  void OpenNextSnoopLogFile();
  void DumpSnoozLogToFile(const std::vector<std::string>& data) const;
  // Enable filters according to their sysprops
  void EnableFilters();
  // Disable all filters
Loading