dumpstate: add evt count logging

Add capability for dump_power to log event counter logging

Bug: 299668264
Test: adb bugreport and check dumpstate_board.txt
Change-Id: I1fdf6214dc9b333044e395a8148349b26c0d5653
Signed-off-by: Hiroshi Akiyama <hiroshiakiyama@google.com>
This commit is contained in:
Hiroshi Akiyama 2023-10-24 18:26:40 +00:00
parent 6113111eea
commit a9506fbf2a

View file

@ -928,6 +928,32 @@ void dumpIrqDurationCounts() {
}
}
void dumpEvtCounter() {
const char* title = "Event Counter";
const char* evtCntDir = "/sys/devices/virtual/pmic/mitigation/instruction/";
const char* evtCnt [][2] {
{"batoilo1", "evt_cnt_batoilo1"},
{"batoilo2", "evt_cnt_batoilo2"},
{"uvlo1", "evt_cnt_uvlo1"},
{"uvlo2", "evt_cnt_uvlo2"},
};
printTitle(title);
printf("name\tcount\n");
for (const auto &row : evtCnt) {
std::string name = row[0];
std::string fileLocation = std::string(evtCntDir) + std::string(row[1]);
std::string count = "N/A\n";
if (!android::base::ReadFileToString(fileLocation, &count)) {
count = "invalid\n";
}
printf("%s\t%s", name.c_str(), count.c_str());
}
}
int main() {
dumpPowerStatsTimes();
dumpAcpmStats();
@ -948,5 +974,6 @@ int main() {
dumpMitigationStats();
dumpMitigationDirs();
dumpIrqDurationCounts();
dumpEvtCounter();
}