!594 临终遗言重定向内容缺失task相关信息,对应的shell命令中申请的内存需要cacheline对齐
Merge pull request !594 from zhushengle/excinfo
This commit is contained in:
commit
e1b36bfe41
|
@ -1053,10 +1053,12 @@ STATIC VOID OsCheckAllCpuStatus(VOID)
|
|||
g_currHandleExcCpuID = currCpuID;
|
||||
g_currHandleExcPID = OsCurrProcessGet()->processID;
|
||||
LOS_SpinUnlock(&g_excSerializerSpin);
|
||||
#ifndef LOSCFG_SAVE_EXCINFO
|
||||
if (g_excFromUserMode[currCpuID] == FALSE) {
|
||||
target = (UINT32)(OS_MP_CPU_ALL & ~CPUID_TO_AFFI_MASK(currCpuID));
|
||||
HalIrqSendIpi(target, LOS_MP_IPI_HALT);
|
||||
}
|
||||
#endif
|
||||
} else if (g_excFromUserMode[currCpuID] == TRUE) {
|
||||
/* Both cores raise exceptions, and the current core is a user-mode exception.
|
||||
* Both cores are abnormal and come from the same process
|
||||
|
@ -1081,11 +1083,12 @@ STATIC VOID OsCheckAllCpuStatus(VOID)
|
|||
while (1) {}
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef LOSCFG_SAVE_EXCINFO
|
||||
/* use halt ipi to stop other active cores */
|
||||
if (g_excFromUserMode[ArchCurrCpuid()] == FALSE) {
|
||||
WaitAllCpuStop(currCpuID);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -170,16 +170,17 @@ VOID OsRecordExcInfoTime(VOID)
|
|||
#ifdef LOSCFG_SHELL
|
||||
INT32 OsShellCmdReadExcInfo(INT32 argc, CHAR **argv)
|
||||
{
|
||||
#define EXCINFO_ALIGN_SIZE 64
|
||||
UINT32 recordSpace = GetRecordSpace();
|
||||
|
||||
(VOID)argc;
|
||||
(VOID)argv;
|
||||
|
||||
CHAR *buf = (CHAR*)LOS_MemAlloc((void *)OS_SYS_MEM_ADDR, recordSpace + 1);
|
||||
CHAR *buf = (CHAR *)LOS_MemAllocAlign((VOID *)OS_SYS_MEM_ADDR, recordSpace + 1, EXCINFO_ALIGN_SIZE);
|
||||
if (buf == NULL) {
|
||||
return LOS_NOK;
|
||||
}
|
||||
(void)memset_s(buf, recordSpace + 1, 0, recordSpace + 1);
|
||||
(VOID)memset_s(buf, recordSpace + 1, 0, recordSpace + 1);
|
||||
|
||||
log_read_write_fn hook = GetExcInfoRW();
|
||||
if (hook != NULL) {
|
||||
|
|
|
@ -202,12 +202,22 @@ __attribute__ ((noinline)) VOID dprintf(const CHAR *fmt, ...)
|
|||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
OsVprintf(fmt, ap, CONSOLE_OUTPUT);
|
||||
#ifdef LOSCFG_SAVE_EXCINFO
|
||||
if (OsGetSystemStatus() == OS_SYSTEM_EXC_CURR_CPU) {
|
||||
WriteExcBufVa(fmt, ap);
|
||||
}
|
||||
#endif
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
VOID LkDprintf(const CHAR *fmt, va_list ap)
|
||||
{
|
||||
OsVprintf(fmt, ap, CONSOLE_OUTPUT);
|
||||
#ifdef LOSCFG_SAVE_EXCINFO
|
||||
if (OsGetSystemStatus() == OS_SYSTEM_EXC_CURR_CPU) {
|
||||
WriteExcBufVa(fmt, ap);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef LOSCFG_SHELL_DMESG
|
||||
|
@ -273,6 +283,11 @@ VOID LOS_LkPrint(INT32 level, const CHAR *func, INT32 line, const CHAR *fmt, ...
|
|||
|
||||
va_start(ap, fmt);
|
||||
OsVprintf(fmt, ap, CONSOLE_OUTPUT);
|
||||
#ifdef LOSCFG_SAVE_EXCINFO
|
||||
if (OsGetSystemStatus() == OS_SYSTEM_EXC_CURR_CPU) {
|
||||
WriteExcBufVa(fmt, ap);
|
||||
}
|
||||
#endif
|
||||
va_end(ap);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue