bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH gnumach] kdb: Add "show all runqs" debug command


From: Samuel Thibault
Subject: Re: [PATCH gnumach] kdb: Add "show all runqs" debug command
Date: Fri, 29 Sep 2023 11:04:44 +0200
User-agent: NeoMutt/20170609 (1.8.3)

Applied, thanks!

Damien Zammit, le ven. 29 sept. 2023 04:59:44 +0000, a ecrit:
> ---
>  ddb/db_command.c  |  1 +
>  ddb/db_print.c    | 27 +++++++++++++++++++++++++++
>  ddb/db_print.h    |  6 ++++++
>  kern/sched_prim.h |  1 +
>  4 files changed, 35 insertions(+)
> 
> diff --git a/ddb/db_command.c b/ddb/db_command.c
> index d21386e6..2fae61b0 100644
> --- a/ddb/db_command.c
> +++ b/ddb/db_command.c
> @@ -309,6 +309,7 @@ struct db_command db_show_all_cmds[] = {
>       { "tasks",      db_show_all_tasks,      0,      0 },
>       { "threads",    db_show_all_threads,    0,      0 },
>       { "slocks",     (db_command_fun_t)db_show_all_slocks,   0,      0 },
> +     { "runqs",      (db_command_fun_t)db_show_all_runqs,    0,      0 },
>       { (char *)0 }
>  };
>  
> diff --git a/ddb/db_print.c b/ddb/db_print.c
> index 3fbafe74..89250f7b 100644
> --- a/ddb/db_print.c
> +++ b/ddb/db_print.c
> @@ -39,6 +39,9 @@
>  #include <kern/task.h>
>  #include <kern/thread.h>
>  #include <kern/queue.h>
> +#include <kern/sched.h>
> +#include <kern/processor.h>
> +#include <kern/smp.h>
>  #include <ipc/ipc_port.h>
>  #include <ipc/ipc_space.h>
>  
> @@ -329,6 +332,30 @@ db_show_all_tasks(db_expr_t addr,
>           }
>  }
>  
> +static void showrq(run_queue_t rq)
> +{
> +     db_printf("count(%d) low(%d)\n", rq->count, rq->low);
> +}
> +
> +/*ARGSUSED*/
> +void
> +db_show_all_runqs(
> +     db_expr_t       addr,
> +     boolean_t       have_addr,
> +     db_expr_t       count,
> +     const char *    modif)
> +{
> +     int i;
> +
> +     db_printf("Processor set runq:\t");
> +     showrq(&default_pset.runq);
> +     for (i = 0; i < smp_get_numcpus(); i++) {
> +         db_printf("Processor #%d runq:\t", i);
> +         showrq(&cpu_to_processor(i)->runq);
> +     }
> +     db_printf("Stuck threads:\t%d", stuck_count);
> +}
> +
>  /*ARGSUSED*/
>  void
>  db_show_all_threads(
> diff --git a/ddb/db_print.h b/ddb/db_print.h
> index 87db97be..27b3990a 100644
> --- a/ddb/db_print.h
> +++ b/ddb/db_print.h
> @@ -50,6 +50,12 @@ void db_show_all_threads(
>       db_expr_t       count,
>       const char *    modif);
>  
> +void db_show_all_runqs(
> +     db_expr_t       addr,
> +     int             have_addr,
> +     db_expr_t       count,
> +     const char *    modif);
> +
>  db_addr_t db_task_from_space(
>       ipc_space_t     space,
>       int             *task_id);
> diff --git a/kern/sched_prim.h b/kern/sched_prim.h
> index 405e5456..c250b220 100644
> --- a/kern/sched_prim.h
> +++ b/kern/sched_prim.h
> @@ -184,5 +184,6 @@ void thread_check(thread_t th, run_queue_t rq);
>  
>  extern void idle_thread(void) __attribute__((noreturn));
>  extern void sched_thread(void);
> +extern int stuck_count;
>  
>  #endif       /* _KERN_SCHED_PRIM_H_ */
> -- 
> 2.40.1
> 
> 
> 

-- 
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]