From b8307a286faf91133a6321d98237a4f4cf590607 Mon Sep 17 00:00:00 2001 From: Wiwit Rifa'i Date: Tue, 16 Aug 2022 13:55:35 +0800 Subject: [PATCH] dumpstate: add HWC fence state, error log, and debug dump files Add some HWC log files in /data/vendor/log/hwc to dumpstate, i.e. [1] hwc_fence_state.txt: contains the dump of fence state when there's a fence leak warning. We can also execute `vndservice call Exynos.HWCService 11 i32 0 i32 308 i32 1` to trigger the dump to this file. The size of this file is limited to about 1 MB. [2] hwc_error_log.txt: contains some early logs of ALOGE() from HWC. The size of this file is limited to about 1 MB. [3] {display_name}_hwc_debug0.dump - {display_name}_hwc_debug9.dump: contain the debug dumps when there are some failures in HWC (e.g. failures in validateDisplay() or presentDisplay()). HWC will only limit up to first 10 debug dumps per display to be saved in separated files. Bug: 230361290 Test: adb bugreport Change-Id: I8621aeffd2bb7edb46314437d06338e0d0954b7c --- dumpstate/DumpstateDevice.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp index 3e0039ba..dd583d71 100644 --- a/dumpstate/DumpstateDevice.cpp +++ b/dumpstate/DumpstateDevice.cpp @@ -968,6 +968,14 @@ void DumpstateDevice::dumpDisplaySection(int fd) { DumpFileToFd(fd, "Primary panel extra info", "/sys/devices/platform/exynos-drm/primary-panel/panel_extinfo"); DumpFileToFd(fd, "Secondary panel name", "/sys/devices/platform/exynos-drm/secondary-panel/panel_name"); DumpFileToFd(fd, "Secondary panel extra info", "/sys/devices/platform/exynos-drm/secondary-panel/panel_extinfo"); + if (!PropertiesHelper::IsUserBuild()) { + DumpFileToFd(fd, "HWC Fence State", "/data/vendor/log/hwc/hwc_fence_state.txt"); + DumpFileToFd(fd, "HWC Error Log", "/data/vendor/log/hwc/hwc_error_log.txt"); + RunCommandToFd(fd, "HWC Debug Dumps", {"/vendor/bin/sh", "-c", + "for f in $(ls /data/vendor/log/hwc/*_hwc_debug*.dump); do " + "echo $f ; cat $f ; done"}, + CommandOptions::WithTimeout(2).Build()); + } } // Dump items related to AoC