summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicole Lee <nicoleytlee@google.com>2020-10-14 15:12:39 +0800
committerNicole Lee <nicoleytlee@google.com>2020-10-15 11:00:49 +0800
commit4cd901c6e2851ecc8c6945d70efe567cb4cdbbad (patch)
treea768eeec798071e3070394ed620f4aca72637f0a
parente95e8ee355da12e292f92d9e12afb68846f2cd02 (diff)
downloadbramble-4cd901c6e2851ecc8c6945d70efe567cb4cdbbad.tar.gz
dumpstate: adjust timing of disable and enable mdlog
Bug: 169662280 The timing of dumpstate to enable diag_mdlog is too marginal to diag_mdlog process exiting. The starting of diag_mdlog would fail if diag_mdlog process still exists. Change is to leave some time for diag_mdlog process to exit before it is enabled again by modifying the system property vendor.sys.modem.diag.mdlog to true. Change-Id: I825cd77e3f6e8fe6ce395cbe2c21974f1cb29d02
-rwxr-xr-xdumpstate/DumpstateDevice.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp
index 74afb8a..105132a 100755
--- a/dumpstate/DumpstateDevice.cpp
+++ b/dumpstate/DumpstateDevice.cpp
@@ -392,22 +392,10 @@ static void *dumpModemThread(void *data)
return NULL;
}
- sleep(1);
- ALOGD("Waited modem for 1 second to flush logs");
-
- const std::string modemLogCombined = modemLogDir + "/" + filePrefix + "all.tar";
- const std::string modemLogAllDir = modemLogDir + "/modem_log";
-
- RunCommandToFd(STDOUT_FILENO, "MKDIR MODEM LOG", {"/vendor/bin/mkdir", "-p", modemLogAllDir.c_str()}, CommandOptions::WithTimeout(2).Build());
-
- const std::string diagLogDir = "/data/vendor/radio/diag_logs/logs";
- const std::string diagPoweronLogPath = "/data/vendor/radio/diag_logs/logs/diag_poweron_log.qmdl";
-
bool diagLogEnabled = android::base::GetBoolProperty(DIAG_MDLOG_PERSIST_PROPERTY, false);
+ bool diagLogStarted = android::base::GetBoolProperty(DIAG_MDLOG_STATUS_PROPERTY, false);
if (diagLogEnabled) {
- bool diagLogStarted = android::base::GetBoolProperty( DIAG_MDLOG_STATUS_PROPERTY, false);
-
if (diagLogStarted) {
android::base::SetProperty(DIAG_MDLOG_PROPERTY, "false");
ALOGD("Stopping diag_mdlog...\n");
@@ -419,7 +407,20 @@ static void *dumpModemThread(void *data)
} else {
ALOGD("diag_mdlog is not running");
}
+ }
+ sleep(1);
+ ALOGD("Waited modem for 1 second to flush logs");
+
+ const std::string modemLogCombined = modemLogDir + "/" + filePrefix + "all.tar";
+ const std::string modemLogAllDir = modemLogDir + "/modem_log";
+
+ RunCommandToFd(STDOUT_FILENO, "MKDIR MODEM LOG", {"/vendor/bin/mkdir", "-p", modemLogAllDir.c_str()}, CommandOptions::WithTimeout(2).Build());
+
+ const std::string diagLogDir = "/data/vendor/radio/diag_logs/logs";
+ const std::string diagPoweronLogPath = "/data/vendor/radio/diag_logs/logs/diag_poweron_log.qmdl";
+
+ if (diagLogEnabled) {
dumpLogs(STDOUT_FILENO, diagLogDir, modemLogAllDir, android::base::GetIntProperty(DIAG_MDLOG_NUMBER_BUGREPORT, 100), DIAG_LOG_PREFIX);
if (diagLogStarted) {