提交 d3b61888 编写于 作者: O openharmony_ci 提交者: Gitee

!660 fix: 优化trace buffer初始化,删除swtmr 桩中的无效参数

Merge pull request !660 from LiteOS/master
...@@ -211,7 +211,7 @@ STATIC VOID LOS_TraceSwtmrExpired(const SWTMR_CTRL_S *swtmr) ...@@ -211,7 +211,7 @@ STATIC VOID LOS_TraceSwtmrExpired(const SWTMR_CTRL_S *swtmr)
STATIC VOID LOS_TraceSwtmrStart(const SWTMR_CTRL_S *swtmr) STATIC VOID LOS_TraceSwtmrStart(const SWTMR_CTRL_S *swtmr)
{ {
LOS_TRACE(SWTMR_START, swtmr->usTimerID, swtmr->ucMode, swtmr->uwCount, swtmr->uwInterval, 0); LOS_TRACE(SWTMR_START, swtmr->usTimerID, swtmr->ucMode, swtmr->uwInterval);
} }
STATIC VOID LOS_TraceSwtmrStop(const SWTMR_CTRL_S *swtmr) STATIC VOID LOS_TraceSwtmrStop(const SWTMR_CTRL_S *swtmr)
......
...@@ -265,10 +265,15 @@ STATIC UINT32 OsTraceInit(VOID) ...@@ -265,10 +265,15 @@ STATIC UINT32 OsTraceInit(VOID)
} }
#endif #endif
#ifdef LOSCFG_RECORDER_MODE_OFFLINE
ret = OsTraceBufInit(LOSCFG_TRACE_BUFFER_SIZE); ret = OsTraceBufInit(LOSCFG_TRACE_BUFFER_SIZE);
if (ret != LOS_OK) { if (ret != LOS_OK) {
goto LOS_RELEASE; #ifdef LOSCFG_TRACE_CONTROL_AGENT
(VOID)LOS_TaskDelete(g_traceTaskId);
#endif
goto LOS_ERREND;
} }
#endif
OsTraceHookInstall(); OsTraceHookInstall();
OsTraceCnvInit(); OsTraceCnvInit();
...@@ -283,10 +288,6 @@ STATIC UINT32 OsTraceInit(VOID) ...@@ -283,10 +288,6 @@ STATIC UINT32 OsTraceInit(VOID)
g_traceState = TRACE_STARTED; g_traceState = TRACE_STARTED;
#endif #endif
return LOS_OK; return LOS_OK;
LOS_RELEASE:
#ifdef LOSCFG_TRACE_CONTROL_AGENT
LOS_TaskDelete(g_traceTaskId);
#endif
LOS_ERREND: LOS_ERREND:
return ret; return ret;
} }
......
...@@ -120,7 +120,6 @@ typedef struct { ...@@ -120,7 +120,6 @@ typedef struct {
extern UINT32 OsTraceGetMaskTid(UINT32 taskId); extern UINT32 OsTraceGetMaskTid(UINT32 taskId);
extern VOID OsTraceSetObj(ObjData *obj, const LosTaskCB *tcb); extern VOID OsTraceSetObj(ObjData *obj, const LosTaskCB *tcb);
extern VOID OsTraceWriteOrSendEvent(const TraceEventFrame *frame); extern VOID OsTraceWriteOrSendEvent(const TraceEventFrame *frame);
extern UINT32 OsTraceBufInit(UINT32 size);
extern VOID OsTraceObjAdd(UINT32 eventType, UINT32 taskId); extern VOID OsTraceObjAdd(UINT32 eventType, UINT32 taskId);
extern BOOL OsTraceIsEnable(VOID); extern BOOL OsTraceIsEnable(VOID);
extern OfflineHead *OsTraceRecordGet(VOID); extern OfflineHead *OsTraceRecordGet(VOID);
...@@ -143,6 +142,7 @@ extern VOID OsTraceSendNotify(UINT32 type, UINT32 value); ...@@ -143,6 +142,7 @@ extern VOID OsTraceSendNotify(UINT32 type, UINT32 value);
#define OsTraceReset() #define OsTraceReset()
#define OsTraceRecordDump(toClient) #define OsTraceRecordDump(toClient)
#else #else
extern UINT32 OsTraceBufInit(UINT32 size);
extern VOID OsTraceReset(VOID); extern VOID OsTraceReset(VOID);
extern VOID OsTraceRecordDump(BOOL toClient); extern VOID OsTraceRecordDump(BOOL toClient);
#define OsTraceNotifyStart() #define OsTraceNotifyStart()
......
...@@ -37,12 +37,6 @@ UINT32 OsTraceGetMaskTid(UINT32 taskId) ...@@ -37,12 +37,6 @@ UINT32 OsTraceGetMaskTid(UINT32 taskId)
return taskId; return taskId;
} }
UINT32 OsTraceBufInit(UINT32 size)
{
(VOID)size;
return LOS_OK;
}
VOID OsTraceSendHead(VOID) VOID OsTraceSendHead(VOID)
{ {
TraceBaseHeaderInfo head = { TraceBaseHeaderInfo head = {
......
...@@ -347,7 +347,7 @@ extern TRACE_EVENT_HOOK g_traceEventHook; ...@@ -347,7 +347,7 @@ extern TRACE_EVENT_HOOK g_traceEventHook;
#define TASK_RESUME_PARAMS(taskId, taskStatus, prio) taskId, taskStatus, prio #define TASK_RESUME_PARAMS(taskId, taskStatus, prio) taskId, taskStatus, prio
#define TASK_SIGNAL_PARAMS(taskId, signal, schedFlag) // taskId, signal, schedFlag #define TASK_SIGNAL_PARAMS(taskId, signal, schedFlag) // taskId, signal, schedFlag
#define SWTMR_START_PARAMS(swtmrId, mode, overrun, interval, expiry) swtmrId, mode, overrun, interval, expiry #define SWTMR_START_PARAMS(swtmrId, mode, interval) swtmrId, mode, interval
#define SWTMR_DELETE_PARAMS(swtmrId) swtmrId #define SWTMR_DELETE_PARAMS(swtmrId) swtmrId
#define SWTMR_EXPIRED_PARAMS(swtmrId) swtmrId #define SWTMR_EXPIRED_PARAMS(swtmrId) swtmrId
#define SWTMR_STOP_PARAMS(swtmrId) swtmrId #define SWTMR_STOP_PARAMS(swtmrId) swtmrId
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册