From 5f802b7e131936a8db8eb98ee9f8f7db37a360fc Mon Sep 17 00:00:00 2001 From: Adam Shih Date: Wed, 15 Feb 2023 12:42:16 +0800 Subject: [PATCH] create cma dump Bug: 240530709 Test: adb bugreport Change-Id: Iadac309611bc6dd27615b087f159234d6f1b655c --- dumpstate/Android.bp | 7 +++++++ dumpstate/Dumpstate.cpp | 12 ------------ dumpstate/Dumpstate.h | 1 - dumpstate/dump_cma.sh | 9 +++++++++ dumpstate/item.mk | 2 ++ 5 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 dumpstate/dump_cma.sh diff --git a/dumpstate/Android.bp b/dumpstate/Android.bp index 77683def..b4162202 100644 --- a/dumpstate/Android.bp +++ b/dumpstate/Android.bp @@ -16,6 +16,13 @@ sh_binary { sub_dir: "dump", } +sh_binary { + name: "dump_cma.sh", + src: "dump_cma.sh", + vendor: true, + sub_dir: "dump", +} + cc_binary { name: "android.hardware.dumpstate-service.zuma", srcs: [ diff --git a/dumpstate/Dumpstate.cpp b/dumpstate/Dumpstate.cpp index de407d72..f7bd41aa 100644 --- a/dumpstate/Dumpstate.cpp +++ b/dumpstate/Dumpstate.cpp @@ -210,7 +210,6 @@ void endSection(int fd, const std::string §ionName, timepoint_t startTime) { Dumpstate::Dumpstate() : mTextSections{ - { "memory", [this](int fd) { dumpMemorySection(fd); } }, { "display", [this](int fd) { dumpDisplaySection(fd); } }, }, mLogSections{ @@ -281,17 +280,6 @@ void Dumpstate::dumpTextSection(int fd, const std::string §ionName) { "not avalable from the command line.\n", fd); } -// Dump items related to memory -void Dumpstate::dumpMemorySection(int fd) { - RunCommandToFd(fd, "CMA info", {"/vendor/bin/sh", "-c", - "for d in $(ls -d /d/cma/*); do " - "echo --- $d;" - "echo --- count; cat $d/count; " - "echo --- used; cat $d/used; " - "echo --- bitmap; cat $d/bitmap; " - "done"}); -} - // Dump items related to display void Dumpstate::dumpDisplaySection(int fd) { // Dump counters for decon drivers diff --git a/dumpstate/Dumpstate.h b/dumpstate/Dumpstate.h index 37a8bf4c..2e5ace3a 100644 --- a/dumpstate/Dumpstate.h +++ b/dumpstate/Dumpstate.h @@ -52,7 +52,6 @@ class Dumpstate : public BnDumpstateDevice { // Text sections that can be dumped individually on the command line in // addition to being included in full dumps - void dumpMemorySection(int fd); void dumpDisplaySection(int fd); void dumpLogSection(int fd, int fdModem); diff --git a/dumpstate/dump_cma.sh b/dumpstate/dump_cma.sh new file mode 100644 index 00000000..63e497e7 --- /dev/null +++ b/dumpstate/dump_cma.sh @@ -0,0 +1,9 @@ +#!/vendor/bin/sh +echo "------ CMA info ------" +for d in $(ls -d /d/cma/*); do + echo --- $d + echo --- count; cat $d/count + echo --- used; cat $d/used + echo --- bitmap; cat $d/bitmap +done + diff --git a/dumpstate/item.mk b/dumpstate/item.mk index a0c2e96e..00ef3e6d 100644 --- a/dumpstate/item.mk +++ b/dumpstate/item.mk @@ -1,3 +1,5 @@ PRODUCT_PACKAGES += dump_wlan.sh \ dump_power.sh +PRODUCT_PACKAGES_DEBUG += dump_cma.sh +