allow dumpstate to execute files under vendor/bin/dump
Bug: 240530709 Test: adb bugreport has the same result Change-Id: I6927c3ab64369f1e3c30842d571f66374dd544ac
This commit is contained in:
parent
7a25196bf5
commit
552fe66f7f
3 changed files with 19 additions and 8 deletions
|
@ -266,7 +266,6 @@ DumpstateDevice::DumpstateDevice()
|
||||||
{ "aoc", [this](int fd) { dumpAoCSection(fd); } },
|
{ "aoc", [this](int fd) { dumpAoCSection(fd); } },
|
||||||
{ "ramdump", [this](int fd) { dumpRamdumpSection(fd); } },
|
{ "ramdump", [this](int fd) { dumpRamdumpSection(fd); } },
|
||||||
{ "misc", [this](int fd) { dumpMiscSection(fd); } },
|
{ "misc", [this](int fd) { dumpMiscSection(fd); } },
|
||||||
{ "dump", [this](int fd) { dumpSection(fd); } },
|
|
||||||
{ "camera", [this](int fd) { dumpCameraSection(fd); } },
|
{ "camera", [this](int fd) { dumpCameraSection(fd); } },
|
||||||
{ "trusty", [this](int fd) { dumpTrustySection(fd); } },
|
{ "trusty", [this](int fd) { dumpTrustySection(fd); } },
|
||||||
{ "modem", [this](int fd) { dumpModemSection(fd); } },
|
{ "modem", [this](int fd) { dumpModemSection(fd); } },
|
||||||
|
@ -290,6 +289,24 @@ void DumpstateDevice::dumpTextSection(int fd, const std::string §ionName) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Execute all programs under vendor/bin/dump/
|
||||||
|
std::unique_ptr<DIR, decltype(&closedir)> 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) {
|
if (dumpAll) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1062,11 +1079,6 @@ void DumpstateDevice::dumpMiscSection(int fd) {
|
||||||
DumpFileToFd(fd, "VENDOR PROC DUMP", "/proc/vendor_sched/dump_task");
|
DumpFileToFd(fd, "VENDOR PROC DUMP", "/proc/vendor_sched/dump_task");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dump scripts under vendor/bin/dump
|
|
||||||
void DumpstateDevice::dumpSection(int fd) {
|
|
||||||
RunCommandToFd(fd, "dump", {"/vendor/bin/dump/dump_gsc.sh"});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dump essential camera debugging logs
|
// Dump essential camera debugging logs
|
||||||
void DumpstateDevice::dumpCameraSection(int fd) {
|
void DumpstateDevice::dumpCameraSection(int fd) {
|
||||||
RunCommandToFd(fd, "Camera HAL Graph State Dump", {"/vendor/bin/sh", "-c",
|
RunCommandToFd(fd, "Camera HAL Graph State Dump", {"/vendor/bin/sh", "-c",
|
||||||
|
|
|
@ -76,7 +76,6 @@ struct DumpstateDevice : public IDumpstateDevice {
|
||||||
void dumpAoCSection(int fd);
|
void dumpAoCSection(int fd);
|
||||||
void dumpRamdumpSection(int fd);
|
void dumpRamdumpSection(int fd);
|
||||||
void dumpMiscSection(int fd);
|
void dumpMiscSection(int fd);
|
||||||
void dumpSection(int fd);
|
|
||||||
void dumpCameraSection(int fd);
|
void dumpCameraSection(int fd);
|
||||||
void dumpTrustySection(int fd);
|
void dumpTrustySection(int fd);
|
||||||
void dumpModemSection(int fd);
|
void dumpModemSection(int fd);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
service vendor.dumpstate-1-1 /vendor/bin/hw/android.hardware.dumpstate@1.1-service.gs101
|
service vendor.dumpstate-1-1 /vendor/bin/hw/android.hardware.dumpstate@1.1-service.gs101
|
||||||
class hal
|
class hal
|
||||||
user system
|
user system
|
||||||
group system
|
group system shell
|
||||||
interface android.hardware.dumpstate@1.0::IDumpstateDevice default
|
interface android.hardware.dumpstate@1.0::IDumpstateDevice default
|
||||||
interface android.hardware.dumpstate@1.1::IDumpstateDevice default
|
interface android.hardware.dumpstate@1.1::IDumpstateDevice default
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue