diff options
| author | Grissiom <[email protected]> | 2014-06-18 11:18:43 +0800 |
|---|---|---|
| committer | Grissiom <[email protected]> | 2014-06-18 11:18:43 +0800 |
| commit | aca8f8eb2d732af34be31b7c9dce43de5187496e (patch) | |
| tree | f1c9e3e9e0c988259f7035b6c8a6dc54caad309b | |
| parent | dc366ecf7a2946c8f071735f5f2065d51000240a (diff) | |
shell: print the ref count in `list_device`
| -rw-r--r-- | components/finsh/cmd.c | 9 |
1 files 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; |
