diff options
author | Ahmed ElArabawy <arabawy@google.com> | 2017-06-16 08:08:29 -0700 |
---|---|---|
committer | Stuart Scott <stuartscott@google.com> | 2017-06-19 19:08:49 +0000 |
commit | 07e464d5d6ce67f30e715f8b544d18c3edb939b9 (patch) | |
tree | f46c7070d27783844f8cc21281be2c521a247c2c | |
parent | 4a43f447ed4b80ebbb124b2a7ebc7877ca497a3f (diff) | |
download | marlin-07e464d5d6ce67f30e715f8b544d18c3edb939b9.tar.gz |
[DO NOT MERGE ANYWHERE] Add WiFi Statistics to Bugreport
This commit adds some statistics from debugfs to bugreport
this includes the files:
/d/wlan_wcnss/power_stats
/d/cnss_runtime_pm
/d/cnss-prealloc/status
Bug: 62290986
Test: adb bugreport and inspect the required statistics
Change-Id: Ia7ac961e6ca6bdd1a98ce6090e4e32e28788d0fe
Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
-rwxr-xr-x | dumpstate/DumpstateDevice.cpp | 5 | ||||
-rw-r--r-- | sepolicy/file.te | 3 | ||||
-rw-r--r-- | sepolicy/genfs_contexts | 5 | ||||
-rw-r--r-- | sepolicy/hal_dumpstate_impl.te | 7 | ||||
-rw-r--r-- | sepolicy/hal_wifi.te | 7 |
5 files changed, 27 insertions, 0 deletions
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp index daf27d27..445e777e 100755 --- a/dumpstate/DumpstateDevice.cpp +++ b/dumpstate/DumpstateDevice.cpp @@ -109,8 +109,13 @@ Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) { DumpFileToFd(fd, "CPU present", "/sys/devices/system/cpu/present"); DumpFileToFd(fd, "CPU online", "/sys/devices/system/cpu/online"); 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/wlan_wcnss/power_stats"); + DumpFileToFd(fd, "Runtime-PM Stats", "/d/cnss_runtime_pm"); + DumpFileToFd(fd, "CNSS Pre-Alloc", "/d/cnss-prealloc/status"); + 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/file.te b/sepolicy/file.te index 7a0f5621..54886403 100644 --- a/sepolicy/file.te +++ b/sepolicy/file.te @@ -49,6 +49,9 @@ type debugfs_mdp, debugfs_type, fs_type; type debugfs_ion, debugfs_type, fs_type; type debugfs_qsee_log, debugfs_type, fs_type; type debugfs_usb, debugfs_type, fs_type; +type debugfs_wlan, debugfs_type, fs_type; +type debugfs_runtime_pm, debugfs_type, fs_type; +type debugfs_cnss, debugfs_type, fs_type; # /proc type proc_kernel_sched, fs_type; diff --git a/sepolicy/genfs_contexts b/sepolicy/genfs_contexts index 6b896dff..b31401a7 100644 --- a/sepolicy/genfs_contexts +++ b/sepolicy/genfs_contexts @@ -13,3 +13,8 @@ genfscon proc /debug/fwdump u:object_r:proc_wifi_dbg:s genfscon proc /debugdriver/driverdump u:object_r:proc_wifi_dbg:s0 genfscon debugfs /kgsl/proc u:object_r:debugfs_kgsl:s0 + +# debugfs +genfscon debugfs /cnss_runtime_pm u:object_r:debugfs_runtime_pm:s0 +genfscon debugfs /cnss-prealloc/status u:object_r:debugfs_cnss:s0 +genfscon debugfs /wlan_wcnss u:object_r:debugfs_wlan:s0
\ No newline at end of file diff --git a/sepolicy/hal_dumpstate_impl.te b/sepolicy/hal_dumpstate_impl.te index b8dbc9b0..08f6d2aa 100644 --- a/sepolicy/hal_dumpstate_impl.te +++ b/sepolicy/hal_dumpstate_impl.te @@ -31,6 +31,13 @@ allow hal_dumpstate_impl sysfs:dir r_dir_perms; # rpm stat allow hal_dumpstate_impl debugfs_rpm:file r_file_perms; allow hal_dumpstate_impl debugfs_bufinfo:file r_file_perms; +# wlan power stats +allow hal_dumpstate_impl debugfs_wlan:dir r_dir_perms; +allow hal_dumpstate_impl debugfs_wlan:file r_file_perms; +# runtime-pm +allow hal_dumpstate_impl debugfs_runtime_pm:file r_file_perms; +# cnss +allow hal_dumpstate_impl debugfs_cnss:file r_file_perms; # qsee_logger allow hal_dumpstate_impl qsee_logger_exec:file rx_file_perms; allow hal_dumpstate_impl debugfs_qsee_log:file r_file_perms; diff --git a/sepolicy/hal_wifi.te b/sepolicy/hal_wifi.te index bd7ebc1a..1983a95f 100644 --- a/sepolicy/hal_wifi.te +++ b/sepolicy/hal_wifi.te @@ -8,3 +8,10 @@ allow hal_wifi location_data_file:{ file fifo_file } create_file_perms; # Allow wifi hal to read debug info from the driver. r_dir_file(hal_wifi, proc_wifi_dbg) + +userdebug_or_eng(` +# debugfs entries are only needed in user-debug or eng builds + +# Allow wifi hal to access wlan debugfs files and directories +allow hal_wifi debugfs_wlan:dir r_dir_perms; +') |