From 007c0653be5d211c146047f63c17343eb451ae08 Mon Sep 17 00:00:00 2001 From: Qiao Nuohan Date: Sat, 23 Aug 2014 15:27:46 +0800 Subject: [PATCH 12/23] x86_64: modify irq -a only to display online cpus' data irq -a will dump cpu affinity for irqs. This patch will skip offline cpus. Signed-off-by: Qiao Nuohan --- kernel.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kernel.c b/kernel.c index 329c786..ea3b65c 100755 --- a/kernel.c +++ b/kernel.c @@ -5714,14 +5714,19 @@ get_irq_desc_addr(int irq) static void display_cpu_affinity(ulong *mask) { - int cpu, seq, start, count; + int cpu, seq, start, count, cpu_exist; seq = FALSE; start = 0; count = 0; for (cpu = 0; cpu < kt->cpus; ++cpu) { - if (NUM_IN_BITMAP(mask, cpu)) { + /* + * on X86_64, offline cpu should not be displayed. + */ + cpu_exist = !check_offline_cpu(cpu) && NUM_IN_BITMAP(mask, cpu); + + if (cpu_exist) { if (seq) continue; start = cpu; @@ -5738,6 +5743,9 @@ display_cpu_affinity(ulong *mask) } } + /* + * when seq is TRUE, the following cpus cannot be offline. + */ if (seq) { if (count) fprintf(fp, ","); -- 1.8.5.3