add memory usage

This commit is contained in:
TXuian
2024-10-29 16:17:43 +08:00
parent 968d66e5a9
commit 7b6c93d391
37 changed files with 654 additions and 115 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
SRC_DIR := fs shell lib boards drivers semaphore drivers tools net app
SRC_DIR := fs shell lib boards drivers semaphore tools app
include $(KERNEL_ROOT)/compiler.mk
+1 -1
View File
@@ -43,7 +43,7 @@ INC_DIR = -I$(KERNEL_ROOT)/services/shell/letter-shell \
-I$(KERNEL_ROOT)/services/app
ifeq ($(BOARD), imx6q-sabrelite)
all: test_fault simple_client simple_server shell fs_server semaphore_server test_sleep test_semaphore test_ipc_null test_thread test_irq_hdlr test_irq_block test_irq_send eth_driver epit_server test_net lwip readme.txt | bin
all: test_fault simple_client simple_server shell fs_server semaphore_server test_sleep test_semaphore test_ipc_null test_thread test_irq_hdlr test_irq_block test_irq_send eth_driver epit_server readme.txt | bin
else
all: test_fault simple_client simple_server shell fs_server semaphore_server test_sleep test_ipc_null test_thread test_semaphore test_net lwip readme.txt eth_hal | bin
endif
@@ -102,6 +102,11 @@ int show_cpu()
return syscall(SYSCALL_SYS_STATE, SYS_STATE_SHOW_CPU_INFO, 0, 0, 0);
}
int show_actree()
{
return syscall(SYSCALL_SYS_STATE, SYS_STATE_SHOW_ACTREE, 0, 0, 0);
}
uintptr_t get_second()
{
sys_state_info info;
@@ -47,6 +47,7 @@ typedef enum {
SYS_STATE_SHOW_CPU_INFO,
SYS_STATE_GET_CURRENT_TICK,
SYS_STATE_GET_CURRENT_SECOND,
SYS_STATE_SHOW_ACTREE,
} sys_state_option;
typedef enum {
@@ -99,6 +100,7 @@ int set_priority(sys_state_info* info);
int show_task();
int show_mem();
int show_cpu();
int show_actree();
uintptr_t get_second();
uintptr_t get_tick();
@@ -1797,6 +1797,11 @@ void shellShowCpusInfo()
show_cpu();
}
void shellShowActree()
{
show_actree();
}
#if SHELL_EXEC_UNDEF_FUNC == 1
/**
* @brief shell执行未定义函数
@@ -40,6 +40,7 @@ extern void shellKill(int pid);
extern void shellShowTasks();
extern void shellShowMemInfo();
extern void shellShowCpusInfo();
extern void shellShowActree();
#if SHELL_EXEC_UNDEF_FUNC == 1
extern int shellExecute(int argc, char* argv[]);
@@ -118,6 +119,8 @@ const ShellCommand shellCommandList[] = {
showMemInfo, shellShowMemInfo, display memory info),
SHELL_CMD_ITEM(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC) | SHELL_CMD_DISABLE_RETURN,
showCpusInfo, shellShowCpusInfo, display cpus info),
SHELL_CMD_ITEM(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC) | SHELL_CMD_DISABLE_RETURN,
showActree, shellShowActree, display actracer tree),
#if SHELL_EXEC_UNDEF_FUNC == 1
SHELL_CMD_ITEM(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN) | SHELL_CMD_DISABLE_RETURN,