From ffd4f3c8239b41d3fe9fa14403eb063e02b6a222 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Sat, 13 Sep 2014 00:41:11 +0200 Subject: ddb: add `show all tasks' command * ddb/db_command.c (db_show_all_cmds): Add `tasks'. * ddb/db_print.c (db_show_all_tasks): New function. * ddb/db_print.h (db_show_all_tasks): New prototype. --- ddb/db_print.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'ddb/db_print.c') diff --git a/ddb/db_print.c b/ddb/db_print.c index e711ab66..24a3e337 100644 --- a/ddb/db_print.c +++ b/ddb/db_print.c @@ -276,6 +276,30 @@ db_print_task( } } +void +db_show_all_tasks(db_expr_t addr, + boolean_t have_addr, + db_expr_t count, + const char *modif) +{ + task_t task; + int task_id = 0; + processor_set_t pset; + + db_printf(" ID %-*s NAME [THREADS]\n", 2*sizeof(vm_offset_t), "TASK"); + + queue_iterate(&all_psets, pset, processor_set_t, all_psets) + queue_iterate(&pset->tasks, task, task_t, pset_tasks) { + db_printf("%3d %0*X %s [%d]\n", + task_id, + 2*sizeof(vm_offset_t), + task, + task->name, + task->thread_count); + task_id++; + } +} + /*ARGSUSED*/ void db_show_all_threads(addr, have_addr, count, modif) -- cgit v1.2.3