From 4f56b0c6af6730bda855e1bd8dc7950d6aff2e29 Mon Sep 17 00:00:00 2001 From: Adam Shih Date: Wed, 28 Sep 2022 10:25:02 +0800 Subject: [PATCH 1/3] Put gs_watchdog settings to one place Bug: 248428203 Test: gs_watchdog is still in system_ext Change-Id: Iaee4020f3d978878a3b77dc86cef330c67be6c8e --- device.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/device.mk b/device.mk index 459156ff..dbe74c48 100644 --- a/device.mk +++ b/device.mk @@ -15,6 +15,7 @@ # include device/google/gs-common/device.mk +include device/google/gs-common/gs_watchdogd/watchdog.mk TARGET_BOARD_PLATFORM := gs101 DEVICE_IS_64BIT_ONLY ?= $(if $(filter %_64,$(TARGET_PRODUCT)),true,false) From badac57edde0dc3c486b98c4da0fa5fd52a908c6 Mon Sep 17 00:00:00 2001 From: Adam Shih Date: Wed, 28 Sep 2022 13:01:40 +0800 Subject: [PATCH 2/3] move UFS dump to gs-common Bug: 248143736 Test: adb bugreport Change-Id: I39b950942d0d7d9331fa808f46cd7622c5b43690 --- dumpstate/DumpstateDevice.cpp | 59 ----------------------------------- dumpstate/DumpstateDevice.h | 1 - 2 files changed, 60 deletions(-) diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp index d6962997..3a878f1d 100644 --- a/dumpstate/DumpstateDevice.cpp +++ b/dumpstate/DumpstateDevice.cpp @@ -45,8 +45,6 @@ #define GPS_LOG_NUMBER_PROPERTY "persist.vendor.gps.aol.log_num" #define GPS_LOGGING_STATUS_PROPERTY "vendor.gps.aol.enabled" -#define UFS_BOOTDEVICE "ro.boot.bootdevice" - #define TCPDUMP_LOG_DIRECTORY "/data/vendor/tcpdump_logger/logs" #define TCPDUMP_NUMBER_BUGREPORT "persist.vendor.tcpdump.log.br_num" #define TCPDUMP_PERSIST_PROPERTY "persist.vendor.tcpdump.log.alwayson" @@ -254,7 +252,6 @@ DumpstateDevice::DumpstateDevice() { "pre-touch", [this](int fd) { dumpPreTouchSection(fd); } }, { "wlan", [this](int fd) { dumpWlanSection(fd); } }, { "soc", [this](int fd) { dumpSocSection(fd); } }, - { "storage", [this](int fd) { dumpStorageSection(fd); } }, { "memory", [this](int fd) { dumpMemorySection(fd); } }, { "Devfreq", [this](int fd) { dumpDevfreqSection(fd); } }, { "cpu", [this](int fd) { dumpCpuSection(fd); } }, @@ -900,62 +897,6 @@ void DumpstateDevice::dumpMemorySection(int fd) { "done"}); } -static void DumpUFS(int fd) { - 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"); - - DumpFileToFd(fd, "UFS Slow IO Read", "/dev/sys/block/bootdevice/slowio_read_cnt"); - DumpFileToFd(fd, "UFS Slow IO Write", "/dev/sys/block/bootdevice/slowio_write_cnt"); - DumpFileToFd(fd, "UFS Slow IO Unmap", "/dev/sys/block/bootdevice/slowio_unmap_cnt"); - DumpFileToFd(fd, "UFS Slow IO Sync", "/dev/sys/block/bootdevice/slowio_sync_cnt"); - - RunCommandToFd(fd, "UFS err_stats", {"/vendor/bin/sh", "-c", - "path=\"/dev/sys/block/bootdevice/err_stats\"; " - "for node in `ls $path/* | grep -v reset_err_status`; do " - "printf \"%s:%d\\n\" $(basename $node) $(cat $node); done;"}); - - - RunCommandToFd(fd, "UFS io_stats", {"/vendor/bin/sh", "-c", - "path=\"/dev/sys/block/bootdevice/io_stats\"; " - "printf \"\\t\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " - "ReadCnt ReadBytes WriteCnt WriteBytes RWCnt RWBytes; " - "str=$(cat $path/*_start); arr=($str); " - "printf \"Started: \\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " - "${arr[1]} ${arr[0]} ${arr[5]} ${arr[4]} ${arr[3]} ${arr[2]}; " - "str=$(cat $path/*_complete); arr=($str); " - "printf \"Completed: \\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " - "${arr[1]} ${arr[0]} ${arr[5]} ${arr[4]} ${arr[3]} ${arr[2]}; " - "str=$(cat $path/*_maxdiff); arr=($str); " - "printf \"MaxDiff: \\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\\n\" " - "${arr[1]} ${arr[0]} ${arr[5]} ${arr[4]} ${arr[3]} ${arr[2]}; "}); - - RunCommandToFd(fd, "UFS req_stats", {"/vendor/bin/sh", "-c", - "path=\"/dev/sys/block/bootdevice/req_stats\"; " - "printf \"\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " - "All Write Read Security Flush Discard; " - "str=$(cat $path/*_min); arr=($str); " - "printf \"Min:\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " - "${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]}; " - "str=$(cat $path/*_max); arr=($str); " - "printf \"Max:\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " - "${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]}; " - "str=$(cat $path/*_avg); arr=($str); " - "printf \"Avg.:\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " - "${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]}; " - "str=$(cat $path/*_sum); arr=($str); " - "printf \"Count:\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\\n\" " - "${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]};"}); - - std::string ufs_health = "for f in $(find /dev/sys/block/bootdevice/health_descriptor -type f); do if [[ -r $f && -f $f ]]; then echo --- $f; cat $f; echo ''; fi; done"; - RunCommandToFd(fd, "UFS health", {"/vendor/bin/sh", "-c", ufs_health.c_str()}); -} - -// Dump items related to storage -void DumpstateDevice::dumpStorageSection(int fd) { - DumpUFS(fd); -} - // Dump items related to display void DumpstateDevice::dumpDisplaySection(int fd) { DumpFileToFd(fd, "CRTC-0 underrun count", "/sys/kernel/debug/dri/0/crtc-0/underrun_cnt"); diff --git a/dumpstate/DumpstateDevice.h b/dumpstate/DumpstateDevice.h index 916ba1f9..0ebae41a 100644 --- a/dumpstate/DumpstateDevice.h +++ b/dumpstate/DumpstateDevice.h @@ -70,7 +70,6 @@ struct DumpstateDevice : public IDumpstateDevice { void dumpCpuSection(int fd); void dumpDevfreqSection(int fd); void dumpMemorySection(int fd); - void dumpStorageSection(int fd); void dumpDisplaySection(int fd); void dumpSensorsUSFSection(int fd); void dumpAoCSection(int fd); From ef1e8e11b91aaa5a6cd6dc8a893401433b34757f Mon Sep 17 00:00:00 2001 From: Xusong Wang Date: Tue, 20 Sep 2022 16:31:39 -0700 Subject: [PATCH 3/3] Enable Edge TPU DBA HAL on gs101. Bug: 245792277 Test: edgetpu_dba_hal_test Change-Id: If46fb1b18dcf7768ef481eb07f27dd9faa95b2f5 --- device_framework_matrix_product.xml | 8 ++++++++ edgetpu/edgetpu.mk | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/device_framework_matrix_product.xml b/device_framework_matrix_product.xml index 1d9648a3..e63c4971 100644 --- a/device_framework_matrix_product.xml +++ b/device_framework_matrix_product.xml @@ -72,6 +72,14 @@ default + + com.google.edgetpu.dba + 1 + + IDevice + default + + com.google.hardware.pixel.display 6 diff --git a/edgetpu/edgetpu.mk b/edgetpu/edgetpu.mk index 49658ed2..68003db2 100644 --- a/edgetpu/edgetpu.mk +++ b/edgetpu/edgetpu.mk @@ -29,4 +29,12 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \ libmetrics_logger +# TPU DBA AIDL HAL service +PRODUCT_PACKAGES += \ + com.google.edgetpu.dba-service + +# TPU DBA HAL C API library +PRODUCT_PACKAGES += \ + libedgetpu_dba_hal + BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs101-sepolicy/edgetpu/