* [PATCH] x86: shorten debug key 'u' output
@ 2015-09-22 12:59 Jan Beulich
2015-09-22 13:03 ` Andrew Cooper
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2015-09-22 12:59 UTC (permalink / raw)
To: xen-devel; +Cc: Andrew Cooper, Keir Fraser
[-- Attachment #1: Type: text/plain, Size: 1246 bytes --]
... by grouping sequences of contiguous CPUs.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -365,7 +365,7 @@ EXPORT_SYMBOL(node_data);
static void dump_numa(unsigned char key)
{
s_time_t now = NOW();
- unsigned int i, j;
+ unsigned int i, j, n;
int err;
struct domain *d;
struct page_info *page;
@@ -389,8 +389,26 @@ static void dump_numa(unsigned char key)
NODE_DATA(i)->node_id);
}
+ j = cpumask_first(&cpu_online_map);
+ n = 0;
for_each_online_cpu ( i )
- printk("CPU%d -> NODE%d\n", i, cpu_to_node[i]);
+ {
+ if ( i != j + n || cpu_to_node[j] != cpu_to_node[i] )
+ {
+ if ( n > 1 )
+ printk("CPU%u...%u -> NODE%d\n", j, j + n - 1, cpu_to_node[j]);
+ else
+ printk("CPU%u -> NODE%d\n", j, cpu_to_node[j]);
+ j = i;
+ n = 1;
+ }
+ else
+ ++n;
+ }
+ if ( n > 1 )
+ printk("CPU%u...%u -> NODE%d\n", j, j + n - 1, cpu_to_node[j]);
+ else
+ printk("CPU%u -> NODE%d\n", j, cpu_to_node[j]);
rcu_read_lock(&domlist_read_lock);
[-- Attachment #2: x86-debug-key-u-abbreviate.patch --]
[-- Type: text/plain, Size: 1277 bytes --]
x86: shorten debug key 'u' output
... by grouping sequences of contiguous CPUs.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -365,7 +365,7 @@ EXPORT_SYMBOL(node_data);
static void dump_numa(unsigned char key)
{
s_time_t now = NOW();
- unsigned int i, j;
+ unsigned int i, j, n;
int err;
struct domain *d;
struct page_info *page;
@@ -389,8 +389,26 @@ static void dump_numa(unsigned char key)
NODE_DATA(i)->node_id);
}
+ j = cpumask_first(&cpu_online_map);
+ n = 0;
for_each_online_cpu ( i )
- printk("CPU%d -> NODE%d\n", i, cpu_to_node[i]);
+ {
+ if ( i != j + n || cpu_to_node[j] != cpu_to_node[i] )
+ {
+ if ( n > 1 )
+ printk("CPU%u...%u -> NODE%d\n", j, j + n - 1, cpu_to_node[j]);
+ else
+ printk("CPU%u -> NODE%d\n", j, cpu_to_node[j]);
+ j = i;
+ n = 1;
+ }
+ else
+ ++n;
+ }
+ if ( n > 1 )
+ printk("CPU%u...%u -> NODE%d\n", j, j + n - 1, cpu_to_node[j]);
+ else
+ printk("CPU%u -> NODE%d\n", j, cpu_to_node[j]);
rcu_read_lock(&domlist_read_lock);
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] x86: shorten debug key 'u' output
2015-09-22 12:59 [PATCH] x86: shorten debug key 'u' output Jan Beulich
@ 2015-09-22 13:03 ` Andrew Cooper
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cooper @ 2015-09-22 13:03 UTC (permalink / raw)
To: Jan Beulich, xen-devel; +Cc: Keir Fraser
On 22/09/15 13:59, Jan Beulich wrote:
> ... by grouping sequences of contiguous CPUs.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Much nicer. Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-22 13:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-22 12:59 [PATCH] x86: shorten debug key 'u' output Jan Beulich
2015-09-22 13:03 ` Andrew Cooper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).