move ramdump relate dumpstate to gs-common
Bug: 248428203 Test: adb bugreport Change-Id: I2e3f3ebaccd6a6b345f75d6ebfb3f38d8be6d0f8
This commit is contained in:
parent
e8b79b3a6a
commit
2b7c6714f1
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 := gs101
|
TARGET_BOARD_PLATFORM := gs101
|
||||||
DEVICE_IS_64BIT_ONLY ?= $(if $(filter %_64,$(TARGET_PRODUCT)),true,false)
|
DEVICE_IS_64BIT_ONLY ?= $(if $(filter %_64,$(TARGET_PRODUCT)),true,false)
|
||||||
|
|
|
@ -261,7 +261,6 @@ DumpstateDevice::DumpstateDevice()
|
||||||
{ "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); } },
|
||||||
{ "camera", [this](int fd) { dumpCameraSection(fd); } },
|
{ "camera", [this](int fd) { dumpCameraSection(fd); } },
|
||||||
{ "trusty", [this](int fd) { dumpTrustySection(fd); } },
|
{ "trusty", [this](int fd) { dumpTrustySection(fd); } },
|
||||||
|
@ -973,39 +972,6 @@ void DumpstateDevice::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 DumpstateDevice::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 DumpstateDevice::dumpMiscSection(int fd) {
|
void DumpstateDevice::dumpMiscSection(int fd) {
|
||||||
RunCommandToFd(fd, "VENDOR PROPERTIES", {"/vendor/bin/getprop"});
|
RunCommandToFd(fd, "VENDOR PROPERTIES", {"/vendor/bin/getprop"});
|
||||||
|
|
|
@ -73,7 +73,6 @@ struct DumpstateDevice : public IDumpstateDevice {
|
||||||
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 dumpCameraSection(int fd);
|
void dumpCameraSection(int fd);
|
||||||
void dumpTrustySection(int fd);
|
void dumpTrustySection(int fd);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue