redfin: support modem logging on user build

Bug: 143047251
Change-Id: Ifd6f6c779ee0f757b5be11282758d86b78420d3e
This commit is contained in:
Hungyen Weng
2020-02-18 16:11:16 +08:00
committed by Cyan_Hsieh
parent 538ddad31b
commit c779d79569

View File

@@ -155,12 +155,25 @@ void DumpstateDevice::dumpModem(int fd, int fdModem)
RunCommandToFd(fd, "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 (isModemLoggingEnabled()) {
if (isModemLoggingRunning()) {
ALOGD("diag_mdlog is running");
} else {
ALOGD("diag_mdlog is not running");
}
dumpLogs(fd, diagLogDir, modemLogAllDir, android::base::GetIntProperty(DIAG_MDLOG_NUMBER_BUGREPORT, 100), DIAG_LOG_PREFIX);
}
RunCommandToFd(fd, "CP MODEM POWERON LOG", {"/vendor/bin/cp", diagPoweronLogPath.c_str(), modemLogAllDir.c_str()}, CommandOptions::WithTimeout(2).Build());
if (!PropertiesHelper::IsUserBuild()) {
char cmd[256] = { 0 };
android::base::SetProperty(MODEM_EFS_DUMP_PROPERTY, "true");
const std::string diagLogDir = "/data/vendor/radio/diag_logs/logs";
const std::string tcpdumpLogDir = "/data/vendor/tcpdump_logger/logs";
const std::string extendedLogDir = "/data/vendor/radio/extended_logs";
const std::vector <std::string> rilAndNetmgrLogs
@@ -181,7 +194,6 @@ void DumpstateDevice::dumpModem(int fd, int fdModem)
"/data/vendor/radio/power_anomaly_data.txt",
"/data/vendor/radio/diag_logs/diag_trace.txt",
"/data/vendor/radio/diag_logs/diag_trace_old.txt",
"/data/vendor/radio/diag_logs/logs/diag_poweron_log.qmdl",
"/data/vendor/radio/metrics_data",
"/data/vendor/ssrlog/ssr_log.txt",
"/data/vendor/ssrlog/ssr_log_old.txt",
@@ -189,16 +201,6 @@ void DumpstateDevice::dumpModem(int fd, int fdModem)
"/sys/kernel/debug/ipa/ipa_statistics_msg"
};
if (isModemLoggingEnabled()) {
if (isModemLoggingRunning()) {
ALOGD("diag_mdlog is running");
} else {
ALOGD("diag_mdlog is not running");
}
dumpLogs(fd, diagLogDir, modemLogAllDir, android::base::GetIntProperty(DIAG_MDLOG_NUMBER_BUGREPORT, 100), DIAG_LOG_PREFIX);
}
bool tcpdumpEnabled = android::base::GetBoolProperty(TCPDUMP_PERSIST_PROPERTY, false);
if (tcpdumpEnabled) {