fixed New Feature#1093#

1. modify ospLog.c
2. naming rule: coreId_index_msgtype.log
3. testcase:
   3.1 spu(case34)+arm(case5): pass
   3.2 spu(case44)+arm(case5): pass
   3.3 spu(case21)+arm(case21):pass
   3.4 spu(case14)+arm(case3): pass
This commit is contained in:
lishuang.xie 2023-09-27 18:21:49 +08:00
parent 49f94d96b6
commit 933b3d6c34

View File

@ -242,7 +242,9 @@ OSP_STATUS osp_update_log(uint32_t len, uint32_t logid, uint32_t msg_type)
file_idx = p_log_file_cfg[logid][type].cur_file_idx & 0x7;
if(p_log_file_cfg[logid][type].cur_file_idx >= p_log_file_cfg[logid][type].max_file_num)
{
sprintf(name, "rm -rf %s%u-%u-%s.log", p_log_file_cfg[logid][type].logname, file_idx, logid, msg_name);
/* naming rule: coreid-index-type.log */
sprintf(name, "rm -rf %s%u-%u-%s.log", p_log_file_cfg[logid][type].logname, logid, file_idx, msg_name);
//sprintf(name, "rm -rf %s%u-%u-%s.log", p_log_file_cfg[logid][type].logname, file_idx, logid, msg_name);
//sprintf(name, "%s-%d-%s-%u-%u-%s.log", p_log_file_cfg[logid][type].logname, getpid(), g_time_now, p_log_file_cfg[logid][type].cur_file_idx, logid, msg_name);
system(name);
UCP_PRINT_LOG("osp_update_log line:%d logid:%d type:0x%x remove name:%s\n", __LINE__, logid, type, name);
@ -264,7 +266,8 @@ OSP_STATUS osp_update_log(uint32_t len, uint32_t logid, uint32_t msg_type)
osp_mkdirs(path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
}
sprintf(name, "%s%u-%u-%s.log", p_log_file_cfg[logid][type].logname, file_idx, logid, msg_name);
/* naming rule: coreid-index-type.log */
sprintf(name, "%s%u-%u-%s.log", p_log_file_cfg[logid][type].logname, logid, file_idx, msg_name);
//sprintf(name, "%s-%d-%s-%u-%u-%s.log", p_log_file_cfg[logid][type].logname, getpid(), g_time_now, p_log_file_cfg[logid][type].cur_file_idx, logid, msg_name);
UCP_PRINT_LOG("osp_update_log line:%d logid:%d type:0x%x name:%s\n", __LINE__, logid, type, name);
@ -302,7 +305,9 @@ OSP_STATUS osp_update_log(uint32_t len, uint32_t logid, uint32_t msg_type)
osp_mkdirs(path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
}
sprintf(name, "%s%u-%u-%s.log", p_log_file_cfg[logid][type].logname, p_log_file_cfg[logid][type].cur_file_idx, logid, msg_name);
/* naming rule: coreid-index-type.log */
sprintf(name, "%s%u-%u-%s.log", p_log_file_cfg[logid][type].logname, logid, p_log_file_cfg[logid][type].cur_file_idx, msg_name);
//sprintf(name, "%s%u-%u-%s.log", p_log_file_cfg[logid][type].logname, p_log_file_cfg[logid][type].cur_file_idx, logid, msg_name);
//sprintf(name, "%s-%d-%s-%u-%u-%s.log", p_log_file_cfg[logid][type].logname, getpid(), g_time_now, p_log_file_cfg[logid][type].cur_file_idx, logid, msg_name);
UCP_PRINT_LOG("osp_update_log line:%d logid:%d type:0x%x name:%s\n", __LINE__, logid, type, name);