dump_gps: Support thinmd logs collect
Flag: EXEMPT logs collection. Bug: 386286230 Test: b/386286230#comment3 bugreport example. Change-Id: I93d385cd1a03aa55f63520626072d1bf7ccedb86
This commit is contained in:
parent
6e56542845
commit
fe1d00ff58
1 changed files with 26 additions and 14 deletions
|
@ -39,8 +39,9 @@ static void copyDirectory(const std::string &source,
|
||||||
if (dir == nullptr) {
|
if (dir == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
struct stat st;
|
||||||
if (mkdir(outputDir.c_str(), 0777) == -1) {
|
if (!(stat(outputDir.c_str(), &st) == 0 && S_ISDIR(st.st_mode)) &&
|
||||||
|
mkdir(outputDir.c_str(), 0777) == -1) {
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -54,8 +55,6 @@ static void copyDirectory(const std::string &source,
|
||||||
|
|
||||||
std::string sourcePath = source + "/" + entryName;
|
std::string sourcePath = source + "/" + entryName;
|
||||||
std::string destPath = outputDir + "/" + entryName;
|
std::string destPath = outputDir + "/" + entryName;
|
||||||
|
|
||||||
struct stat st;
|
|
||||||
if (stat(sourcePath.c_str(), &st) == 0) {
|
if (stat(sourcePath.c_str(), &st) == 0) {
|
||||||
if (S_ISDIR(st.st_mode))
|
if (S_ISDIR(st.st_mode))
|
||||||
copyDirectory(sourcePath, destPath);
|
copyDirectory(sourcePath, destPath);
|
||||||
|
@ -130,16 +129,29 @@ int main() {
|
||||||
printf("Unable to create folder: %s\n", outputDir.c_str());
|
printf("Unable to create folder: %s\n", outputDir.c_str());
|
||||||
return 0;
|
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_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(), 3, GPS_MCU_LOG_PREFIX);
|
||||||
dumpLogs(GPS_LOG_DIRECTORY, outputDir.c_str(), maxFileNum, GPS_LOG_PREFIX);
|
dumpLogs(GPS_LOG_DIRECTORY, outputDir.c_str(), maxFileNum,
|
||||||
dumpLogs(GPS_MALLOC_LOG_DIRECTORY, outputDir.c_str(), 1, GPS_MALLOC_LOG_PREFIX);
|
GPS_LOG_PREFIX);
|
||||||
if (access(GPS_VENDOR_CHIP_INFO, F_OK) == 0) {
|
dumpLogs(GPS_MALLOC_LOG_DIRECTORY, outputDir.c_str(), 1,
|
||||||
copyFile(GPS_VENDOR_CHIP_INFO, concatenatePath(outputDir.c_str(), "chip.info").c_str());
|
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());
|
||||||
|
}
|
||||||
|
if (access(GPS_VENDOR_CHIP_INFO, F_OK) == 0) {
|
||||||
|
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"));
|
copyDirectory(GPS_RESOURCE_DIRECTORY, concatenatePath(outputDir.c_str(), "resource"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue