1.qlog优化
This commit is contained in:
parent
1ee469df69
commit
ee41d9c0bd
|
@ -78,6 +78,11 @@ SF_THREAD_S ThumbSend = {
|
|||
.TskId = -1,
|
||||
};
|
||||
|
||||
SF_THREAD_S QlogTsk = {
|
||||
.IsRun = 0,
|
||||
.TskId = -1,
|
||||
};
|
||||
|
||||
SINT32 app_ttyusb_IsOpen(void) {
|
||||
int retryTime = 0;
|
||||
int retryFlag = 0;
|
||||
|
@ -147,26 +152,53 @@ SF_BOOL app_disconnect_4g_module(void) {
|
|||
|
||||
#if SF_QLOG_ENABLE
|
||||
static SINT16 app_Qlog_procress(void) {
|
||||
SINT16 s32ret = SF_SUCCESS;
|
||||
SINT16 s32ret = SF_SUCCESS;
|
||||
|
||||
char qlogPath[128] = {0};
|
||||
char qlogDirCmd[128] = {0};
|
||||
time_t timep;
|
||||
struct tm *p;
|
||||
time(&timep);
|
||||
p = gmtime(&timep);
|
||||
if (access("/mnt/sd/qlog", F_OK) != 0) {
|
||||
char qlogPath[128] = {0};
|
||||
char qlogDirCmd[128] = {0};
|
||||
time_t timep;
|
||||
struct tm *p;
|
||||
if(SF_FAILURE == sf_check_sd())
|
||||
{
|
||||
MLOGE("ERROR sf_check_sd\n");
|
||||
return SF_FAILURE;
|
||||
}
|
||||
|
||||
time(&timep);
|
||||
p = gmtime(&timep);
|
||||
if (access("/mnt/sd/qlog", F_OK) != 0) {
|
||||
s32ret = mkdir("/mnt/sd/qlog", S_IRWXU);
|
||||
if (s32ret != 0)
|
||||
return s32ret;
|
||||
}
|
||||
sprintf(qlogPath, "%04d%02d%02d%02d%02d%02d", p->tm_year + 1900,
|
||||
p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec);
|
||||
sprintf(qlogDirCmd, "/usr/bin/QLog -s %s%s &", QLOG_PATH, qlogPath);
|
||||
MLOGD("%s\n", qlogDirCmd);
|
||||
s32ret = system(qlogDirCmd);
|
||||
return s32ret;
|
||||
}
|
||||
sprintf(qlogPath, "%04d%02d%02d%02d%02d%02d", p->tm_year + 1900,
|
||||
p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec);
|
||||
sprintf(qlogDirCmd, "/usr/bin/QLog -s %s%s &", QLOG_PATH, qlogPath);
|
||||
MLOGD("%s\n", qlogDirCmd);
|
||||
s32ret = system(qlogDirCmd);
|
||||
while (sf_app_while_flag())
|
||||
{
|
||||
sf_sleep_ms(200);
|
||||
if (sf_sd_status_get() != SF_SD_OK)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
s32ret = system("killall QLog");
|
||||
QlogTsk.IsRun = 0;
|
||||
MLOGI("exit QlogTsk.IsRun:%d\n", QlogTsk.IsRun);
|
||||
return s32ret;
|
||||
}
|
||||
|
||||
return s32ret;
|
||||
void sf_app_qlog_start(void)
|
||||
{
|
||||
MLOGI("QlogTsk.IsRun:%d\n", QlogTsk.IsRun);
|
||||
if (!QlogTsk.IsRun)
|
||||
{
|
||||
pthread_create(&QlogTsk.TskId, NULL, (void *)app_Qlog_procress, NULL);
|
||||
QlogTsk.IsRun = 1;
|
||||
SF_MUTEX_INIT_LOCK(QlogTsk.mutexLock);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1413,7 +1445,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
|
|||
|
||||
#if SF_QLOG_ENABLE
|
||||
if (pCustomerParam->QLogSwitch == 1)
|
||||
app_Qlog_procress();
|
||||
sf_app_qlog_start();
|
||||
#endif
|
||||
|
||||
s32ret = sf_4G_sim_init(pfnParam);
|
||||
|
@ -1527,7 +1559,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
|
|||
|
||||
#if SF_QLOG_ENABLE
|
||||
if (pCustomerParam->QLogSwitch == 1)
|
||||
app_Qlog_procress();
|
||||
sf_app_qlog_start();
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1584,7 +1616,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
|
|||
|
||||
#if SF_QLOG_ENABLE
|
||||
if (pCustomerParam->QLogSwitch == 1)
|
||||
app_Qlog_procress();
|
||||
sf_app_qlog_start();
|
||||
#endif
|
||||
|
||||
s32ret = sf_4G_sim_init(pfnParam);
|
||||
|
@ -1618,7 +1650,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
|
|||
|
||||
#if SF_QLOG_ENABLE
|
||||
if (pCustomerParam->QLogSwitch == 1)
|
||||
app_Qlog_procress();
|
||||
sf_app_qlog_start();
|
||||
#endif
|
||||
|
||||
s32ret = sf_4G_sim_init(pfnParam);
|
||||
|
@ -1669,7 +1701,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
|
|||
|
||||
#if SF_QLOG_ENABLE
|
||||
if (pCustomerParam->QLogSwitch == 1)
|
||||
app_Qlog_procress();
|
||||
sf_app_qlog_start();
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1809,7 +1841,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
|
|||
|
||||
#if SF_QLOG_ENABLE
|
||||
if (pCustomerParam->QLogSwitch == 1)
|
||||
app_Qlog_procress();
|
||||
sf_app_qlog_start();
|
||||
#endif
|
||||
|
||||
s32ret = sf_4G_sim_init(pfnParam);
|
||||
|
@ -1969,7 +2001,7 @@ SINT32 sf_module_reboot_reg_net(void)
|
|||
|
||||
#if SF_QLOG_ENABLE
|
||||
if (pCustomerParam->QLogSwitch == 1)
|
||||
app_Qlog_procress();
|
||||
sf_app_qlog_start();
|
||||
#endif
|
||||
|
||||
s32ret = sf_4G_sim_init(&stpfncallback);
|
||||
|
|
|
@ -384,7 +384,7 @@ SINT32 sf_sd_loopremove(const char *path)
|
|||
|
||||
SF_SD_STATUS_E sf_sd_status_get(void)
|
||||
{
|
||||
MLOGI("SdStatus:%d\n", SdStatus);
|
||||
//MLOGI("SdStatus:%d\n", SdStatus);
|
||||
return SdStatus;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user