summaryrefslogtreecommitdiff
path: root/dumpstate
diff options
context:
space:
mode:
authorTaylor Nelms <tknelms@google.com>2022-12-05 15:22:41 +0000
committerTaylor Nelms <tknelms@google.com>2022-12-21 01:41:36 +0000
commitb8248d3ec47c891ef26bf0acd9d0121fcd816c59 (patch)
treed4ef1ffc86fe8318f06470e3fa9eb67de3149a64 /dumpstate
parent91849399445b2477c3ab22ce382a45a8df649902 (diff)
downloadgs201-b8248d3ec47c891ef26bf0acd9d0121fcd816c59.tar.gz
Modify dumpstate to point to counters in sysfs rather than debugfs
Bug: 240346564 Test: Build for Cheetah device with user build, check bugreport for decon_counters content Change-Id: I0026378d81f5de5ac48b658861a2d8a85c817820 Signed-off-by: Taylor Nelms <tknelms@google.com>
Diffstat (limited to 'dumpstate')
-rw-r--r--dumpstate/Dumpstate.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/dumpstate/Dumpstate.cpp b/dumpstate/Dumpstate.cpp
index 34cf23f..42bdb2e 100644
--- a/dumpstate/Dumpstate.cpp
+++ b/dumpstate/Dumpstate.cpp
@@ -552,15 +552,24 @@ void Dumpstate::dumpMemorySection(int fd) {
// Dump items related to display
void Dumpstate::dumpDisplaySection(int fd) {
- DumpFileToFd(fd, "CRTC-0 underrun count", "/sys/kernel/debug/dri/0/crtc-0/underrun_cnt");
- DumpFileToFd(fd, "CRTC-0 crc count", "/sys/kernel/debug/dri/0/crtc-0/crc_cnt");
- DumpFileToFd(fd, "CRTC-0 ecc count", "/sys/kernel/debug/dri/0/crtc-0/ecc_cnt");
- DumpFileToFd(fd, "CRTC-0 idma err count", "/sys/kernel/debug/dri/0/crtc-0/idma_err_cnt");
+ // Dump counters for decon drivers
+ const std::string decon_device_sysfs_path("/sys/class/drm/card0/device/");
+ for(int i = 0; i <= 2; ++i){
+ const std::string decon_num_str = std::to_string(i);
+ const std::string decon_counter_path = decon_device_sysfs_path +
+ "decon" + decon_num_str +
+ "/counters";
+ if (access(decon_counter_path.c_str(), R_OK) == 0){
+ DumpFileToFd(fd, "DECON-" + decon_num_str + " counters",
+ decon_counter_path);
+ }
+ else{
+ ::android::base::WriteStringToFd("No counters for DECON-" +
+ decon_num_str + " found at path (" + decon_counter_path + ")\n",
+ fd);
+ }
+ }
DumpFileToFd(fd, "CRTC-0 event log", "/sys/kernel/debug/dri/0/crtc-0/event");
- DumpFileToFd(fd, "CRTC-1 underrun count", "/sys/kernel/debug/dri/0/crtc-1/underrun_cnt");
- DumpFileToFd(fd, "CRTC-1 crc count", "/sys/kernel/debug/dri/0/crtc-1/crc_cnt");
- DumpFileToFd(fd, "CRTC-1 ecc count", "/sys/kernel/debug/dri/0/crtc-1/ecc_cnt");
- DumpFileToFd(fd, "CRTC-1 idma err count", "/sys/kernel/debug/dri/0/crtc-1/idma_err_cnt");
DumpFileToFd(fd, "CRTC-1 event log", "/sys/kernel/debug/dri/0/crtc-1/event");
RunCommandToFd(fd, "libdisplaycolor", {"/vendor/bin/dumpsys", "displaycolor", "-v"},
CommandOptions::WithTimeout(2).Build());