move wlan dump to relevant devices am: 15d11de144

Original change: https://googleplex-android-review.googlesource.com/c/device/google/gs201/+/22339031

Change-Id: I92bb4bd6a75cd269f9f761d1a5dfe514ab4a2421
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Adam Shih 2023-04-06 02:22:55 +00:00 committed by Automerger Merge Worker
commit 46ce70915c
2 changed files with 0 additions and 36 deletions

View file

@ -68,29 +68,12 @@ void endSection(int fd, const std::string &sectionName, timepoint_t startTime) {
"\n", fd);
}
Dumpstate::Dumpstate()
: mTextSections{
{ "wlan", [this](int fd) { dumpWlanSection(fd); } },
} {}
// Dump data requested by an argument to the "dump" interface, or help info
// if the specified section is not supported.
void Dumpstate::dumpTextSection(int fd, const std::string &sectionName) {
bool dumpAll = (sectionName == kAllSections);
std::string dumpFiles;
for (const auto &section : mTextSections) {
if (dumpAll || sectionName == section.first) {
auto startTime = startSection(fd, section.first);
section.second(fd);
endSection(fd, section.first, startTime);
if (!dumpAll) {
return;
}
}
}
// Execute all or designated programs under vendor/bin/dump/
std::unique_ptr<DIR, decltype(&closedir)> dir(opendir("/vendor/bin/dump"), closedir);
if (!dir) {
@ -124,22 +107,11 @@ void Dumpstate::dumpTextSection(int fd, const std::string &sectionName) {
// An unsupported section was requested on the command line
::android::base::WriteStringToFd("Unrecognized text section: " + sectionName + "\n", fd);
::android::base::WriteStringToFd("Try \"" + kAllSections + "\" or one of the following:", fd);
for (const auto &section : mTextSections) {
::android::base::WriteStringToFd(" " + section.first, fd);
}
::android::base::WriteStringToFd(dumpFiles, fd);
::android::base::WriteStringToFd("\nNote: sections with attachments (e.g. modem) are"
"not avalable from the command line.\n", fd);
}
// Dump items related to wlan
void Dumpstate::dumpWlanSection(int fd) {
// Dump firmware symbol table for firmware log decryption
DumpFileToFd(fd, "WLAN FW Log Symbol Table", "/vendor/firmware/Data.msc");
RunCommandToFd(fd, "WLAN TWT Dump", {"/vendor/bin/sh", "-c",
"cat /sys/wlan_ptracker/twt/*"});
}
void Dumpstate::dumpLogSection(int fd, int fd_bin)
{
std::string logDir = MODEM_LOG_DIRECTORY;

View file

@ -27,8 +27,6 @@ namespace dumpstate {
class Dumpstate : public BnDumpstateDevice {
public:
Dumpstate();
::ndk::ScopedAStatus dumpstateBoard(const std::vector<::ndk::ScopedFileDescriptor>& in_fds,
IDumpstateDevice::DumpstateMode in_mode,
int64_t in_timeoutMillis) override;
@ -42,14 +40,8 @@ class Dumpstate : public BnDumpstateDevice {
private:
const std::string kAllSections = "all";
std::vector<std::pair<std::string, std::function<void(int)>>> mTextSections;
void dumpTextSection(int fd, std::string const& sectionName);
// Text sections that can be dumped individually on the command line in
// addition to being included in full dumps
void dumpWlanSection(int fd);
void dumpLogSection(int fd, int fdModem);
//bool getVerboseLoggingEnabledImpl();