summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Nelms <tknelms@google.com>2022-12-05 16:33:46 +0000
committerTaylor Nelms <tknelms@google.com>2023-01-19 14:14:11 +0000
commitf56de0504d702c2e0b1e29b4d0d6101870b3e453 (patch)
tree8c45b8ac643a4729baaf7dd0534730e5c80e2170
parenta1f4b82a9ea5ec84a56c5b49a32386df9e3a22e0 (diff)
Modify dumpstate to point to decon_counters in sysfs rather than debugfs
Bug: 240346564 Test: Build for Oriole device with "user" build, check bug report for decon_counters content Merged-In: I5ae08064c2c4106b9f54f7823f1e325a6d6978b5 Change-Id: Idd5e2558e00d3c0de4d69129b2e49ea6bbc2b240 Signed-off-by: Taylor Nelms <tknelms@google.com>
-rw-r--r--dumpstate/DumpstateDevice.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp
index f3910326..f8ee8e3f 100644
--- a/dumpstate/DumpstateDevice.cpp
+++ b/dumpstate/DumpstateDevice.cpp
@@ -945,15 +945,24 @@ void DumpstateDevice::dumpStorageSection(int fd) {
// Dump items related to display
void DumpstateDevice::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());