From aca8f8eb2d732af34be31b7c9dce43de5187496e Mon Sep 17 00:00:00 2001 From: Grissiom Date: Wed, 18 Jun 2014 11:18:43 +0800 Subject: [PATCH] shell: print the ref count in `list_device` --- components/finsh/cmd.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/components/finsh/cmd.c b/components/finsh/cmd.c index 9a79ba396b..e449e0c2dc 100644 --- a/components/finsh/cmd.c +++ b/components/finsh/cmd.c @@ -471,17 +471,18 @@ static long _list_device(struct rt_list_node *list) "Unknown" }; - rt_kprintf("device type \n"); - rt_kprintf("-------- ---------- \n"); + rt_kprintf("device type ref count\n"); + rt_kprintf("-------- -------------------- ----------\n"); for (node = list->next; node != list; node = node->next) { device = (struct rt_device *)(rt_list_entry(node, struct rt_object, list)); - rt_kprintf("%-8.*s %-8s \n", + rt_kprintf("%-8.*s %-20s %-8d\n", RT_NAME_MAX, device->parent.name, (device->type <= RT_Device_Class_Unknown) ? device_type_str[device->type] : - device_type_str[RT_Device_Class_Unknown]); + device_type_str[RT_Device_Class_Unknown], + device->ref_count); } return 0; -- GitLab