use gs-common gps dump

Bug: 273380509
Test: adb bugreport
Change-Id: I97ac88eb9b5ade2d5bfa262b00a2818bbbb789bb
This commit is contained in:
Adam Shih 2023-03-22 11:36:20 +08:00
parent 77b78a9857
commit a3c81a57ad
3 changed files with 1 additions and 27 deletions

View file

@ -35,9 +35,6 @@
#define RIL_LOG_DIRECTORY "/data/vendor/radio"
#define RIL_LOG_DIRECTORY_PROPERTY "persist.vendor.ril.log.base_dir"
#define RIL_LOG_NUMBER_PROPERTY "persist.vendor.ril.log.num_file"
#define GPS_LOG_DIRECTORY "/data/vendor/gps/logs"
#define GPS_LOG_NUMBER_PROPERTY "persist.vendor.gps.aol.log_num"
#define GPS_LOGGING_STATUS_PROPERTY "vendor.gps.aol.enabled"
#define TCPDUMP_LOG_DIRECTORY "/data/vendor/tcpdump_logger/logs"
#define TCPDUMP_NUMBER_BUGREPORT "persist.vendor.tcpdump.log.br_num"
@ -53,8 +50,6 @@ namespace android {
namespace hardware {
namespace dumpstate {
#define GPS_LOG_PREFIX "gl-"
#define GPS_MCU_LOG_PREFIX "esw-"
#define EXTENDED_LOG_PREFIX "extended_log_"
#define RIL_LOG_PREFIX "rild.log."
#define BUFSIZE 65536
@ -198,7 +193,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); } },
} {
}
@ -481,26 +475,6 @@ void Dumpstate::dumpRadioLogs(int fd, const std::string &destDir) {
dumpNetmgrLogs(destDir);
}
void Dumpstate::dumpGpsLogs(int fd, const std::string &destDir) {
bool gpsLogEnabled = ::android::base::GetBoolProperty(GPS_LOGGING_STATUS_PROPERTY, false);
if (!gpsLogEnabled) {
ALOGD("gps logging is not running\n");
return;
}
const std::string gpsLogDir = GPS_LOG_DIRECTORY;
const std::string gpsTmpLogDir = gpsLogDir + "/.tmp";
const std::string gpsDestDir = destDir + "/gps";
int maxFileNum = ::android::base::GetIntProperty(GPS_LOG_NUMBER_PROPERTY, 20);
RunCommandToFd(fd, "MKDIR GPS LOG", {"/vendor/bin/mkdir", "-p", gpsDestDir.c_str()},
CommandOptions::WithTimeout(2).Build());
dumpLogs(fd, gpsTmpLogDir, gpsDestDir, 1, GPS_LOG_PREFIX);
dumpLogs(fd, gpsLogDir, gpsDestDir, 3, GPS_MCU_LOG_PREFIX);
dumpLogs(fd, gpsLogDir, gpsDestDir, maxFileNum, GPS_LOG_PREFIX);
}
void Dumpstate::dumpLogSection(int fd, int fd_bin)
{
std::string logDir = MODEM_LOG_DIRECTORY;