use gxp dump in gs-common

The function is introduced in ag/21644929
Bug: 273380509
Test: adb bugreport;unzip *zip;tar -xvf dumpstate_board.bin
And found gxp content

Change-Id: Ife6e7dc1c399150b149f5fbd14c902da6cdeefcf
This commit is contained in:
Adam Shih 2023-03-21 11:17:47 +08:00
parent d72768a1fe
commit 1b92506c4d
3 changed files with 1 additions and 18 deletions

View file

@ -199,7 +199,6 @@ Dumpstate::Dumpstate()
mLogSections{
{ "radio", [this](int fd, const std::string &destDir) { dumpRadioLogs(fd, destDir); } },
{ "gps", [this](int fd, const std::string &destDir) { dumpGpsLogs(fd, destDir); } },
{ "gxp", [this](int fd, const std::string &destDir) { dumpGxpLogs(fd, destDir); } },
} {
}
@ -502,22 +501,6 @@ void Dumpstate::dumpGpsLogs(int fd, const std::string &destDir) {
dumpLogs(fd, gpsLogDir, gpsDestDir, maxFileNum, GPS_LOG_PREFIX);
}
void Dumpstate::dumpGxpLogs(int fd, const std::string &destDir) {
bool gxpDumpEnabled = ::android::base::GetBoolProperty("vendor.gxp.attach_to_bugreport", false);
if (gxpDumpEnabled) {
const int maxGxpDebugDumps = 8;
const std::string gxpCoredumpOutputDir = destDir + "/gxp_ssrdump";
const std::string gxpCoredumpInputDir = "/data/vendor/ssrdump";
RunCommandToFd(fd, "MKDIR GXP COREDUMP", {"/vendor/bin/mkdir", "-p", gxpCoredumpOutputDir}, CommandOptions::WithTimeout(2).Build());
// Copy GXP coredumps and crashinfo to the output directory.
dumpLogs(fd, gxpCoredumpInputDir + "/coredump", gxpCoredumpOutputDir, maxGxpDebugDumps, "coredump_gxp_platform");
dumpLogs(fd, gxpCoredumpInputDir, gxpCoredumpOutputDir, maxGxpDebugDumps, "crashinfo_gxp_platform");
}
}
void Dumpstate::dumpLogSection(int fd, int fd_bin)
{
std::string logDir = MODEM_LOG_DIRECTORY;