From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juergen Gross Subject: Re: [PATCH v2 3/5] xen: print online pCPUs and free pCPUs when dumping Date: Wed, 18 Mar 2015 05:29:59 +0100 Message-ID: <5508FF47.6030503@suse.com> References: <20150317152615.9867.48676.stgit@Solace.station> <20150317153309.9867.20149.stgit@Solace.station> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150317153309.9867.20149.stgit@Solace.station> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli , Xen-devel Cc: George Dunlap , Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org On 03/17/2015 04:33 PM, Dario Faggioli wrote: > 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 Acked-by: Juergen Gross > Cc: Juergen Gross > Cc: George Dunlap > Cc: Jan Beulich > Cc: Keir Fraser > --- > 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 > #include > #include > +#include > #include > > #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); > } > > >