Add UFS health information into board specific dumpstate

Test: Take bugreport
Bug: 66967195
Change-Id: Id635b64f77d4a6fdc1ace2290f89adfdf86514a7
Merged-In: Id635b64f77d4a6fdc1ace2290f89adfdf86514a7
(cherry picked from commit 0db0037ca1)
This commit is contained in:
Wei Wang
2017-10-02 14:48:46 -07:00
parent beb0bb8758
commit 4fa2c7c8b8
5 changed files with 18 additions and 0 deletions

View File

@@ -185,6 +185,7 @@ Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
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");
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");

View File

@@ -583,6 +583,19 @@ on property:sys.boot_completed=1
write /dev/cpuset/application/background/cpus 0-1
write /dev/cpuset/application/cpus 0-1,4-5
# UFS health
chmod 755 /sys/kernel/debug/ufshcd0
chown 644 /sys/kernel/debug/ufshcd0/err_state
chmod 644 /sys/kernel/debug/ufshcd0/power_mode
chmod 644 /sys/kernel/debug/ufshcd0/host_regs
chmod 644 /sys/kernel/debug/ufshcd0/show_hba
chmod 644 /sys/kernel/debug/ufshcd0/dump_device_desc
chmod 644 /sys/kernel/debug/ufshcd0/dump_health_desc
chmod 755 /sys/kernel/debug/ufshcd0/stats
chmod 644 /sys/kernel/debug/ufshcd0/stats/req_stats
chmod 644 /sys/kernel/debug/ufshcd0/stats/query_stats
chmod 644 /sys/kernel/debug/ufshcd0/stats/err_stats
on property:init.svc.per_mgr=running
start per_proxy

View File

@@ -27,6 +27,7 @@ type debugfs_usb, debugfs_type, fs_type;
type debugfs_wlan, debugfs_type, fs_type;
type debugfs_mdp, debugfs_type, fs_type;
type debugfs_icnss, debugfs_type, fs_type;
type debugfs_ufs, debugfs_type, fs_type;
# /proc
type proc_wifi_dbg, fs_type;

View File

@@ -85,3 +85,4 @@ genfscon debugfs /msm_ipc_router u:object_r:debugfs_ipc:s0
genfscon debugfs /mdp u:object_r:debugfs_mdp:s0
genfscon debugfs /rmt_storage u:object_r:debugfs_rmt_storage:s0
genfscon debugfs /icnss u:object_r:debugfs_icnss:s0
genfscon debugfs /ufshcd0 u:object_r:debugfs_ufs:s0

View File

@@ -45,6 +45,8 @@ allow hal_dumpstate_impl debugfs_icnss:dir r_dir_perms;
allow hal_dumpstate_impl debugfs_icnss:file r_file_perms;
allow hal_dumpstate_impl debugfs_ipc:file r_file_perms;
allow hal_dumpstate_impl proc_stat:file r_file_perms;
allow hal_dumpstate_impl debugfs_ufs:dir r_dir_perms;
allow hal_dumpstate_impl debugfs_ufs:file r_file_perms;
# Access to files for dumping
allow hal_dumpstate_impl sysfs:dir r_dir_perms;