提交 329c44a0 编写于 作者: B bernard.xiong

add suspend thread display on mempool command.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@285 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 9b905b54
...@@ -234,9 +234,20 @@ int list_mempool() ...@@ -234,9 +234,20 @@ int list_mempool()
for (node = list->next; node != list; node = node->next) for (node = list->next; node != list; node = node->next)
{ {
mp = (struct rt_mempool*)rt_list_entry(node, struct rt_object, list); mp = (struct rt_mempool*)rt_list_entry(node, struct rt_object, list);
rt_kprintf("%-8s %04d %04d %04d %d\n", mp->parent.name, if (mp->suspend_thread_count > 0)
mp->block_size, mp->block_total_count, mp->block_free_count, {
mp->suspend_thread_count); rt_kprintf("%-8s %04d %04d %04d %d:", mp->parent.name,
mp->block_size, mp->block_total_count, mp->block_free_count,
mp->suspend_thread_count);
show_wait_queue(&(mp->suspend_thread));
rt_kprintf("\n");
}
else
{
rt_kprintf("%-8s %04d %04d %04d %d\n", mp->parent.name,
mp->block_size, mp->block_total_count, mp->block_free_count,
mp->suspend_thread_count);
}
} }
return 0; return 0;
...@@ -363,24 +374,24 @@ static int str_is_prefix(const char* prefix, const char* str) ...@@ -363,24 +374,24 @@ static int str_is_prefix(const char* prefix, const char* str)
void list_prefix(char* prefix) void list_prefix(char* prefix)
{ {
struct finsh_syscall_item* syscall_item; struct finsh_syscall_item* syscall_item;
struct finsh_sysvar_item* sysvar_item; struct finsh_sysvar_item* sysvar_item;
rt_uint16_t func_cnt, var_cnt; rt_uint16_t func_cnt, var_cnt;
const char* name_ptr; const char* name_ptr;
func_cnt = 0; func_cnt = 0;
var_cnt = 0; var_cnt = 0;
{ {
struct finsh_syscall* index; struct finsh_syscall* index;
for (index = _syscall_table_begin; index < _syscall_table_end; index ++) for (index = _syscall_table_begin; index < _syscall_table_end; index ++)
{ {
if (str_is_prefix(prefix, index->name) == 0) if (str_is_prefix(prefix, index->name) == 0)
{ {
if (func_cnt == 0) if (func_cnt == 0)
rt_kprintf("--function:\n"); rt_kprintf("--function:\n");
func_cnt ++; func_cnt ++;
/* set name_ptr */ /* set name_ptr */
name_ptr = index->name; name_ptr = index->name;
#ifdef FINSH_USING_DESCRIPTION #ifdef FINSH_USING_DESCRIPTION
rt_kprintf("%-16s -- %s\n", index->name, index->desc); rt_kprintf("%-16s -- %s\n", index->name, index->desc);
...@@ -396,13 +407,13 @@ void list_prefix(char* prefix) ...@@ -396,13 +407,13 @@ void list_prefix(char* prefix)
while (syscall_item != NULL) while (syscall_item != NULL)
{ {
if (str_is_prefix(prefix, syscall_item->syscall.name) == 0) if (str_is_prefix(prefix, syscall_item->syscall.name) == 0)
{ {
if (func_cnt == 0) if (func_cnt == 0)
rt_kprintf("--function:\n"); rt_kprintf("--function:\n");
func_cnt ++; func_cnt ++;
/* set name_ptr */ /* set name_ptr */
name_ptr = syscall_item->syscall.name; name_ptr = syscall_item->syscall.name;
rt_kprintf("[l] %s\n", syscall_item->syscall.name); rt_kprintf("[l] %s\n", syscall_item->syscall.name);
} }
syscall_item = syscall_item->next; syscall_item = syscall_item->next;
...@@ -413,13 +424,13 @@ void list_prefix(char* prefix) ...@@ -413,13 +424,13 @@ void list_prefix(char* prefix)
for (index = _sysvar_table_begin; index < _sysvar_table_end; index ++) for (index = _sysvar_table_begin; index < _sysvar_table_end; index ++)
{ {
if (str_is_prefix(prefix, index->name) == 0) if (str_is_prefix(prefix, index->name) == 0)
{ {
if (var_cnt == 0) if (var_cnt == 0)
rt_kprintf("--variable:\n"); rt_kprintf("--variable:\n");
var_cnt ++; var_cnt ++;
/* set name ptr */ /* set name ptr */
name_ptr = index->name; name_ptr = index->name;
#ifdef FINSH_USING_DESCRIPTION #ifdef FINSH_USING_DESCRIPTION
rt_kprintf("%-16s -- %s\n", index->name, index->desc); rt_kprintf("%-16s -- %s\n", index->name, index->desc);
...@@ -435,22 +446,22 @@ void list_prefix(char* prefix) ...@@ -435,22 +446,22 @@ void list_prefix(char* prefix)
{ {
if (str_is_prefix(prefix, sysvar_item->sysvar.name) == 0) if (str_is_prefix(prefix, sysvar_item->sysvar.name) == 0)
{ {
if (var_cnt == 0) if (var_cnt == 0)
rt_kprintf("--variable:\n"); rt_kprintf("--variable:\n");
var_cnt ++; var_cnt ++;
/* set name ptr */ /* set name ptr */
name_ptr = sysvar_item->sysvar.name; name_ptr = sysvar_item->sysvar.name;
rt_kprintf("[l] %s\n", sysvar_item->sysvar.name); rt_kprintf("[l] %s\n", sysvar_item->sysvar.name);
} }
sysvar_item = sysvar_item->next; sysvar_item = sysvar_item->next;
} }
/* only one matched */ /* only one matched */
if ((func_cnt + var_cnt) == 1) if ((func_cnt + var_cnt) == 1)
{ {
rt_strncpy(prefix, name_ptr, strlen(name_ptr)); rt_strncpy(prefix, name_ptr, strlen(name_ptr));
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册