create cma dump

Bug: 240530709
Test: adb bugreport
Change-Id: Iadac309611bc6dd27615b087f159234d6f1b655c
This commit is contained in:
Adam Shih 2023-02-15 12:42:16 +08:00
parent 8eb00e662f
commit 5f802b7e13
5 changed files with 18 additions and 13 deletions

View file

@ -16,6 +16,13 @@ sh_binary {
sub_dir: "dump", sub_dir: "dump",
} }
sh_binary {
name: "dump_cma.sh",
src: "dump_cma.sh",
vendor: true,
sub_dir: "dump",
}
cc_binary { cc_binary {
name: "android.hardware.dumpstate-service.zuma", name: "android.hardware.dumpstate-service.zuma",
srcs: [ srcs: [

View file

@ -210,7 +210,6 @@ void endSection(int fd, const std::string &sectionName, timepoint_t startTime) {
Dumpstate::Dumpstate() Dumpstate::Dumpstate()
: mTextSections{ : mTextSections{
{ "memory", [this](int fd) { dumpMemorySection(fd); } },
{ "display", [this](int fd) { dumpDisplaySection(fd); } }, { "display", [this](int fd) { dumpDisplaySection(fd); } },
}, },
mLogSections{ mLogSections{
@ -281,17 +280,6 @@ void Dumpstate::dumpTextSection(int fd, const std::string &sectionName) {
"not avalable from the command line.\n", fd); "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 // Dump items related to display
void Dumpstate::dumpDisplaySection(int fd) { void Dumpstate::dumpDisplaySection(int fd) {
// Dump counters for decon drivers // Dump counters for decon drivers

View file

@ -52,7 +52,6 @@ class Dumpstate : public BnDumpstateDevice {
// Text sections that can be dumped individually on the command line in // Text sections that can be dumped individually on the command line in
// addition to being included in full dumps // addition to being included in full dumps
void dumpMemorySection(int fd);
void dumpDisplaySection(int fd); void dumpDisplaySection(int fd);
void dumpLogSection(int fd, int fdModem); void dumpLogSection(int fd, int fdModem);

9
dumpstate/dump_cma.sh Normal file
View file

@ -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

View file

@ -1,3 +1,5 @@
PRODUCT_PACKAGES += dump_wlan.sh \ PRODUCT_PACKAGES += dump_wlan.sh \
dump_power.sh dump_power.sh
PRODUCT_PACKAGES_DEBUG += dump_cma.sh