From 841c4ad431d5098d9711f43a2892fdfb370fea9a Mon Sep 17 00:00:00 2001 From: Ahmed ElArabawy Date: Fri, 16 Jun 2017 18:30:32 -0700 Subject: [PATCH] Add WiFi Statistics to Bugreport to Wahoo This commit adds some statistics from debugfs to bugreport this includes the files: /d/wlan0/power_stats /d/wlan0/ll_stats /d/icnss/stats Bug: 62290986 Test: adb bugreport and inspect the required statistics Merged-In: Ib65b98935a043542283a645f9760e02ff6935db3 Change-Id: Ib65b98935a043542283a645f9760e02ff6935db3 Signed-off-by: Ahmed ElArabawy --- dumpstate/DumpstateDevice.cpp | 3 +++ sepolicy/vendor/file.te | 1 + sepolicy/vendor/genfs_contexts | 1 + sepolicy/vendor/hal_dumpstate_impl.te | 4 ++++ 4 files changed, 9 insertions(+) diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp index 3323b1d3..553d82c9 100755 --- a/dumpstate/DumpstateDevice.cpp +++ b/dumpstate/DumpstateDevice.cpp @@ -142,6 +142,9 @@ Return DumpstateDevice::dumpstateBoard(const hidl_handle& handle) { 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"); + DumpFileToFd(fd, "LL-Stats", "/d/wlan0/ll_stats"); + DumpFileToFd(fd, "ICNSS Stats", "/d/icnss/stats"); DumpFileToFd(fd, "SMD Log", "/d/ipc_logging/smd/log"); RunCommandToFd(fd, "ION HEAPS", {"/vendor/bin/sh", "-c", "for d in $(ls -d /d/ion/*); do for f in $(ls $d); do echo --- $d/$f; cat $d/$f; done; done"}); DumpFileToFd(fd, "dmabuf info", "/d/dma_buf/bufinfo"); diff --git a/sepolicy/vendor/file.te b/sepolicy/vendor/file.te index 40faa233..f65691c8 100644 --- a/sepolicy/vendor/file.te +++ b/sepolicy/vendor/file.te @@ -21,6 +21,7 @@ type debugfs_rmt_storage, debugfs_type, fs_type; 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; # /proc type proc_wifi_dbg, fs_type; diff --git a/sepolicy/vendor/genfs_contexts b/sepolicy/vendor/genfs_contexts index 3fe84319..f7c2411b 100644 --- a/sepolicy/vendor/genfs_contexts +++ b/sepolicy/vendor/genfs_contexts @@ -13,3 +13,4 @@ genfscon sysfs /class/rfkill/rfkill0/state u:object_r:sysfs_bluetooth genfscon debugfs /kgsl/proc u:object_r:debugfs_kgsl:s0 genfscon debugfs /clk/debug_suspend u:object_r:debugfs_clk:s0 genfscon debugfs /wlan0 u:object_r:debugfs_wlan:s0 +genfscon debugfs /icnss u:object_r:debugfs_icnss:s0 diff --git a/sepolicy/vendor/hal_dumpstate_impl.te b/sepolicy/vendor/hal_dumpstate_impl.te index 075aa732..97f0af9a 100644 --- a/sepolicy/vendor/hal_dumpstate_impl.te +++ b/sepolicy/vendor/hal_dumpstate_impl.te @@ -37,6 +37,10 @@ allow hal_dumpstate_impl sysfs_thermal:file r_file_perms; allow hal_dumpstate_impl debugfs_ion:dir r_dir_perms; allow hal_dumpstate_impl debugfs_ion:file r_file_perms; allow hal_dumpstate_impl debugfs_rpm:file r_file_perms; +allow hal_dumpstate_impl debugfs_wlan:dir r_dir_perms; +allow hal_dumpstate_impl debugfs_wlan:file r_file_perms; +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;