diff --git a/device.mk b/device.mk index ab6bf28b..ad84648f 100644 --- a/device.mk +++ b/device.mk @@ -25,6 +25,7 @@ include device/google/gs-common/thermal/thermal.mk include device/google/gs-common/pixel_metrics/pixel_metrics.mk include device/google/gs-common/performance/perf.mk include device/google/gs-common/display/dump.mk +include device/google/gs101/dumpstate/item.mk TARGET_BOARD_PLATFORM := gs101 DEVICE_IS_64BIT_ONLY ?= $(if $(filter %_64,$(TARGET_PRODUCT)),true,false) diff --git a/dumpstate/Android.bp b/dumpstate/Android.bp index 9b6076de..6e0dd269 100644 --- a/dumpstate/Android.bp +++ b/dumpstate/Android.bp @@ -2,6 +2,13 @@ package { default_applicable_licenses: ["Android-Apache-2.0"], } +sh_binary { + name: "dump_gs101.sh", + src: "dump_gs101.sh", + vendor: true, + sub_dir: "dump", +} + cc_binary { name: "android.hardware.dumpstate-service.gs101", srcs: [ diff --git a/dumpstate/Dumpstate.cpp b/dumpstate/Dumpstate.cpp index 57f929f8..d4af35b0 100644 --- a/dumpstate/Dumpstate.cpp +++ b/dumpstate/Dumpstate.cpp @@ -241,7 +241,6 @@ void endSection(int fd, const std::string §ionName, timepoint_t startTime) { Dumpstate::Dumpstate() : mTextSections{ - { "memory", [this](int fd) { dumpMemorySection(fd); } }, { "power", [this](int fd) { dumpPowerSection(fd); } }, { "camera", [this](int fd) { dumpCameraSection(fd); } }, } { @@ -492,20 +491,6 @@ void Dumpstate::dumpPowerSection(int fd) { } -// Dump items related to memory -void Dumpstate::dumpMemorySection(int fd) { - RunCommandToFd(fd, "Pixel CMA stat", {"/vendor/bin/sh", "-c", - "for d in $(ls -d /sys/kernel/pixel_stat/mm/cma/*); do " - "if [ -f $d ]; then " - "echo --- $d; cat $d; " - "else " - "for f in $(ls $d); do " - "echo --- $d/$f; cat $d/$f; " - "done; " - "fi; " - "done"}); -} - // Dump essential camera debugging logs void Dumpstate::dumpCameraSection(int fd) { RunCommandToFd(fd, "Camera HAL Graph State Dump", {"/vendor/bin/sh", "-c", diff --git a/dumpstate/dump_gs101.sh b/dumpstate/dump_gs101.sh new file mode 100644 index 00000000..211140ca --- /dev/null +++ b/dumpstate/dump_gs101.sh @@ -0,0 +1,14 @@ +#!/vendor/bin/sh +echo "------ Pixel CMA stat ------" +for d in $(ls -d /sys/kernel/pixel_stat/mm/cma/*); do + if [ -f $d ]; then + echo --- $d + cat $d + else + for f in $(ls $d); do + echo --- $d/$f + cat $d/$f + done + fi +done + diff --git a/dumpstate/item.mk b/dumpstate/item.mk new file mode 100644 index 00000000..7a1d2ba0 --- /dev/null +++ b/dumpstate/item.mk @@ -0,0 +1,2 @@ +PRODUCT_PACKAGES += dump_gs101.sh +