dumpstate: Add logbuffer support for pcie

Add logbuffer support to pcie driver to reduce dmesg spam.

Bug: 228870318
Change-Id: I20f3d88c79d92a2b0d64606b430c064dc2ab5e6c
Signed-off-by: Sajid Dalvi <sdalvi@google.com>
This commit is contained in:
Sajid Dalvi 2023-01-24 18:59:42 -06:00
parent 4436f9d6c5
commit e79e3b167a
6 changed files with 26 additions and 0 deletions

10
pcie/Android.bp Normal file
View File

@ -0,0 +1,10 @@
package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
sh_binary {
name: "dump_pcie.sh",
src: "dump_pcie.sh",
vendor: true,
sub_dir: "dump",
}

5
pcie/dump_pcie.sh Normal file
View File

@ -0,0 +1,5 @@
#!/vendor/bin/sh
echo "--- pcie0 dump ---"
cat /dev/logbuffer_pcie0
echo "--- pcie1 dump ---"
cat /dev/logbuffer_pcie1

2
pcie/pcie.mk Normal file
View File

@ -0,0 +1,2 @@
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/pcie/sepolicy
PRODUCT_PACKAGES += dump_pcie.sh

1
pcie/sepolicy/device.te Normal file
View File

@ -0,0 +1 @@
type pcie_log_device, dev_type;

View File

@ -0,0 +1,4 @@
pixel_bugreport(dump_pcie)
allow dump_pcie pcie_log_device:chr_file r_file_perms;
allow dump_pcie vendor_toolbox_exec:file execute_no_trans;

View File

@ -0,0 +1,4 @@
/vendor/bin/dump/dump_pcie\.sh u:object_r:dump_pcie_exec:s0
/dev/logbuffer_pcie0 u:object_r:pcie_log_device:s0
/dev/logbuffer_pcie1 u:object_r:pcie_log_device:s0