summaryrefslogtreecommitdiff
path: root/dumpstate
diff options
context:
space:
mode:
authorWei Wang <wvw@google.com>2017-10-02 14:48:46 -0700
committerJaegeuk Kim <jaegeuk@google.com>2018-05-13 10:35:05 -0700
commit14b4ed449fbd9ff88aff941e3c1960fe33c4454d (patch)
treeae7af33ceac058af300c86c39f515e5fc4f89802 /dumpstate
parent1dd1f34dfe6fed523112580db790da1602c39715 (diff)
Add UFS health information into board specific dumpstate
+ slowio_cnt. Test: Take bugreport Bug: 66967195 Bug: 79552162 Change-Id: Id635b64f77d4a6fdc1ace2290f89adfdf86514a7
Diffstat (limited to 'dumpstate')
-rwxr-xr-xdumpstate/DumpstateDevice.cpp36
1 files changed, 26 insertions, 10 deletions
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp
index 4ff0428..a61ac90 100755
--- a/dumpstate/DumpstateDevice.cpp
+++ b/dumpstate/DumpstateDevice.cpp
@@ -228,6 +228,29 @@ static void DumpTouch(int fd) {
}
}
+static void DumpF2FS(int fd) {
+ DumpFileToFd(fd, "F2FS", "/sys/kernel/debug/f2fs/status");
+ DumpFileToFd(fd, "F2FS - fragmentation", "/proc/fs/f2fs/dm-3/segment_info");
+}
+
+static void DumpUFS(int fd) {
+ DumpFileToFd(fd, "UFS model", "/sys/block/sda/device/model");
+ DumpFileToFd(fd, "UFS rev", "/sys/block/sda/device/rev");
+ DumpFileToFd(fd, "UFS size", "/sys/block/sda/size");
+ DumpFileToFd(fd, "UFS show_hba", "/sys/kernel/debug/ufshcd0/show_hba");
+ DumpFileToFd(fd, "UFS err_stats", "/sys/kernel/debug/ufshcd0/stats/err_stats");
+ DumpFileToFd(fd, "UFS io_stats", "/sys/kernel/debug/ufshcd0/stats/io_stats");
+ DumpFileToFd(fd, "UFS req_stats", "/sys/kernel/debug/ufshcd0/stats/req_stats");
+
+ std::string bootdev = android::base::GetProperty(UFS_BOOTDEVICE, "");
+ if (!bootdev.empty()) {
+ DumpFileToFd(fd, "UFS Slow IO", "/sys/devices/platform/soc/" + bootdev + "/slowio_cnt");
+
+ std::string ufs_health = "for f in $(find /sys/devices/platform/soc/" + bootdev + "/health -type f); do if [[ -r $f && -f $f ]]; then echo --- $f; cat $f; echo ''; fi; done";
+ RunCommandToFd(fd, "UFS health", {"/vendor/bin/sh", "-c", ufs_health.c_str()});
+ }
+}
+
// Methods from ::android::hardware::dumpstate::V1_0::IDumpstateDevice follow.
Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
if (handle == nullptr || handle->numFds < 1) {
@@ -251,17 +274,10 @@ Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
DumpFileToFd(fd, "SoC serial number", "/sys/devices/soc0/serial_number");
DumpFileToFd(fd, "CPU present", "/sys/devices/system/cpu/present");
DumpFileToFd(fd, "CPU online", "/sys/devices/system/cpu/online");
- DumpFileToFd(fd, "UFS model", "/sys/block/sda/device/model");
- DumpFileToFd(fd, "UFS rev", "/sys/block/sda/device/rev");
- DumpFileToFd(fd, "UFS size", "/sys/block/sda/size");
- std::string bootdev = android::base::GetProperty(UFS_BOOTDEVICE, "");
- if (!bootdev.empty()) {
- std::string ufs_health = "for f in $(find /sys/devices/platform/soc/" + bootdev + "/health -type f); do if [[ -r $f && -f $f ]]; then echo --- $f; cat $f; echo ''; fi; done";
- RunCommandToFd(fd, "UFS health", {"/vendor/bin/sh", "-c", ufs_health.c_str()});
- }
- DumpFileToFd(fd, "F2FS", "/sys/kernel/debug/f2fs/status");
- DumpFileToFd(fd, "F2FS - fragmentation", "/proc/fs/f2fs/dm-3/segment_info");
+ DumpF2FS(fd);
+ DumpUFS(fd);
+
DumpFileToFd(fd, "INTERRUPTS", "/proc/interrupts");
DumpFileToFd(fd, "Sleep Stats", "/sys/power/system_sleep/stats");
DumpFileToFd(fd, "Power Management Stats", "/sys/power/rpmh_stats/master_stats");