Dump the sys node of LED am: 9fe1f4be94 am: fc52205595

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

Change-Id: I8639fa0724a9105a2baa2d0eba71b857092a1130
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Chungjui Fan 2022-09-14 04:03:34 +00:00 committed by Automerger Merge Worker
commit badae905c9
2 changed files with 17 additions and 0 deletions

View file

@ -240,6 +240,7 @@ Dumpstate::Dumpstate()
{ "misc", [this](int fd) { dumpMiscSection(fd); } }, { "misc", [this](int fd) { dumpMiscSection(fd); } },
{ "dump", [this](int fd) { dumpSection(fd); } }, { "dump", [this](int fd) { dumpSection(fd); } },
{ "trusty", [this](int fd) { dumpTrustySection(fd); } }, { "trusty", [this](int fd) { dumpTrustySection(fd); } },
{ "led", [this](int fd) { dumpLEDSection(fd); } },
}, },
mLogSections{ mLogSections{
{ "modem", [this](int fd, const std::string &destDir) { dumpModemLogs(fd, destDir); } }, { "modem", [this](int fd, const std::string &destDir) { dumpModemLogs(fd, destDir); } },
@ -1134,6 +1135,21 @@ void Dumpstate::dumpTrustySection(int fd) {
RunCommandToFd(fd, "Trusty TEE0 Logs", {"/vendor/bin/sh", "-c", "cat /dev/trusty-log0"}, CommandOptions::WithTimeout(1).Build()); RunCommandToFd(fd, "Trusty TEE0 Logs", {"/vendor/bin/sh", "-c", "cat /dev/trusty-log0"}, CommandOptions::WithTimeout(1).Build());
} }
// Dump items related to LED
void Dumpstate::dumpLEDSection(int fd) {
struct stat buffer;
if (!PropertiesHelper::IsUserBuild()) {
if (!stat("/sys/class/leds/green", &buffer)) {
DumpFileToFd(fd, "Green LED Brightness", "/sys/class/leds/green/brightness");
DumpFileToFd(fd, "Green LED Max Brightness", "/sys/class/leds/green/max_brightness");
}
if (!stat("/mnt/vendor/persist/led/led_calibration_LUT.txt", &buffer)) {
DumpFileToFd(fd, "LED Calibration Data", "/mnt/vendor/persist/led/led_calibration_LUT.txt");
}
}
}
void Dumpstate::dumpModemSection(int fd) { void Dumpstate::dumpModemSection(int fd) {
DumpFileToFd(fd, "Modem Stat", "/data/vendor/modem_stat/debug.txt"); DumpFileToFd(fd, "Modem Stat", "/data/vendor/modem_stat/debug.txt");
RunCommandToFd(fd, "Modem SSR history", {"/vendor/bin/sh", "-c", RunCommandToFd(fd, "Modem SSR history", {"/vendor/bin/sh", "-c",

View file

@ -69,6 +69,7 @@ class Dumpstate : public BnDumpstateDevice {
void dumpMiscSection(int fd); void dumpMiscSection(int fd);
void dumpSection(int fd); void dumpSection(int fd);
void dumpTrustySection(int fd); void dumpTrustySection(int fd);
void dumpLEDSection(int fd);
void dumpLogSection(int fd, int fdModem); void dumpLogSection(int fd, int fdModem);