From adfda88cdf5f86cc77f5681ffc835100a52da6e7 Mon Sep 17 00:00:00 2001 From: Ray Hsu Date: Wed, 26 Apr 2023 10:43:19 +0000 Subject: [PATCH] gs-common:aoc: correct aoc information in the bugreport The aoc system node may be different for each platform. We can use wildcard characters to replace these addresses. To specify all addresses between 17000000 and 19000000, we could use the wildcard character *. This would allow us to use the same code for all platform, regardless of the specific addresses used Test: adb bugreport && unzip bugreport*.zip && check dump_aoc section in dumpstate_board.txt Bug: 279680450 Change-Id: I1eaad3bd31e78265af6a9428064e9def501a813e --- aoc/dump_aoc.cpp | 24 ++++++++++++------------ aoc/sepolicy/dump_aoc.te | 1 + 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/aoc/dump_aoc.cpp b/aoc/dump_aoc.cpp index 97da3b5..6be56b0 100644 --- a/aoc/dump_aoc.cpp +++ b/aoc/dump_aoc.cpp @@ -19,18 +19,18 @@ // Dump Aoc. int main() { setbuf(stdout, NULL); - dumpFileContent("AoC Service Status", "/sys/devices/platform/19000000.aoc/services"); - dumpFileContent("AoC Restarts", "/sys/devices/platform/19000000.aoc/restart_count"); - dumpFileContent("AoC Coredumps", "/sys/devices/platform/19000000.aoc/coredump_count"); - dumpFileContent("AoC ring buf wake", "/sys/devices/platform/19000000.aoc/control/ring_buffer_wakeup"); - dumpFileContent("AoC host ipc wake", "/sys/devices/platform/19000000.aoc/control/host_ipc_wakeup"); - dumpFileContent("AoC usf wake", "/sys/devices/platform/19000000.aoc/control/usf_wakeup"); - dumpFileContent("AoC audio wake", "/sys/devices/platform/19000000.aoc/control/audio_wakeup"); - dumpFileContent("AoC logging wake", "/sys/devices/platform/19000000.aoc/control/logging_wakeup"); - dumpFileContent("AoC hotword wake", "/sys/devices/platform/19000000.aoc/control/hotword_wakeup"); - dumpFileContent("AoC memory exception wake", "/sys/devices/platform/19000000.aoc/control/memory_exception"); - dumpFileContent("AoC memory votes", "/sys/devices/platform/19000000.aoc/control/memory_votes_a32"); - dumpFileContent("AoC memory votes", "/sys/devices/platform/19000000.aoc/control/memory_votes_ff1"); + runCommand("AoC Service Status", "timeout 0.1 cat /sys/devices/platform/*.aoc/services"); + runCommand("AoC Restarts", "timeout 0.1 cat /sys/devices/platform/*.aoc/restart_count"); + runCommand("AoC Coredumps", "timeout 0.1 cat /sys/devices/platform/*.aoc/coredump_count"); + runCommand("AoC ring buf wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/ring_buffer_wakeup"); + runCommand("AoC host ipc wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/host_ipc_wakeup"); + runCommand("AoC usf wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/usf_wakeup"); + runCommand("AoC audio wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/audio_wakeup"); + runCommand("AoC logging wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/logging_wakeup"); + runCommand("AoC hotword wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/hotword_wakeup"); + runCommand("AoC memory exception wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/memory_exception"); + runCommand("AoC memory votes", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/memory_votes_a32"); + runCommand("AoC memory votes", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/memory_votes_ff1"); runCommand("clean AoC buffer","echo ' ' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug"); runCommand("AoC Heap Stats (A32)", "echo 'dbg heap -c 1' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug"); runCommand("AoC Heap Stats (F1)", "echo 'dbg heap -c 2' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug"); diff --git a/aoc/sepolicy/dump_aoc.te b/aoc/sepolicy/dump_aoc.te index f5f085c..0731da4 100644 --- a/aoc/sepolicy/dump_aoc.te +++ b/aoc/sepolicy/dump_aoc.te @@ -1,5 +1,6 @@ pixel_bugreport(dump_aoc) allow dump_aoc sysfs_aoc:dir search; +allow dump_aoc sysfs:dir r_dir_perms; allow dump_aoc sysfs_aoc_dumpstate:file r_file_perms; allow dump_aoc aoc_device:chr_file rw_file_perms; allow dump_aoc vendor_shell_exec:file execute_no_trans;