summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKelly Rossmoyer <krossmo@google.com>2019-10-25 00:29:21 -0700
committerKelly Rossmoyer <krossmo@google.com>2019-10-31 14:54:06 -0700
commitcc2dce4a2409aebc315b532f33dada049ba5481b (patch)
tree83a641a8d1475b17e763e7e0291f68305dd02b06
parent2a3a17fd6af956e3276a8cfdd4209d8a92fbecc8 (diff)
downloaddevice_google_wahoo-cc2dce4a2409aebc315b532f33dada049ba5481b.tar.gz
device_google_wahoo-cc2dce4a2409aebc315b532f33dada049ba5481b.tar.bz2
device_google_wahoo-cc2dce4a2409aebc315b532f33dada049ba5481b.zip
dumpstate: add key timestamps to power dump
This change adds two key timestamps to the power stats section of dumpstate_board.txt: the time at which the device was booted and the current time immediately prior to capturing the power stats. It also refactors the lines of code for dumping power stats into a self-contained function to improve code maintainability. Currently, because the process of generating a bugreport takes several minutes, there is significant uncertainty about the temporal relationship between the bugreport timestamp and the time at which the power stats were captured. Also, boot time is reverse-engineered - again, with an unhelpful degree of uncertainty - by combining the bugreport timestamp with uptime. Generating these two timestamps immediately prior to capturing live power stats will allow identification of the onset times of key subsystem-related power issues with much more precision than is currently possible. Bug: 143312304 Test: Built userdebug and user builds, installed and tested by generating a bugreport and verifying the new content was present. Change-Id: Ie92a6e1f8e6088939819738bcff8cd9a0106f5a8
-rwxr-xr-xdumpstate/DumpstateDevice.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp
index 4c1c21ec..4b7e030f 100755
--- a/dumpstate/DumpstateDevice.cpp
+++ b/dumpstate/DumpstateDevice.cpp
@@ -212,6 +212,15 @@ void DumpstateDevice::dumpModem(int fd, int fdModem)
}
}
+static void DumpPower(int fd) {
+ RunCommandToFd(fd, "Power Stats Times", {"/vendor/bin/sh", "-c",
+ "echo -n \"Boot: \" && /vendor/bin/uptime -s &&"
+ "echo -n \"Now: \" && date"});
+ DumpFileToFd(fd, "RPM Stats", "/d/rpm_stats");
+ DumpFileToFd(fd, "Power Management Stats", "/d/rpm_master_stats");
+ DumpFileToFd(fd, "WLAN Power Stats", "/d/wlan0/power_stats");
+}
+
static void DumpTouch(int fd) {
if (!access("/sys/android_touch", R_OK)) {
DumpFileToFd(fd, "Synaptics touch firmware version",
@@ -261,9 +270,9 @@ Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
DumpFileToFd(fd, "UFS size", "/sys/block/sda/size");
RunCommandToFd(fd, "UFS health", {"/vendor/bin/sh", "-c", "for f in $(find /sys/kernel/debug/ufshcd0 -type f); do if [[ -r $f && -f $f ]]; then echo --- $f; cat $f; fi; done"});
DumpFileToFd(fd, "INTERRUPTS", "/proc/interrupts");
- DumpFileToFd(fd, "RPM Stats", "/d/rpm_stats");
- DumpFileToFd(fd, "Power Management Stats", "/d/rpm_master_stats");
- DumpFileToFd(fd, "WLAN Power Stats", "/d/wlan0/power_stats");
+
+ DumpPower(fd);
+
DumpFileToFd(fd, "LL-Stats", "/d/wlan0/ll_stats");
DumpFileToFd(fd, "ICNSS Stats", "/d/icnss/stats");
DumpFileToFd(fd, "SMD Log", "/d/ipc_logging/smd/log");