From 6fe621f1a53ebcf9093fd530c99a69bf8ecf30a5 Mon Sep 17 00:00:00 2001 From: Adam Shih Date: Fri, 10 Feb 2023 13:21:55 +0800 Subject: [PATCH] extract misc section from dumpstate Bug: 240530709 Test: adb bugreport Change-Id: I209101de3cc5c583bbe73fbfc29ace80c4da31d2 --- device.mk | 1 + dumpstate/Dumpstate.cpp | 19 +------------------ dumpstate/Dumpstate.h | 2 -- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/device.mk b/device.mk index 663a92e2..54591b01 100644 --- a/device.mk +++ b/device.mk @@ -24,6 +24,7 @@ include device/google/gs-common/trusty/trusty.mk include device/google/gs-common/pcie/pcie.mk include device/google/gs-common/storage/storage.mk include device/google/gs-common/thermal/thermal.mk +include device/google/gs-common/performance/perf.mk include device/google/zuma/dumpstate/item.mk diff --git a/dumpstate/Dumpstate.cpp b/dumpstate/Dumpstate.cpp index 80542580..c0ee344e 100644 --- a/dumpstate/Dumpstate.cpp +++ b/dumpstate/Dumpstate.cpp @@ -208,23 +208,11 @@ void endSection(int fd, const std::string §ionName, timepoint_t startTime) { "\n", fd); } -// If you are adding a single RunCommandToFd() or DumpFileToFd() call, please -// add it to dumpMiscSection(). But if you are adding multiple items that are -// related to each other - for instance, for a Foo peripheral - please add them -// to a new dump function and include it in this table so it can be accessed from the -// command line, e.g.: -// dumpsys android.hardware.dumpstate.IDumpstateDevice/default foo -// -// However, if your addition generates attachments and/or binary data for the -// bugreport (i.e. if it requires two file descriptors to execute), it must not be -// added to this table and should instead be added to dumpstateBoard() below. - Dumpstate::Dumpstate() : mTextSections{ { "memory", [this](int fd) { dumpMemorySection(fd); } }, { "Devfreq", [this](int fd) { dumpDevfreqSection(fd); } }, { "display", [this](int fd) { dumpDisplaySection(fd); } }, - { "misc", [this](int fd) { dumpMiscSection(fd); } }, { "led", [this](int fd) { dumpLEDSection(fd); } }, }, mLogSections{ @@ -280,6 +268,7 @@ void Dumpstate::dumpTextSection(int fd, const std::string §ionName) { } if (dumpAll) { + RunCommandToFd(fd, "VENDOR PROPERTIES", {"/vendor/bin/getprop"}); return; } @@ -381,12 +370,6 @@ void Dumpstate::dumpDisplaySection(int fd) { } } -// Dump items that don't fit well into any other section -void Dumpstate::dumpMiscSection(int fd) { - RunCommandToFd(fd, "VENDOR PROPERTIES", {"/vendor/bin/getprop"}); - DumpFileToFd(fd, "VENDOR PROC DUMP", "/proc/vendor_sched/dump_task"); -} - // Dump items related to LED void Dumpstate::dumpLEDSection(int fd) { struct stat buffer; diff --git a/dumpstate/Dumpstate.h b/dumpstate/Dumpstate.h index 76ff6246..987f9711 100644 --- a/dumpstate/Dumpstate.h +++ b/dumpstate/Dumpstate.h @@ -52,11 +52,9 @@ class Dumpstate : public BnDumpstateDevice { // Text sections that can be dumped individually on the command line in // addition to being included in full dumps - void dumpPowerSection(int fd); void dumpDevfreqSection(int fd); void dumpMemorySection(int fd); void dumpDisplaySection(int fd); - void dumpMiscSection(int fd); void dumpLEDSection(int fd); void dumpLogSection(int fd, int fdModem);