diff --git a/dumpstate/Dumpstate.cpp b/dumpstate/Dumpstate.cpp index bbc203c2..4aabaf3d 100644 --- a/dumpstate/Dumpstate.cpp +++ b/dumpstate/Dumpstate.cpp @@ -238,7 +238,6 @@ Dumpstate::Dumpstate() { "aoc", [this](int fd) { dumpAoCSection(fd); } }, { "ramdump", [this](int fd) { dumpRamdumpSection(fd); } }, { "misc", [this](int fd) { dumpMiscSection(fd); } }, - { "dump", [this](int fd) { dumpSection(fd); } }, { "trusty", [this](int fd) { dumpTrustySection(fd); } }, { "led", [this](int fd) { dumpLEDSection(fd); } }, }, @@ -268,6 +267,24 @@ void Dumpstate::dumpTextSection(int fd, const std::string §ionName) { } } + // Execute all programs under vendor/bin/dump/ + std::unique_ptr dir(opendir("/vendor/bin/dump"), closedir); + if (!dir) { + ALOGE("Fail To Open Dir vendor/bin/dump/"); + } else { + dirent *entry; + while ((entry = readdir(dir.get())) != nullptr) { + // Skip '.', '..' + if (entry->d_name[0] == '.') { + continue; + } + std::string bin(entry->d_name); + auto startTime = startSection(fd, "/vendor/bin/dump/"+bin); + RunCommandToFd(fd, "/vendor/bin/dump/"+bin, {"/vendor/bin/dump/"+bin}); + endSection(fd, "/vendor/bin/dump/"+bin, startTime); + } + } + if (dumpAll) { return; } @@ -1126,11 +1143,6 @@ void Dumpstate::dumpMiscSection(int fd) { DumpFileToFd(fd, "VENDOR PROC DUMP", "/proc/vendor_sched/dump_task"); } -// Dump scripts under vendor/bin/dump -void Dumpstate::dumpSection(int fd) { - RunCommandToFd(fd, "dump", {"/vendor/bin/dump/dump_gsc.sh"}); -} - void Dumpstate::dumpTrustySection(int fd) { RunCommandToFd(fd, "Trusty TEE0 Logs", {"/vendor/bin/sh", "-c", "cat /dev/trusty-log0"}, CommandOptions::WithTimeout(1).Build()); } diff --git a/dumpstate/Dumpstate.h b/dumpstate/Dumpstate.h index e7ead774..a7f6ad3f 100644 --- a/dumpstate/Dumpstate.h +++ b/dumpstate/Dumpstate.h @@ -67,7 +67,6 @@ class Dumpstate : public BnDumpstateDevice { void dumpAoCSection(int fd); void dumpRamdumpSection(int fd); void dumpMiscSection(int fd); - void dumpSection(int fd); void dumpTrustySection(int fd); void dumpLEDSection(int fd); diff --git a/dumpstate/android.hardware.dumpstate@1.1-service.gs201.rc b/dumpstate/android.hardware.dumpstate@1.1-service.gs201.rc index 65456d11..f2452dc1 100644 --- a/dumpstate/android.hardware.dumpstate@1.1-service.gs201.rc +++ b/dumpstate/android.hardware.dumpstate@1.1-service.gs201.rc @@ -1,5 +1,5 @@ service vendor.dumpstate-default /vendor/bin/hw/android.hardware.dumpstate-service.gs201 class hal user system - group system + group system shell interface aidl android.hardware.dumpstate.IDumpstateDevice/default