!215 [待合并]fix: 清理残留无效的trace代码
Merge pull request !215 from Zhaotianyu/0708trace_delete
This commit is contained in:
commit
73a99977de
|
@ -550,7 +550,7 @@ extern UINT8 *m_aucSysMem0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* =============================================================================
|
/* =============================================================================
|
||||||
CPUP configuration
|
CPUP module configuration
|
||||||
============================================================================= */
|
============================================================================= */
|
||||||
/**
|
/**
|
||||||
* @ingroup los_config
|
* @ingroup los_config
|
||||||
|
@ -567,6 +567,9 @@ extern UINT8 *m_aucSysMem0;
|
||||||
* @ingroup los_config
|
* @ingroup los_config
|
||||||
* Configuration test case to open
|
* Configuration test case to open
|
||||||
*/
|
*/
|
||||||
|
#ifndef LOSCFG_TEST
|
||||||
|
#define LOSCFG_TEST 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_config
|
* @ingroup los_config
|
||||||
|
@ -577,14 +580,10 @@ extern UINT8 *m_aucSysMem0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* =============================================================================
|
/* =============================================================================
|
||||||
trace configuration
|
Fs module configuration
|
||||||
============================================================================= */
|
============================================================================= */
|
||||||
/**
|
#ifndef LOSCFG_SUPPORT_FATFS
|
||||||
* @ingroup los_config
|
#define LOSCFG_SUPPORT_FATFS 0
|
||||||
* Configuration liteos trace
|
|
||||||
*/
|
|
||||||
#ifndef LOSCFG_KERNEL_TRACE
|
|
||||||
#define LOSCFG_KERNEL_TRACE 0
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef LOSCFG_SUPPORT_LITTLEFS
|
#ifndef LOSCFG_SUPPORT_LITTLEFS
|
||||||
|
@ -595,7 +594,9 @@ extern UINT8 *m_aucSysMem0;
|
||||||
#define LOSCFG_LFS_MAX_MOUNT_SIZE 3
|
#define LOSCFG_LFS_MAX_MOUNT_SIZE 3
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* =============================================================================
|
||||||
|
Trace module configuration
|
||||||
|
============================================================================= */
|
||||||
/**
|
/**
|
||||||
* @ingroup los_config
|
* @ingroup los_config
|
||||||
* Configuration trace tool
|
* Configuration trace tool
|
||||||
|
@ -604,6 +605,41 @@ extern UINT8 *m_aucSysMem0;
|
||||||
#define LOSCFG_DEBUG_HOOK 0
|
#define LOSCFG_DEBUG_HOOK 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* =============================================================================
|
||||||
|
PM module configuration
|
||||||
|
============================================================================= */
|
||||||
|
/**
|
||||||
|
* @ingroup los_config
|
||||||
|
* Configuration item for low power frame tailoring
|
||||||
|
*/
|
||||||
|
#ifndef LOSCFG_KERNEL_PM
|
||||||
|
#define LOSCFG_KERNEL_PM 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ingroup los_config
|
||||||
|
* Configuration item for priority of low-power task.
|
||||||
|
*/
|
||||||
|
#ifndef LOSCFG_KERNEL_PM_TASK_PTIORITY
|
||||||
|
#define LOSCFG_KERNEL_PM_TASK_PTIORITY 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ingroup los_config
|
||||||
|
* Configuration item for stack size of low-power task.
|
||||||
|
*/
|
||||||
|
#ifndef LOSCFG_KERNEL_PM_TASK_STACKSIZE
|
||||||
|
#define LOSCFG_KERNEL_PM_TASK_STACKSIZE 0x800
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ingroup los_config
|
||||||
|
* Configuration item for low power frame debug tailoring
|
||||||
|
*/
|
||||||
|
#ifndef LOSCFG_KERNEL_PM_DEBUG
|
||||||
|
#define LOSCFG_KERNEL_PM_DEBUG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/* =============================================================================
|
/* =============================================================================
|
||||||
printf configuration
|
printf configuration
|
||||||
============================================================================= */
|
============================================================================= */
|
||||||
|
@ -639,38 +675,9 @@ extern UINT8 *m_aucSysMem0;
|
||||||
#define LOSCFG_BACKTRACE_DEPTH 15
|
#define LOSCFG_BACKTRACE_DEPTH 15
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/* =============================================================================
|
||||||
* @ingroup los_config
|
trustzone configuration
|
||||||
* Configuration item for low power frame tailoring
|
============================================================================= */
|
||||||
*/
|
|
||||||
#ifndef LOSCFG_KERNEL_PM
|
|
||||||
#define LOSCFG_KERNEL_PM 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup los_config
|
|
||||||
* Configuration item for priority of low-power task.
|
|
||||||
*/
|
|
||||||
#ifndef LOSCFG_KERNEL_PM_TASK_PTIORITY
|
|
||||||
#define LOSCFG_KERNEL_PM_TASK_PTIORITY 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup los_config
|
|
||||||
* Configuration item for stack size of low-power task.
|
|
||||||
*/
|
|
||||||
#ifndef LOSCFG_KERNEL_PM_TASK_STACKSIZE
|
|
||||||
#define LOSCFG_KERNEL_PM_TASK_STACKSIZE 0x800
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup los_config
|
|
||||||
* Configuration item for low power frame debug tailoring
|
|
||||||
*/
|
|
||||||
#ifndef LOSCFG_KERNEL_PM_DEBUG
|
|
||||||
#define LOSCFG_KERNEL_PM_DEBUG 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_config
|
* @ingroup los_config
|
||||||
* Configuration trustzone secure heap size.
|
* Configuration trustzone secure heap size.
|
||||||
|
|
|
@ -42,10 +42,6 @@
|
||||||
#include "los_interrupt.h"
|
#include "los_interrupt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (LOSCFG_KERNEL_TRACE == 1)
|
|
||||||
#include "los_debug.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (LOSCFG_BASE_CORE_SWTMR == 1)
|
#if (LOSCFG_BASE_CORE_SWTMR == 1)
|
||||||
#include "los_swtmr.h"
|
#include "los_swtmr.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -186,14 +182,6 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_KernelInit(VOID)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (LOSCFG_KERNEL_TRACE == 1)
|
|
||||||
ret = LOS_TraceInit();
|
|
||||||
if (ret != LOS_OK) {
|
|
||||||
PRINT_ERR("LOS_TraceInit error\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (LOSCFG_KERNEL_PM == 1)
|
#if (LOSCFG_KERNEL_PM == 1)
|
||||||
ret = OsPmInit();
|
ret = OsPmInit();
|
||||||
if (ret != LOS_OK) {
|
if (ret != LOS_OK) {
|
||||||
|
@ -202,7 +190,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_KernelInit(VOID)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LOSCFG_TEST
|
#if (LOSCFG_TEST == 1)
|
||||||
//ret = los_TestInit();
|
//ret = los_TestInit();
|
||||||
//if (ret != LOS_OK) {
|
//if (ret != LOS_OK) {
|
||||||
// PRINT_ERR("los_TestInit error\n");
|
// PRINT_ERR("los_TestInit error\n");
|
||||||
|
|
|
@ -581,10 +581,6 @@ LITE_OS_SEC_TEXT VOID OsTaskSwitchCheck(VOID)
|
||||||
g_pfnUsrTskSwitchHook();
|
g_pfnUsrTskSwitchHook();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (LOSCFG_KERNEL_TRACE == 1)
|
|
||||||
LOS_Trace(LOS_TRACE_SWITCH, 0);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (LOSCFG_BASE_CORE_CPUP == 1)
|
#if (LOSCFG_BASE_CORE_CPUP == 1)
|
||||||
OsTskCycleEndStart();
|
OsTskCycleEndStart();
|
||||||
#endif /* LOSCFG_BASE_CORE_CPUP */
|
#endif /* LOSCFG_BASE_CORE_CPUP */
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
|
|
||||||
/* Used to cut non-essential functions. */
|
/* Used to cut non-essential functions. */
|
||||||
#define OS_MEM_EXPAND_ENABLE 0
|
#define OS_MEM_EXPAND_ENABLE 0
|
||||||
#define OS_MEM_TRACE 0
|
|
||||||
|
|
||||||
UINT8 *m_aucSysMem0 = NULL;
|
UINT8 *m_aucSysMem0 = NULL;
|
||||||
|
|
||||||
|
@ -906,11 +905,6 @@ UINT32 LOS_MemInit(VOID *pool, UINT32 size)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if OS_MEM_TRACE
|
|
||||||
LOS_TraceReg(LOS_TRACE_MEM_TIME, OsMemTimeTrace, LOS_TRACE_MEM_TIME_NAME, LOS_TRACE_ENABLE);
|
|
||||||
LOS_TraceReg(LOS_TRACE_MEM_INFO, OsMemInfoTrace, LOS_TRACE_MEM_INFO_NAME, LOS_TRACE_ENABLE);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
OsHookCall(LOS_HOOK_TYPE_MEM_INIT, pool, size);
|
OsHookCall(LOS_HOOK_TYPE_MEM_INIT, pool, size);
|
||||||
|
|
||||||
return LOS_OK;
|
return LOS_OK;
|
||||||
|
@ -929,11 +923,6 @@ UINT32 LOS_MemDeInit(VOID *pool)
|
||||||
|
|
||||||
OsMemPoolDeinit(pool);
|
OsMemPoolDeinit(pool);
|
||||||
|
|
||||||
#if OS_MEM_TRACE
|
|
||||||
LOS_TraceUnreg(LOS_TRACE_MEM_TIME);
|
|
||||||
LOS_TraceUnreg(LOS_TRACE_MEM_INFO);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
OsHookCall(LOS_HOOK_TYPE_MEM_DEINIT, pool);
|
OsHookCall(LOS_HOOK_TYPE_MEM_DEINIT, pool);
|
||||||
|
|
||||||
return LOS_OK;
|
return LOS_OK;
|
||||||
|
@ -1003,10 +992,6 @@ retry:
|
||||||
|
|
||||||
VOID *LOS_MemAlloc(VOID *pool, UINT32 size)
|
VOID *LOS_MemAlloc(VOID *pool, UINT32 size)
|
||||||
{
|
{
|
||||||
#if OS_MEM_TRACE
|
|
||||||
UINT64 start = HalClockGetCycles();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((pool == NULL) || (size == 0)) {
|
if ((pool == NULL) || (size == 0)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1028,19 +1013,6 @@ VOID *LOS_MemAlloc(VOID *pool, UINT32 size)
|
||||||
} while (0);
|
} while (0);
|
||||||
MEM_UNLOCK(poolHead, intSave);
|
MEM_UNLOCK(poolHead, intSave);
|
||||||
|
|
||||||
#if OS_MEM_TRACE
|
|
||||||
UINT64 end = HalClockGetCycles();
|
|
||||||
UINT32 timeUsed = MEM_TRACE_CYCLE_TO_US(end - start);
|
|
||||||
LOS_Trace(LOS_TRACE_MEM_TIME, (UINTPTR)pool & MEM_POOL_ADDR_MASK, MEM_TRACE_MALLOC, timeUsed);
|
|
||||||
|
|
||||||
LOS_MEM_POOL_STATUS poolStatus = {0};
|
|
||||||
(VOID)LOS_MemInfoGet(pool, &poolStatus);
|
|
||||||
UINT8 fragment = 100 - poolStatus.maxFreeNodeSize * 100 / poolStatus.totalFreeSize; /* 100: percent denominator. */
|
|
||||||
UINT8 usage = LOS_MemTotalUsedGet(pool) * 100 / LOS_MemPoolSizeGet(pool); /* 100: percent denominator. */
|
|
||||||
LOS_Trace(LOS_TRACE_MEM_INFO, (UINTPTR)pool & MEM_POOL_ADDR_MASK, fragment, usage, poolStatus.totalFreeSize,
|
|
||||||
poolStatus.maxFreeNodeSize, poolStatus.usedNodeNum, poolStatus.freeNodeNum);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
OsHookCall(LOS_HOOK_TYPE_MEM_ALLOC, pool, size);
|
OsHookCall(LOS_HOOK_TYPE_MEM_ALLOC, pool, size);
|
||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
|
@ -1048,10 +1020,6 @@ VOID *LOS_MemAlloc(VOID *pool, UINT32 size)
|
||||||
|
|
||||||
VOID *LOS_MemAllocAlign(VOID *pool, UINT32 size, UINT32 boundary)
|
VOID *LOS_MemAllocAlign(VOID *pool, UINT32 size, UINT32 boundary)
|
||||||
{
|
{
|
||||||
#if OS_MEM_TRACE
|
|
||||||
UINT64 start = HalClockGetCycles();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UINT32 gapSize;
|
UINT32 gapSize;
|
||||||
|
|
||||||
if ((pool == NULL) || (size == 0) || (boundary == 0) || !OS_MEM_IS_POW_TWO(boundary) ||
|
if ((pool == NULL) || (size == 0) || (boundary == 0) || !OS_MEM_IS_POW_TWO(boundary) ||
|
||||||
|
@ -1100,12 +1068,6 @@ VOID *LOS_MemAllocAlign(VOID *pool, UINT32 size, UINT32 boundary)
|
||||||
} while (0);
|
} while (0);
|
||||||
MEM_UNLOCK(poolHead, intSave);
|
MEM_UNLOCK(poolHead, intSave);
|
||||||
|
|
||||||
#if OS_MEM_TRACE
|
|
||||||
UINT64 end = HalClockGetCycles();
|
|
||||||
UINT32 timeUsed = MEM_TRACE_CYCLE_TO_US(end - start);
|
|
||||||
LOS_Trace(LOS_TRACE_MEM_TIME, (UINTPTR)pool & MEM_POOL_ADDR_MASK, MEM_TRACE_MEMALIGN, timeUsed);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
OsHookCall(LOS_HOOK_TYPE_MEM_ALLOCALIGN, pool, size, boundary);
|
OsHookCall(LOS_HOOK_TYPE_MEM_ALLOCALIGN, pool, size, boundary);
|
||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
|
@ -1277,10 +1239,6 @@ STATIC INLINE VOID *OsGetRealPtr(const VOID *pool, VOID *ptr)
|
||||||
|
|
||||||
UINT32 LOS_MemFree(VOID *pool, VOID *ptr)
|
UINT32 LOS_MemFree(VOID *pool, VOID *ptr)
|
||||||
{
|
{
|
||||||
#if OS_MEM_TRACE
|
|
||||||
UINT64 start = HalClockGetCycles();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((pool == NULL) || (ptr == NULL) || !OS_MEM_IS_ALIGNED(pool, sizeof(VOID *)) ||
|
if ((pool == NULL) || (ptr == NULL) || !OS_MEM_IS_ALIGNED(pool, sizeof(VOID *)) ||
|
||||||
!OS_MEM_IS_ALIGNED(ptr, sizeof(VOID *))) {
|
!OS_MEM_IS_ALIGNED(ptr, sizeof(VOID *))) {
|
||||||
return LOS_NOK;
|
return LOS_NOK;
|
||||||
|
@ -1304,12 +1262,6 @@ UINT32 LOS_MemFree(VOID *pool, VOID *ptr)
|
||||||
} while (0);
|
} while (0);
|
||||||
MEM_UNLOCK(poolHead, intSave);
|
MEM_UNLOCK(poolHead, intSave);
|
||||||
|
|
||||||
#if OS_MEM_TRACE
|
|
||||||
UINT64 end = HalClockGetCycles();
|
|
||||||
UINT32 timeUsed = MEM_TRACE_CYCLE_TO_US(end - start);
|
|
||||||
LOS_Trace(LOS_TRACE_MEM_TIME, (UINTPTR)pool & MEM_POOL_ADDR_MASK, MEM_TRACE_FREE, timeUsed);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1382,10 +1334,6 @@ STATIC INLINE VOID *OsMemRealloc(struct OsMemPoolHead *pool, const VOID *ptr,
|
||||||
|
|
||||||
VOID *LOS_MemRealloc(VOID *pool, VOID *ptr, UINT32 size)
|
VOID *LOS_MemRealloc(VOID *pool, VOID *ptr, UINT32 size)
|
||||||
{
|
{
|
||||||
#if OS_MEM_TRACE
|
|
||||||
UINT64 start = HalClockGetCycles();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((pool == NULL) || OS_MEM_NODE_GET_USED_FLAG(size) || OS_MEM_NODE_GET_ALIGNED_FLAG(size)) {
|
if ((pool == NULL) || OS_MEM_NODE_GET_USED_FLAG(size) || OS_MEM_NODE_GET_ALIGNED_FLAG(size)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1426,12 +1374,6 @@ VOID *LOS_MemRealloc(VOID *pool, VOID *ptr, UINT32 size)
|
||||||
} while (0);
|
} while (0);
|
||||||
MEM_UNLOCK(poolHead, intSave);
|
MEM_UNLOCK(poolHead, intSave);
|
||||||
|
|
||||||
#if OS_MEM_TRACE
|
|
||||||
UINT64 end = HalClockGetCycles();
|
|
||||||
UINT32 timeUsed = MEM_TRACE_CYCLE_TO_US(end - start);
|
|
||||||
LOS_Trace(LOS_TRACE_MEM_TIME, (UINTPTR)pool & MEM_POOL_ADDR_MASK, MEM_TRACE_REALLOC, timeUsed);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return newPtr;
|
return newPtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -169,200 +169,6 @@ typedef VOID (*BACK_TRACE_HOOK)(UINTPTR *LR, UINT32 LRSize, UINT32 jumpCount, UI
|
||||||
extern VOID OsBackTraceHookSet(BACK_TRACE_HOOK hook);
|
extern VOID OsBackTraceHookSet(BACK_TRACE_HOOK hook);
|
||||||
extern VOID OsBackTraceHookCall(UINTPTR *LR, UINT32 LRSize, UINT32 jumpCount, UINTPTR SP);
|
extern VOID OsBackTraceHookCall(UINTPTR *LR, UINT32 LRSize, UINT32 jumpCount, UINTPTR SP);
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup los_trace
|
|
||||||
* Task error code: Insufficient memory for trace struct.
|
|
||||||
*
|
|
||||||
* Value: 0x02001400
|
|
||||||
*
|
|
||||||
* Solution: Decrease the maximum number of tasks.
|
|
||||||
*/
|
|
||||||
#define LOS_ERRNO_TRACE_NO_MEMORY LOS_ERRNO_OS_ERROR(LOS_MOD_TRACE, 0x00)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup los_trace
|
|
||||||
* Task error code: User type is invalid when register new trace.
|
|
||||||
*
|
|
||||||
* Value: 0x02001401
|
|
||||||
*
|
|
||||||
* Solution: Use valid type to register the new trace.
|
|
||||||
*/
|
|
||||||
#define LOS_ERRNO_TRACE_TYPE_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_TRACE, 0x01)
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup los_trace
|
|
||||||
* Task error code: The callback function is null when register new trace.
|
|
||||||
*
|
|
||||||
* Value: 0x02001402
|
|
||||||
*
|
|
||||||
* Solution: Use valid callback function to register the new trace.
|
|
||||||
*/
|
|
||||||
#define LOS_ERRNO_TRACE_FUNCTION_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_TRACE, 0x02)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup los_trace
|
|
||||||
* Task error code: The filled size is 0 when register new trace.
|
|
||||||
*
|
|
||||||
* Value: 0x02001403
|
|
||||||
*
|
|
||||||
* Solution: Use valid filled size to register the new trace.
|
|
||||||
*/
|
|
||||||
#define LOS_ERRNO_TRACE_MAX_SIZE_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_TRACE, 0x03)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup los_trace
|
|
||||||
* It's the total size of trace buffer. It's in the unit of char
|
|
||||||
*/
|
|
||||||
#define LOS_TRACE_BUFFER_SIZE 1024
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup los_trace
|
|
||||||
* It's the length of tag, filled by los_trace system
|
|
||||||
*/
|
|
||||||
#define LOS_TRACE_TAG_LENGTH sizeof(UINT32)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup los_trace
|
|
||||||
* Stands for the trace type can be registered.
|
|
||||||
*/
|
|
||||||
typedef enum enTraceType {
|
|
||||||
LOS_TRACE_SWITCH = 0, /**< trace for task switch, 0 is reserved for taskswitch */
|
|
||||||
LOS_TRACE_INTERRUPT = 1, /**< trace for Interrupt, 1 is reserved for interrupt */
|
|
||||||
LOS_TRACE_TYPE_NUM = 10, /**< num for the register type, user can use 2~ LOS_TRACE_TYPE_NUM-1 */
|
|
||||||
} TRACE_TYPE_E;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup los_trace
|
|
||||||
* struct to store the task switch infomation
|
|
||||||
*/
|
|
||||||
typedef struct tagTraceTaskSwitch {
|
|
||||||
UINT8 ucSrcTaskId; /**< source taskId */
|
|
||||||
UINT8 ucDestTaskId; /**< destination taskId */
|
|
||||||
UINT32 uwSwitchTick; /**< Time at which the task switch happens */
|
|
||||||
} TRACE_TASKSWITCH_S;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup los_trace
|
|
||||||
* struct to store the interrupt infomation
|
|
||||||
*/
|
|
||||||
typedef struct tagTraceInterrupt {
|
|
||||||
UINT8 ucIRQEntryExit; /**< 1 stands for that the trace is happend before interrupt function */
|
|
||||||
/**< 0 stands for that the trace is after before interrupt function */
|
|
||||||
UINT16 usIRQNo; /**< IRQ number which trigger the interrupt */
|
|
||||||
UINT32 uwTick; /**< Time at which the the trace is called */
|
|
||||||
} TRACE_INTERRUPT_S;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup los_trace
|
|
||||||
* union struct to store the interrupt and task switch infomation
|
|
||||||
*/
|
|
||||||
typedef struct tagTrace {
|
|
||||||
union {
|
|
||||||
TRACE_TASKSWITCH_S stTraceTask; /**< It used for trace the task */
|
|
||||||
TRACE_INTERRUPT_S stTraceInterrupt; /**< It used for trace the interrupt */
|
|
||||||
};
|
|
||||||
} TRACE_S;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup los_trace
|
|
||||||
* Main struct to store the interrupt and task switch infomation
|
|
||||||
*/
|
|
||||||
typedef struct tagTraceBuffer {
|
|
||||||
UINT16 usTracePos;
|
|
||||||
UINT16 usTraceWrapPos;
|
|
||||||
UINT8 ucBuffer[LOS_TRACE_BUFFER_SIZE];
|
|
||||||
} TRACE_BUFFER_S;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup los_trace
|
|
||||||
* Struct to store the trace information for each trace type
|
|
||||||
*/
|
|
||||||
typedef struct tagTraceInfo {
|
|
||||||
TRACE_TYPE_E eType; /**< trace type, selected from TRACE_TYPE_E */
|
|
||||||
UINT16 (*pfnHook)(UINT8 *outBuffer, VOID *pInfo); /**< callback function for the specific trace type.
|
|
||||||
* This function is used to store the infomation
|
|
||||||
* which want to be traced */
|
|
||||||
} TRACE_INFO_S;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup los_trace
|
|
||||||
* @brief Initialize the trace when the system startup.
|
|
||||||
*
|
|
||||||
* @par Description:
|
|
||||||
* This API is used to initialize the trace for system level.
|
|
||||||
* @attention
|
|
||||||
* <ul>
|
|
||||||
* <li>This API can be called only after the memory is initialized. Otherwise, the CPU usage fails to be obtained.</li>
|
|
||||||
* </ul>
|
|
||||||
*
|
|
||||||
* @param None.
|
|
||||||
*
|
|
||||||
* @retval #LOS_ERRNO_TRACE_NO_MEMORY 0x02001400: The memory is not enough for initialization.
|
|
||||||
* @retval #LOS_OK 0x00000000: The initialization is successful.
|
|
||||||
* @par Dependency:
|
|
||||||
* <ul><li>los_trace.h: the header file that contains the API declaration.</li></ul>
|
|
||||||
* @see LOS_TraceInit
|
|
||||||
*/
|
|
||||||
extern UINT32 LOS_TraceInit(VOID);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup los_trace
|
|
||||||
* @brief main trace function is called by user to logger the information.
|
|
||||||
*
|
|
||||||
* @par Description:
|
|
||||||
* This API is used to trace the infomation.
|
|
||||||
* @attention
|
|
||||||
* <ul>
|
|
||||||
* <li>This API can be called only after trace type is intialized. Otherwise, the trace will be failed.</li>
|
|
||||||
* </ul>
|
|
||||||
*
|
|
||||||
* @param traceType [IN] TRACE_TYPE_E. Type of trace information.
|
|
||||||
* @param traceInfo [IN] VOID*. It's a input buffer to store trace infomation
|
|
||||||
*
|
|
||||||
* @retval NONE.
|
|
||||||
*
|
|
||||||
* @par Dependency:
|
|
||||||
* <ul><li>los_trace.h: the header file that contains the API declaration.</li></ul>
|
|
||||||
* @see LOS_Trace
|
|
||||||
*/
|
|
||||||
extern VOID LOS_Trace(TRACE_TYPE_E traceType, VOID *traceInfo);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup los_trace
|
|
||||||
* @brief register the hook for specific trace type.
|
|
||||||
*
|
|
||||||
* @par Description:
|
|
||||||
* This API is used to register the hook for specific trace type.
|
|
||||||
* @attention
|
|
||||||
* <ul>
|
|
||||||
* <li>This API can be called only after trace type is called. therwise, the trace will be failed.</li>
|
|
||||||
* </ul>
|
|
||||||
*
|
|
||||||
* @param traceType [IN] TRACE_TYPE_E. Type of trace information.
|
|
||||||
* @param hook [IN] UINT16 (*)(UINT8*, VOID*). It's an callback function to store the useful trace
|
|
||||||
* information
|
|
||||||
* @param size [IN] UINT16. The maximum size the trace will use for the specific trace type.
|
|
||||||
*
|
|
||||||
* @retval #LOS_ERRNO_TRACE_NO_MEMORY 0x02001400: The memory is not enough for initialization.
|
|
||||||
* @retval #LOS_ERRNO_TRACE_TYPE_INVALID 0x02001401: The trace type is invalid. Valid type is from
|
|
||||||
* LOS_TRACE_TYPE_NUM-1
|
|
||||||
* @retval #LOS_ERRNO_TRACE_FUNCTION_NULL 0x02001402: The input callback function is NULL
|
|
||||||
* @retval #LOS_ERRNO_TRACE_MAX_SIZE_INVALID 0x02001403: The information maxmum size is 0 to store.
|
|
||||||
* @retval #LOS_OK 0x00000000: The register is successful.
|
|
||||||
*
|
|
||||||
* @par Dependency:
|
|
||||||
* <ul><li>los_trace.h: the header file that contains the API declaration.</li></ul>
|
|
||||||
* @see LOS_TraceUserReg
|
|
||||||
*/
|
|
||||||
extern UINT32 LOS_TraceUserReg(TRACE_TYPE_E traceType, UINT16 (*hook)(UINT8 *, VOID *), UINT16 size);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#if __cplusplus
|
#if __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,13 +193,8 @@ enum LOS_MODULE_ID {
|
||||||
LOS_MOD_MPU = 0x12,
|
LOS_MOD_MPU = 0x12,
|
||||||
LOS_MOD_NMHWI = 0x13,
|
LOS_MOD_NMHWI = 0x13,
|
||||||
LOS_MOD_TRACE = 0x14,
|
LOS_MOD_TRACE = 0x14,
|
||||||
LOS_MOD_KNLSTAT = 0x15,
|
|
||||||
LOS_MOD_EVTTIME = 0x16,
|
|
||||||
LOS_MOD_THRDCPUP = 0x17,
|
|
||||||
LOS_MOD_IPC = 0x18,
|
LOS_MOD_IPC = 0x18,
|
||||||
LOS_MOD_STKMON = 0x19,
|
|
||||||
LOS_MOD_TIMER = 0x1a,
|
LOS_MOD_TIMER = 0x1a,
|
||||||
LOS_MOD_RESLEAKMON = 0x1b,
|
|
||||||
LOS_MOD_EVENT = 0x1c,
|
LOS_MOD_EVENT = 0x1c,
|
||||||
LOS_MOD_MUX = 0X1d,
|
LOS_MOD_MUX = 0X1d,
|
||||||
LOS_MOD_CPUP = 0x1e,
|
LOS_MOD_CPUP = 0x1e,
|
||||||
|
|
Loading…
Reference in New Issue