[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v2 3/5] xen: print online pCPUs and free pCPUs when dumping
e.g., with `xl debug-key r', like this: (XEN) Online Cpus: 0-15 (XEN) Free Cpus: 8-15 Also, for each cpupool, print the set of pCPUs it contains, like this: (XEN) Cpupool 0: (XEN) Cpus: 0-7 (XEN) Scheduler: SMP Credit Scheduler (credit) Signed-off-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx> Cc: Juergen Gross <JGross@xxxxxxxx> Cc: George Dunlap <george.dunlap@xxxxxxxxxxxxx> Cc: Jan Beulich <JBeulich@xxxxxxxx> Cc: Keir Fraser <keir@xxxxxxx> --- Changes from v1: * _print_cpumap() becomes print_cpumap() (i.e., the leading '_' was not particularly useful in this case), as suggested during review * changed the output such as (1) we only print the maps, not the number of elements, and (2) we avoid printing the free cpus map when empty * improved the changelog --- I'm not including any Reviewed-by / Acked-by tag, since the patch changed. --- xen/common/cpupool.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c index cd6aab9..812a2f9 100644 --- a/xen/common/cpupool.c +++ b/xen/common/cpupool.c @@ -17,6 +17,7 @@ #include <xen/percpu.h> #include <xen/sched.h> #include <xen/sched-if.h> +#include <xen/keyhandler.h> #include <xen/cpu.h> #define for_each_cpupool(ptr) \ @@ -658,6 +659,12 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op) return ret; } +static void print_cpumap(const char *str, const cpumask_t *map) +{ + cpulist_scnprintf(keyhandler_scratch, sizeof(keyhandler_scratch), map); + printk("%s: %s\n", str, keyhandler_scratch); +} + void dump_runq(unsigned char key) { unsigned long flags; @@ -671,12 +678,17 @@ void dump_runq(unsigned char key) sched_smt_power_savings? "enabled":"disabled"); printk("NOW=0x%08X%08X\n", (u32)(now>>32), (u32)now); + print_cpumap("Online Cpus", &cpu_online_map); + if ( cpumask_weight(&cpupool_free_cpus) ) + print_cpumap("Free Cpus", &cpupool_free_cpus); + printk("Idle cpupool:\n"); schedule_dump(NULL); for_each_cpupool(c) { printk("Cpupool %d:\n", (*c)->cpupool_id); + print_cpumap("Cpus", (*c)->cpu_valid); schedule_dump(*c); } _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |