update: rename LOS_BackTraceInit
change function name LOS_BackTraceInit and involve it in los_init.c when macro is not set to 0 close https://gitee.com/openharmony/kernel_liteos_m/issues/I3SYQQ Signed-off-by: kenneth <459864689@qq.com>
This commit is contained in:
parent
749bd8a481
commit
a0a32188ff
|
@ -407,7 +407,7 @@ VOID LOS_BackTrace(VOID)
|
|||
PRINTK("----- traceback end -----\r\n");
|
||||
}
|
||||
|
||||
VOID LOS_BackTraceInit(VOID)
|
||||
VOID OSBackTraceInit(VOID)
|
||||
{
|
||||
OsBackTraceHookSet(LOS_RecordLR);
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ STATIC INLINE BOOL OsStackDataIsCodeAddr(UINTPTR value)
|
|||
|
||||
/* This function is currently used to register the memory leak check hook,
|
||||
other uses do not need to be called temporarily. */
|
||||
VOID LOS_BackTraceInit(VOID);
|
||||
VOID OSBackTraceInit(VOID);
|
||||
|
||||
/* This function is used to print the function call stack. */
|
||||
VOID LOS_BackTrace(VOID);
|
||||
|
|
|
@ -48,6 +48,7 @@ static_library("kernel") {
|
|||
"arch/include",
|
||||
"../components/cpup",
|
||||
"../components/exchook",
|
||||
"../components/backtrace",
|
||||
"../utils",
|
||||
"//third_party/bounds_checking_function/include",
|
||||
]
|
||||
|
|
|
@ -459,10 +459,13 @@ extern UINT8 *m_aucSysMem0;
|
|||
* Configuration memory leak detection
|
||||
* @attention
|
||||
* Need to enable backtrace module synchronously by configuration LOSCFG_BACKTRACE_TYPE,
|
||||
* and call LOS_BackTraceInit to complete initialization before the memory pool is initialized.
|
||||
* and call OSBackTraceInit to complete initialization before the memory pool is initialized.
|
||||
*/
|
||||
#ifndef LOSCFG_MEM_LEAKCHECK
|
||||
#define LOSCFG_MEM_LEAKCHECK 0
|
||||
#if (LOSCFG_BACKTRACE_TYPE == 0)
|
||||
#error "Backtrace module should be enabled by setting LOSCFG_BACKTRACE_TYPE to not 0 in target_config.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
@ -58,6 +58,10 @@
|
|||
#include "los_exc_info.h"
|
||||
#endif
|
||||
|
||||
#if (LOSCFG_BACKTRACE_TYPE != 0)
|
||||
#include "los_backtrace.h"
|
||||
#endif
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
Function : LOS_Reboot
|
||||
|
@ -113,6 +117,10 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_KernelInit(VOID)
|
|||
UINT32 ret;
|
||||
PRINTK("entering kernel init...\n");
|
||||
|
||||
#if (LOSCFG_BACKTRACE_TYPE != 0)
|
||||
OSBackTraceInit();
|
||||
#endif
|
||||
|
||||
OsRegister();
|
||||
ret = OsMemSystemInit();
|
||||
if (ret != LOS_OK) {
|
||||
|
|
|
@ -61,7 +61,7 @@ VOID OsBackTraceHookCall(UINTPTR *LR, UINT32 LRSize, UINT32 jumpCount, UINTPTR S
|
|||
g_backTraceHook(LR, LRSize, jumpCount, SP);
|
||||
} else {
|
||||
PRINT_ERR("Record LR failed, because of g_backTraceHook is not registered, "
|
||||
"should call LOS_BackTraceInit firstly\n");
|
||||
"should call OSBackTraceInit firstly\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue