move ramdump relate dumpstate to gs-common
Bug: 248428203 Test: adb bugreport Change-Id: I6fb17e87d1acf43421e7aca5ccdc1c1c6e03f022
This commit is contained in:
parent
8a0f7e41ad
commit
3c8b537bc9
3 changed files with 1 additions and 35 deletions
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
include device/google/gs-common/device.mk
|
include device/google/gs-common/device.mk
|
||||||
include device/google/gs-common/gs_watchdogd/watchdog.mk
|
include device/google/gs-common/gs_watchdogd/watchdog.mk
|
||||||
|
include device/google/gs-common/ramdump/ramdump.mk
|
||||||
|
|
||||||
TARGET_BOARD_PLATFORM := gs201
|
TARGET_BOARD_PLATFORM := gs201
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,6 @@ Dumpstate::Dumpstate()
|
||||||
{ "display", [this](int fd) { dumpDisplaySection(fd); } },
|
{ "display", [this](int fd) { dumpDisplaySection(fd); } },
|
||||||
{ "sensors-usf", [this](int fd) { dumpSensorsUSFSection(fd); } },
|
{ "sensors-usf", [this](int fd) { dumpSensorsUSFSection(fd); } },
|
||||||
{ "aoc", [this](int fd) { dumpAoCSection(fd); } },
|
{ "aoc", [this](int fd) { dumpAoCSection(fd); } },
|
||||||
{ "ramdump", [this](int fd) { dumpRamdumpSection(fd); } },
|
|
||||||
{ "misc", [this](int fd) { dumpMiscSection(fd); } },
|
{ "misc", [this](int fd) { dumpMiscSection(fd); } },
|
||||||
{ "led", [this](int fd) { dumpLEDSection(fd); } },
|
{ "led", [this](int fd) { dumpLEDSection(fd); } },
|
||||||
},
|
},
|
||||||
|
@ -1036,39 +1035,6 @@ void Dumpstate::dumpSensorsUSFSection(int fd) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gzip binary data and dump to fd in base64 format. Cmd to decode is also attached.
|
|
||||||
void dumpGzippedFileInBase64ToFd(int fd, const char* title, const char* file_path) {
|
|
||||||
auto cmd = ::android::base::StringPrintf("echo 'base64 -d <<EOF | gunzip' ; "
|
|
||||||
"/vendor/bin/gzip < \"%s\" | /vendor/bin/base64 ; "
|
|
||||||
"echo 'EOF'", file_path);
|
|
||||||
RunCommandToFd(fd, title,
|
|
||||||
{"/vendor/bin/sh", "-c", cmd.c_str()},
|
|
||||||
CommandOptions::WithTimeout(10).Build());
|
|
||||||
}
|
|
||||||
|
|
||||||
struct abl_log_header {
|
|
||||||
uint64_t i;
|
|
||||||
uint64_t size;
|
|
||||||
char buf[];
|
|
||||||
} __attribute__((packed));
|
|
||||||
|
|
||||||
// Dump items related to ramdump.
|
|
||||||
void Dumpstate::dumpRamdumpSection(int fd) {
|
|
||||||
std::string abl_log;
|
|
||||||
if (::android::base::ReadFileToString("/mnt/vendor/ramdump/abl.log", &abl_log)) {
|
|
||||||
const struct abl_log_header *header = (const struct abl_log_header*) abl_log.c_str();
|
|
||||||
::android::base::WriteStringToFd(::android::base::StringPrintf(
|
|
||||||
"------ Ramdump misc file: abl.log (i:0x%" PRIx64 " size:0x%" PRIx64 ") ------\n%s\n",
|
|
||||||
header->i, header->size, std::string(header->buf, header->i).c_str()), fd);
|
|
||||||
} else {
|
|
||||||
::android::base::WriteStringToFd("*** Ramdump misc file: abl.log: File not found\n", fd);
|
|
||||||
}
|
|
||||||
dumpGzippedFileInBase64ToFd(
|
|
||||||
fd, "Ramdump misc file: acpm.lst (gzipped in base64)", "/mnt/vendor/ramdump/acpm.lst");
|
|
||||||
dumpGzippedFileInBase64ToFd(
|
|
||||||
fd, "Ramdump misc file: s2d.lst (gzipped in base64)", "/mnt/vendor/ramdump/s2d.lst");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dump items that don't fit well into any other section
|
// Dump items that don't fit well into any other section
|
||||||
void Dumpstate::dumpMiscSection(int fd) {
|
void Dumpstate::dumpMiscSection(int fd) {
|
||||||
RunCommandToFd(fd, "VENDOR PROPERTIES", {"/vendor/bin/getprop"});
|
RunCommandToFd(fd, "VENDOR PROPERTIES", {"/vendor/bin/getprop"});
|
||||||
|
|
|
@ -64,7 +64,6 @@ class Dumpstate : public BnDumpstateDevice {
|
||||||
void dumpDisplaySection(int fd);
|
void dumpDisplaySection(int fd);
|
||||||
void dumpSensorsUSFSection(int fd);
|
void dumpSensorsUSFSection(int fd);
|
||||||
void dumpAoCSection(int fd);
|
void dumpAoCSection(int fd);
|
||||||
void dumpRamdumpSection(int fd);
|
|
||||||
void dumpMiscSection(int fd);
|
void dumpMiscSection(int fd);
|
||||||
void dumpLEDSection(int fd);
|
void dumpLEDSection(int fd);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue