add debug cmd for task/sem/mutex/msgqueue/timer

This commit is contained in:
Wang_Weigen
2021-05-08 18:08:40 +08:00
parent 1599057195
commit c4e0918583
6 changed files with 229 additions and 496 deletions

View File

@@ -23,7 +23,7 @@
extern long ShowMemPool(void);
extern void ShowMemory(void);
extern void ListBuddy(void);
extern void ShowBuddy(void);
/**************************single gatherblock test sample***********************************/
static uint8 *ptr[30];
static uint8 mempool[2048];
@@ -265,7 +265,7 @@ void GatherblockLimitTest(char *name, int count, int blocksize){
KPrintf("no memory.\n");
return;
}
ListBuddy();
ShowBuddy();
/* create task1, alloc memory blocks */
l_tid1 = KTaskCreate("task1_l", LTask1AllocEntry, NONE,
TASK_STACK_SIZE,
@@ -304,7 +304,7 @@ void GatherblockLimitcountTest(char *name, int count, int blocksize, int poolcou
}
KPrintf("gatherblock allocation,count[%d],size[%d]\n", count, blocksize);
}
ListBuddy();
ShowBuddy();
index--;
for(;index>=0;index--){

View File

@@ -22,7 +22,7 @@
#include <string.h>
extern void ShowMemory(void);
extern void ListBuddy(void);
extern void ShowBuddy(void);
/**************************test memory usage***********************************/
@@ -131,7 +131,7 @@ int FreeEnd(void)
char *ptr[MEM_GRIN_COUNT];
unsigned int arr_grin[MEM_GRIN_COUNT];
extern void ListBuddy();
extern void ShowBuddy();
int FendGrin()
{
KPrintf("\033[32;1m***********test limitations*************\033[0m\n");
@@ -154,7 +154,7 @@ int FendGrin()
}
}
KPrintf("------------- limitation until [%d] -----------\n",i);
ListBuddy();
ShowBuddy();
DelayKTask(2000);
@@ -211,7 +211,7 @@ void TestCacheLimitation(int timers,int init)
temp %= 64;
temp = ((temp==0) ? (temp + 1) : temp);
}
ListBuddy();
ShowBuddy();
DelayKTask(1000);

View File

@@ -998,7 +998,7 @@ void MemoryInfo(uint32 *total_memory, uint32 *used_memory, uint32 *max_used_memo
#ifdef TOOL_SHELL
#include <shell.h>
void ListBuddy(void);
void ShowBuddy(void);
void ShowMemory(void);
/**
* This function will list the statistic information about memory.
@@ -1009,14 +1009,14 @@ void ShowMemory(void)
KPrintf("used memory : %d\n", ByteManager.dynamic_buddy_manager.active_memory);
KPrintf("maximum allocated memory: %d\n", ByteManager.dynamic_buddy_manager.max_ever_usedmem);
KPrintf("total cache szie: %d, %d/%d[32B],%d/%d[64B]\n", ByteManager.dynamic_buddy_manager.static_memory,ByteManager.static_manager[0].block_free_count,SMALL_NUMBER_32B,ByteManager.static_manager[1].block_free_count,SMALL_NUMBER_64B);
ListBuddy();
ShowBuddy();
}
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC)|SHELL_CMD_PARAM_NUM(0),
ShowMemory,ShowMemory,list memory usage information);
/**
* This function will list the freeNodeList information on dynamic buddy memory.
*/
void ListBuddy(void)
void ShowBuddy(void)
{
int lock = 0;
struct DynamicFreeNode *debug = NONE;
@@ -1031,7 +1031,7 @@ void ListBuddy(void)
CriticalAreaUnLock(lock);
}
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC)|SHELL_CMD_PARAM_NUM(0),
ListBuddy,ListBuddy,list memory usage information);
ShowBuddy,ShowBuddy,list memory usage information);
#endif
#endif

View File

@@ -69,10 +69,8 @@ static void ZombieKTaskEntry(void *parameter)
KTaskIdDelete(task->id.id);
if(task->task_dync_sched_member.delay != NONE){
}
KERNEL_FREE(task->task_dync_sched_member.delay);
}
KERNEL_FREE(task);
} else {
SuspendKTask(zombie_recycle);