Xen-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Juergen Gross <JGross@suse.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>
Subject: [PATCH v2 3/5] xen: print online pCPUs and free pCPUs when dumping
Date: Tue, 17 Mar 2015 16:33:10 +0100	[thread overview]
Message-ID: <20150317153309.9867.20149.stgit@Solace.station> (raw)
In-Reply-To: <20150317152615.9867.48676.stgit@Solace.station>

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@citrix.com>
Cc: Juergen Gross <JGross@suse.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
---
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);
     }

  parent reply	other threads:[~2015-03-17 15:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17 15:32 [PATCH v2 0/5] Improving dumping of scheduler related info Dario Faggioli
2015-03-17 15:32 ` [PATCH v2 1/5] xen: sched_rt: avoid ASSERT()ing on runq dump if there are no domains Dario Faggioli
2015-03-17 15:33 ` [PATCH v2 2/5] xen: rework locking for dump of scheduler info (debug-key r) Dario Faggioli
2015-03-30 13:34   ` George Dunlap
2015-03-17 15:33 ` Dario Faggioli [this message]
2015-03-18  4:29   ` [PATCH v2 3/5] xen: print online pCPUs and free pCPUs when dumping Juergen Gross
2015-03-18 11:03   ` Jan Beulich
2015-03-18 11:26     ` Dario Faggioli
2015-03-17 15:33 ` [PATCH v2 4/5] xen: sched_credit2: more info " Dario Faggioli
2015-03-17 15:33 ` [PATCH v2 5/5] xen: sched_rt: print useful affinity " Dario Faggioli
2015-03-18  1:09   ` Meng Xu
2015-03-30 13:47   ` George Dunlap
2015-03-31 16:58     ` Dario Faggioli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150317153309.9867.20149.stgit@Solace.station \
    --to=dario.faggioli@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=JGross@suse.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox