fix: 临终遗言重定向内容缺失task相关信息,对应的shell命令中申请的内存需要cacheline对齐
1.内核打印的地方支持异常时重定向打印信息 2.excinfo 命令中申请的内存64对齐 Close #I482S5 Signed-off-by: zhushengle <zhushengle@huawei.com> Change-Id: I4e8a971cc5b14f62d573bb160682089d9d50e64e
This commit is contained in:
parent
c7da23695c
commit
48ca854bf0
|
@ -1053,10 +1053,12 @@ STATIC VOID OsCheckAllCpuStatus(VOID)
|
||||||
g_currHandleExcCpuID = currCpuID;
|
g_currHandleExcCpuID = currCpuID;
|
||||||
g_currHandleExcPID = OsCurrProcessGet()->processID;
|
g_currHandleExcPID = OsCurrProcessGet()->processID;
|
||||||
LOS_SpinUnlock(&g_excSerializerSpin);
|
LOS_SpinUnlock(&g_excSerializerSpin);
|
||||||
|
#ifndef LOSCFG_SAVE_EXCINFO
|
||||||
if (g_excFromUserMode[currCpuID] == FALSE) {
|
if (g_excFromUserMode[currCpuID] == FALSE) {
|
||||||
target = (UINT32)(OS_MP_CPU_ALL & ~CPUID_TO_AFFI_MASK(currCpuID));
|
target = (UINT32)(OS_MP_CPU_ALL & ~CPUID_TO_AFFI_MASK(currCpuID));
|
||||||
HalIrqSendIpi(target, LOS_MP_IPI_HALT);
|
HalIrqSendIpi(target, LOS_MP_IPI_HALT);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
} else if (g_excFromUserMode[currCpuID] == TRUE) {
|
} else if (g_excFromUserMode[currCpuID] == TRUE) {
|
||||||
/* Both cores raise exceptions, and the current core is a user-mode exception.
|
/* Both cores raise exceptions, and the current core is a user-mode exception.
|
||||||
* Both cores are abnormal and come from the same process
|
* Both cores are abnormal and come from the same process
|
||||||
|
@ -1081,11 +1083,12 @@ STATIC VOID OsCheckAllCpuStatus(VOID)
|
||||||
while (1) {}
|
while (1) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifndef LOSCFG_SAVE_EXCINFO
|
||||||
/* use halt ipi to stop other active cores */
|
/* use halt ipi to stop other active cores */
|
||||||
if (g_excFromUserMode[ArchCurrCpuid()] == FALSE) {
|
if (g_excFromUserMode[ArchCurrCpuid()] == FALSE) {
|
||||||
WaitAllCpuStop(currCpuID);
|
WaitAllCpuStop(currCpuID);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -170,16 +170,17 @@ VOID OsRecordExcInfoTime(VOID)
|
||||||
#ifdef LOSCFG_SHELL
|
#ifdef LOSCFG_SHELL
|
||||||
INT32 OsShellCmdReadExcInfo(INT32 argc, CHAR **argv)
|
INT32 OsShellCmdReadExcInfo(INT32 argc, CHAR **argv)
|
||||||
{
|
{
|
||||||
|
#define EXCINFO_ALIGN_SIZE 64
|
||||||
UINT32 recordSpace = GetRecordSpace();
|
UINT32 recordSpace = GetRecordSpace();
|
||||||
|
|
||||||
(VOID)argc;
|
(VOID)argc;
|
||||||
(VOID)argv;
|
(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) {
|
if (buf == NULL) {
|
||||||
return LOS_NOK;
|
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();
|
log_read_write_fn hook = GetExcInfoRW();
|
||||||
if (hook != NULL) {
|
if (hook != NULL) {
|
||||||
|
|
|
@ -202,12 +202,22 @@ __attribute__ ((noinline)) VOID dprintf(const CHAR *fmt, ...)
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
OsVprintf(fmt, ap, CONSOLE_OUTPUT);
|
OsVprintf(fmt, ap, CONSOLE_OUTPUT);
|
||||||
|
#ifdef LOSCFG_SAVE_EXCINFO
|
||||||
|
if (OsGetSystemStatus() == OS_SYSTEM_EXC_CURR_CPU) {
|
||||||
|
WriteExcBufVa(fmt, ap);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID LkDprintf(const CHAR *fmt, va_list ap)
|
VOID LkDprintf(const CHAR *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
OsVprintf(fmt, ap, CONSOLE_OUTPUT);
|
OsVprintf(fmt, ap, CONSOLE_OUTPUT);
|
||||||
|
#ifdef LOSCFG_SAVE_EXCINFO
|
||||||
|
if (OsGetSystemStatus() == OS_SYSTEM_EXC_CURR_CPU) {
|
||||||
|
WriteExcBufVa(fmt, ap);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LOSCFG_SHELL_DMESG
|
#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);
|
va_start(ap, fmt);
|
||||||
OsVprintf(fmt, ap, CONSOLE_OUTPUT);
|
OsVprintf(fmt, ap, CONSOLE_OUTPUT);
|
||||||
|
#ifdef LOSCFG_SAVE_EXCINFO
|
||||||
|
if (OsGetSystemStatus() == OS_SYSTEM_EXC_CURR_CPU) {
|
||||||
|
WriteExcBufVa(fmt, ap);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue