Merge "dump_gps: Support thinmd logs collect" into main
This commit is contained in:
commit
72d5eb8a6e
1 changed files with 26 additions and 14 deletions
|
@ -39,8 +39,9 @@ static void copyDirectory(const std::string &source,
|
|||
if (dir == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mkdir(outputDir.c_str(), 0777) == -1) {
|
||||
struct stat st;
|
||||
if (!(stat(outputDir.c_str(), &st) == 0 && S_ISDIR(st.st_mode)) &&
|
||||
mkdir(outputDir.c_str(), 0777) == -1) {
|
||||
closedir(dir);
|
||||
return;
|
||||
}
|
||||
|
@ -54,8 +55,6 @@ static void copyDirectory(const std::string &source,
|
|||
|
||||
std::string sourcePath = source + "/" + entryName;
|
||||
std::string destPath = outputDir + "/" + entryName;
|
||||
|
||||
struct stat st;
|
||||
if (stat(sourcePath.c_str(), &st) == 0) {
|
||||
if (S_ISDIR(st.st_mode))
|
||||
copyDirectory(sourcePath, destPath);
|
||||
|
@ -127,19 +126,32 @@ int main() {
|
|||
int maxFileNum = ::android::base::GetIntProperty(GPS_LOG_NUMBER_PROPERTY, 20);
|
||||
std::string outputDir = concatenatePath(BUGREPORT_PACKING_DIR, "gps");
|
||||
if (mkdir(outputDir.c_str(), 0777) == -1) {
|
||||
printf("Unable to create folder: %s\n", outputDir.c_str());
|
||||
return 0;
|
||||
printf("Unable to create folder: %s\n", outputDir.c_str());
|
||||
return 0;
|
||||
}
|
||||
if (!::android::base::GetBoolProperty("vendor.gps.aol.collect.thinmd",
|
||||
false)) {
|
||||
printf("vendor.gps.aol.collect.thinmd is false. Collecting fils as "
|
||||
"legacy Pixel.\n");
|
||||
dumpLogs(GPS_TMP_LOG_DIRECTORY, outputDir.c_str(), 1, GPS_LOG_PREFIX);
|
||||
dumpLogs(GPS_LOG_DIRECTORY, outputDir.c_str(), 3, GPS_MCU_LOG_PREFIX);
|
||||
dumpLogs(GPS_LOG_DIRECTORY, outputDir.c_str(), maxFileNum,
|
||||
GPS_LOG_PREFIX);
|
||||
dumpLogs(GPS_MALLOC_LOG_DIRECTORY, outputDir.c_str(), 1,
|
||||
GPS_MALLOC_LOG_PREFIX);
|
||||
dumpLogsAscending(GPS_LOG_DIRECTORY, outputDir.c_str(), 5,
|
||||
GPS_RAWLOG_PREFIX);
|
||||
dumpLogs(GPS_LOG_DIRECTORY, outputDir.c_str(), 18,
|
||||
GPS_MEMDUMP_LOG_PREFIX);
|
||||
} else {
|
||||
printf("vendor.gps.aol.collect.thinmd is true. Collecting fils as thin "
|
||||
"modem.\n");
|
||||
copyDirectory(GPS_LOG_DIRECTORY, outputDir.c_str());
|
||||
}
|
||||
|
||||
dumpLogs(GPS_TMP_LOG_DIRECTORY, outputDir.c_str(), 1, GPS_LOG_PREFIX);
|
||||
dumpLogs(GPS_LOG_DIRECTORY, outputDir.c_str(), 3, GPS_MCU_LOG_PREFIX);
|
||||
dumpLogs(GPS_LOG_DIRECTORY, outputDir.c_str(), maxFileNum, GPS_LOG_PREFIX);
|
||||
dumpLogs(GPS_MALLOC_LOG_DIRECTORY, outputDir.c_str(), 1, GPS_MALLOC_LOG_PREFIX);
|
||||
if (access(GPS_VENDOR_CHIP_INFO, F_OK) == 0) {
|
||||
copyFile(GPS_VENDOR_CHIP_INFO, concatenatePath(outputDir.c_str(), "chip.info").c_str());
|
||||
copyFile(GPS_VENDOR_CHIP_INFO,
|
||||
concatenatePath(outputDir.c_str(), "chip.info").c_str());
|
||||
}
|
||||
dumpLogsAscending(GPS_LOG_DIRECTORY, outputDir.c_str(), 5, GPS_RAWLOG_PREFIX);
|
||||
dumpLogs(GPS_LOG_DIRECTORY, outputDir.c_str(), 18, GPS_MEMDUMP_LOG_PREFIX);
|
||||
copyDirectory(GPS_RESOURCE_DIRECTORY, concatenatePath(outputDir.c_str(), "resource"));
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue