!180 update: rename LOS_BackTraceInit
Merge pull request !180 from kenneth/BackTraceInit
This commit is contained in:
commit
468ce69f27
|
@ -407,7 +407,7 @@ VOID LOS_BackTrace(VOID)
|
||||||
PRINTK("----- traceback end -----\r\n");
|
PRINTK("----- traceback end -----\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID LOS_BackTraceInit(VOID)
|
VOID OSBackTraceInit(VOID)
|
||||||
{
|
{
|
||||||
OsBackTraceHookSet(LOS_RecordLR);
|
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,
|
/* This function is currently used to register the memory leak check hook,
|
||||||
other uses do not need to be called temporarily. */
|
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. */
|
/* This function is used to print the function call stack. */
|
||||||
VOID LOS_BackTrace(VOID);
|
VOID LOS_BackTrace(VOID);
|
||||||
|
|
|
@ -48,6 +48,7 @@ static_library("kernel") {
|
||||||
"arch/include",
|
"arch/include",
|
||||||
"../components/cpup",
|
"../components/cpup",
|
||||||
"../components/exchook",
|
"../components/exchook",
|
||||||
|
"../components/backtrace",
|
||||||
"../utils",
|
"../utils",
|
||||||
"//third_party/bounds_checking_function/include",
|
"//third_party/bounds_checking_function/include",
|
||||||
]
|
]
|
||||||
|
|
|
@ -459,10 +459,13 @@ extern UINT8 *m_aucSysMem0;
|
||||||
* Configuration memory leak detection
|
* Configuration memory leak detection
|
||||||
* @attention
|
* @attention
|
||||||
* Need to enable backtrace module synchronously by configuration LOSCFG_BACKTRACE_TYPE,
|
* 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
|
#ifndef LOSCFG_MEM_LEAKCHECK
|
||||||
#define LOSCFG_MEM_LEAKCHECK 0
|
#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
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -58,6 +58,10 @@
|
||||||
#include "los_exc_info.h"
|
#include "los_exc_info.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (LOSCFG_BACKTRACE_TYPE != 0)
|
||||||
|
#include "los_backtrace.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
Function : LOS_Reboot
|
Function : LOS_Reboot
|
||||||
|
@ -113,6 +117,10 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_KernelInit(VOID)
|
||||||
UINT32 ret;
|
UINT32 ret;
|
||||||
PRINTK("entering kernel init...\n");
|
PRINTK("entering kernel init...\n");
|
||||||
|
|
||||||
|
#if (LOSCFG_BACKTRACE_TYPE != 0)
|
||||||
|
OSBackTraceInit();
|
||||||
|
#endif
|
||||||
|
|
||||||
OsRegister();
|
OsRegister();
|
||||||
ret = OsMemSystemInit();
|
ret = OsMemSystemInit();
|
||||||
if (ret != LOS_OK) {
|
if (ret != LOS_OK) {
|
||||||
|
|
|
@ -61,7 +61,7 @@ VOID OsBackTraceHookCall(UINTPTR *LR, UINT32 LRSize, UINT32 jumpCount, UINTPTR S
|
||||||
g_backTraceHook(LR, LRSize, jumpCount, SP);
|
g_backTraceHook(LR, LRSize, jumpCount, SP);
|
||||||
} else {
|
} else {
|
||||||
PRINT_ERR("Record LR failed, because of g_backTraceHook is not registered, "
|
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