dumpstate: dump logbuffer tcpm logs in bugreport

Bug: 189792358
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Change-Id: I64cf665985226c81ff23b32bda25c303d8031d5f
This commit is contained in:
Badhri Jagan Sridharan 2021-06-17 16:04:47 -07:00
parent a1a0bdb333
commit 6e44d2ee0c
2 changed files with 4 additions and 1 deletions

View file

@ -334,7 +334,9 @@ void DumpstateDevice::dumpPowerSection(int fd) {
DumpFileToFd(fd, "maxfg_flip", "/dev/logbuffer_maxfg_flip");
}
if (!PropertiesHelper::IsUserBuild()) {
if (!stat("/dev/logbuffer_tcpm", &buffer)) {
DumpFileToFd(fd, "Logbuffer TCPM", "/dev/logbuffer_tcpm");
} else if (!PropertiesHelper::IsUserBuild()) {
if (!stat("/sys/kernel/debug/tcpm", &buffer)) {
RunCommandToFd(fd, "TCPM logs", {"/vendor/bin/sh", "-c", "cat /sys/kernel/debug/tcpm/*"});
} else {