Compare commits
8 Commits
weekly_202
...
weekly_202
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5df101eae5 | ||
|
|
128c3dffb5 | ||
|
|
e8f3f9674c | ||
|
|
5cfec18d24 | ||
|
|
def41f8edd | ||
|
|
6881d3da46 | ||
|
|
e21e8753d1 | ||
|
|
397f24dd6f |
5
Kconfig
5
Kconfig
@@ -597,6 +597,11 @@ config VM_OVERLAP_CHECK
|
||||
depends on DEBUG_VERSION && MEM_DEBUG
|
||||
help
|
||||
Answer Y to enable vm overlap check.
|
||||
|
||||
config TASK_MEM_USED
|
||||
bool "Enable show task mem used or not"
|
||||
default n
|
||||
depends on DEBUG_VERSION && MEM_DEBUG
|
||||
|
||||
endmenu
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ STATIC VOID ShellCmdHwiInfoShow(OsIrqCpupCB *irqData, CPUP_INFO_S *hwiCpup1s,
|
||||
}
|
||||
irqName = OsGetHwiFormName(i);
|
||||
|
||||
PRINTK(" %10u:%11u%11llu%10llu%9u.%-2u%9u.%-2u %-12s\n", i - OS_SYS_VECTOR_CNT, count, cycles, timeMax,
|
||||
PRINTK(" %10d:%11u%11llu%10llu%9u.%-2u%9u.%-2u %-12s\n", i - OS_SYS_VECTOR_CNT, count, cycles, timeMax,
|
||||
hwiCpup1s[i].uwUsage / CPUP_PRECISION_MULT, hwiCpup1s[i].uwUsage % CPUP_PRECISION_MULT,
|
||||
hwiCpup10s[i].uwUsage / CPUP_PRECISION_MULT, hwiCpup10s[i].uwUsage % CPUP_PRECISION_MULT,
|
||||
(irqName != NULL) ? irqName : NULL);
|
||||
|
||||
@@ -126,8 +126,10 @@ VOID LOS_SchedTraceStop(VOID)
|
||||
ShowFormat(g_traceRingBuf, g_schedCount);
|
||||
g_schedCount = 0;
|
||||
|
||||
(VOID)LOS_MemFree(OS_SYS_MEM_ADDR, g_traceRingBuf);
|
||||
g_traceRingBuf = NULL;
|
||||
if (g_traceRingBuf != NULL) {
|
||||
(VOID)LOS_MemFree(OS_SYS_MEM_ADDR, g_traceRingBuf);
|
||||
g_traceRingBuf = NULL;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "los_compiler.h"
|
||||
|
||||
/* Using task extended field to realize IAR TLS function in target_config.h include this header file. */
|
||||
#define LOSCFG_TASK_STRUCT_EXTENSION VOID *iarTlsArea;
|
||||
#define LOSCFG_TASK_STRUCT_EXTENSION VOID *iarTlsArea
|
||||
|
||||
#if (__VER__ < 8000000)
|
||||
#include <yvals.h>
|
||||
|
||||
@@ -94,6 +94,7 @@ extern INT32 VfsNormalizePath(const CHAR *directory, const CHAR *filename, CHAR
|
||||
extern INT32 OsShellCmdDate(INT32 argc, const CHAR **argv);
|
||||
extern INT32 OsShellCmdDumpTask(INT32 argc, const CHAR **argv);
|
||||
extern UINT32 OsShellCmdFree(INT32 argc, const CHAR **argv);
|
||||
extern UINT32 OsShellCmdWaterLine(INT32 argc, const CHAR **argv);
|
||||
extern UINT32 lwip_ifconfig(INT32 argc, const CHAR **argv);
|
||||
extern UINT32 OsShellPing(INT32 argc, const CHAR **argv);
|
||||
extern INT32 OsShellCmdTouch(INT32 argc, const CHAR **argv);
|
||||
|
||||
@@ -51,6 +51,9 @@ CmdItem g_shellcmdAll[] = {
|
||||
{CMD_TYPE_STD, "date", XARGS, (CmdCallBackFunc)OsShellCmdDate},
|
||||
{CMD_TYPE_EX, "task", 1, (CmdCallBackFunc)OsShellCmdDumpTask},
|
||||
{CMD_TYPE_EX, "free", XARGS, (CmdCallBackFunc)OsShellCmdFree},
|
||||
#if (LOSCFG_MEM_WATERLINE == 1)
|
||||
{CMD_TYPE_EX, "memusage", XARGS, (CmdCallBackFunc)OsShellCmdWaterLine},
|
||||
#endif
|
||||
#ifdef LWIP_SHELLCMD_ENABLE
|
||||
{CMD_TYPE_EX, "ifconfig", XARGS, (CmdCallBackFunc)lwip_ifconfig},
|
||||
{CMD_TYPE_EX, "ping", XARGS, (CmdCallBackFunc)OsShellPing},
|
||||
|
||||
@@ -79,3 +79,32 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdFree(INT32 argc, const CHAR *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if (LOSCFG_MEM_WATERLINE == 1)
|
||||
LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdWaterLine(INT32 argc, const CHAR *argv[])
|
||||
{
|
||||
UINT32 ret;
|
||||
LOS_MEM_POOL_STATUS poolStatus;
|
||||
|
||||
if (argc > 1) {
|
||||
PRINTK("\nUsage: memusage or memusage [-k/-m]\n");
|
||||
return OS_ERROR;
|
||||
}
|
||||
|
||||
if (LOS_MemInfoGet(m_aucSysMem0, &poolStatus) != LOS_OK) {
|
||||
return OS_ERROR;
|
||||
}
|
||||
|
||||
if ((argc == 1) && (strcmp(argv[0], "-k") == 0)) {
|
||||
PRINTK("Mem WaterLine: %-9u\n", MEM_SIZE_TO_KB(poolStatus.usageWaterLine));
|
||||
} else if ((argc == 1) && (strcmp(argv[0], "-m") == 0)) {
|
||||
PRINTK("Mem WaterLine: %-9u\n", MEM_SIZE_TO_MB(poolStatus.usageWaterLine));
|
||||
} else if (argc == 0) {
|
||||
PRINTK("Mem WaterLine: %-9u\n", poolStatus.usageWaterLine);
|
||||
} else {
|
||||
PRINTK("\nUsage: memusage or memusage [-k/-m]\n");
|
||||
return OS_ERROR;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -638,10 +638,8 @@ extern UINT8 *m_aucSysMem0;
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* Task extension field additional functions, such as IAR TLS.
|
||||
* Please Use the LOSCFG_TASK_STRUCT_EXTENSION macro to define your task extended fields in target_config.h
|
||||
*/
|
||||
#ifndef LOSCFG_TASK_STRUCT_EXTENSION
|
||||
#define LOSCFG_TASK_STRUCT_EXTENSION
|
||||
#endif
|
||||
#ifndef LOSCFG_TASK_CREATE_EXTENSION_HOOK
|
||||
#define LOSCFG_TASK_CREATE_EXTENSION_HOOK(taskCB)
|
||||
#endif
|
||||
|
||||
@@ -1500,7 +1500,9 @@ typedef struct {
|
||||
#if (LOSCFG_KERNEL_SIGNAL == 1)
|
||||
VOID *sig; /**< Task signal */
|
||||
#endif
|
||||
LOSCFG_TASK_STRUCT_EXTENSION /**< Task extension field */
|
||||
#ifdef LOSCFG_TASK_STRUCT_EXTENSION
|
||||
LOSCFG_TASK_STRUCT_EXTENSION; /**< Task extension field */
|
||||
#endif
|
||||
} LosTaskCB;
|
||||
|
||||
STATIC INLINE BOOL OsTaskIsExit(const LosTaskCB *taskCB)
|
||||
|
||||
@@ -307,18 +307,28 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsGetAllTskCpupInfo(CPUP_INFO_S **cpuLessOneSec,
|
||||
LITE_OS_SEC_TEXT_MINOR VOID OsPrintAllTskInfoHeader(VOID)
|
||||
{
|
||||
PRINTK("\r\n TID Priority Status StackSize WaterLine StackPoint TopOfStack EventMask SemID");
|
||||
#if (LOSCFG_TASK_MEM_USED == 1)
|
||||
PRINTK(" AllocSize");
|
||||
#endif
|
||||
#if (LOSCFG_BASE_CORE_CPUP == 1)
|
||||
PRINTK(" CPUUSE CPUUSE10s CPUUSE1s ");
|
||||
#endif /* LOSCFG_BASE_CORE_CPUP */
|
||||
PRINTK(" TaskEntry name\n");
|
||||
PRINTK(" --- -------- -------- ");
|
||||
PRINTK("--------- --------- ---------- ---------- --------- ------ ");
|
||||
#if (LOSCFG_TASK_MEM_USED == 1)
|
||||
PRINTK("--------- ");
|
||||
#endif
|
||||
#if (LOSCFG_BASE_CORE_CPUP == 1)
|
||||
PRINTK("------- --------- -------- ");
|
||||
#endif /* LOSCFG_BASE_CORE_CPUP */
|
||||
PRINTK("---------- ----\n");
|
||||
}
|
||||
|
||||
#if (LOSCFG_TASK_MEM_USED == 1)
|
||||
STATIC UINT32 g_taskMemUsed[LOSCFG_BASE_CORE_TSK_LIMIT + 1];
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
Function : OsGetAllTskInfo
|
||||
Description : Get all task info.
|
||||
@@ -338,6 +348,11 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsGetAllTskInfo(VOID)
|
||||
CPUP_INFO_S *cpuOneSec = (CPUP_INFO_S *)NULL;
|
||||
#endif
|
||||
|
||||
#if (LOSCFG_TASK_MEM_USED == 1)
|
||||
(VOID)memset_s(g_taskMemUsed, sizeof(UINT32) * g_taskMaxNum, 0, sizeof(UINT32) * g_taskMaxNum);
|
||||
OsTaskMemUsed((VOID *)OS_SYS_MEM_ADDR, g_taskMemUsed, g_taskMaxNum);
|
||||
#endif
|
||||
|
||||
#if (LOSCFG_BASE_CORE_CPUP == 1)
|
||||
if (OsGetAllTskCpupInfo(&cpuLessOneSec, &cpuTenSec, &cpuOneSec) != LOS_OK) {
|
||||
return OS_ERROR;
|
||||
@@ -357,6 +372,9 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsGetAllTskInfo(VOID)
|
||||
taskCB->taskID, taskCB->priority, OsConvertTskStatus(taskCB->taskStatus),
|
||||
taskCB->stackSize, OsGetTaskWaterLine(taskCB->taskID),
|
||||
(UINT32)(UINTPTR)taskCB->stackPointer, taskCB->topOfStack, taskCB->eventMask, semID);
|
||||
#if (LOSCFG_TASK_MEM_USED == 1)
|
||||
PRINTK("%#10x", g_taskMemUsed[loopNum]);
|
||||
#endif
|
||||
|
||||
#if (LOSCFG_BASE_CORE_CPUP == 1)
|
||||
PRINTK("%6u.%-2u%7u.%-2u%6u.%-2u ",
|
||||
|
||||
@@ -853,13 +853,13 @@ LITE_TEST_CASE(PthreadFuncTestSuite, TestPthread013, Function | MediumTest | Lev
|
||||
|
||||
ret = pthread_condattr_getclock(&condattr, &clk);
|
||||
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
|
||||
ICUNIT_ASSERT_EQUAL(clk, 0, clk);
|
||||
ICUNIT_ASSERT_EQUAL(clk, CLOCK_REALTIME, clk);
|
||||
|
||||
ret = pthread_condattr_setclock(&condattr, 0);
|
||||
ret = pthread_condattr_setclock(&condattr, CLOCK_REALTIME);
|
||||
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
|
||||
ret = pthread_condattr_getclock(&condattr, &clk);
|
||||
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
|
||||
ICUNIT_ASSERT_EQUAL(clk, 0, clk);
|
||||
ICUNIT_ASSERT_EQUAL(clk, CLOCK_REALTIME, clk);
|
||||
|
||||
struct timespec ts = {0};
|
||||
ret = clock_getres(CLOCK_MONOTONIC, &ts);
|
||||
|
||||
Reference in New Issue
Block a user