From c83c09f2d02b2b822c0b933af725d9c7d48ce9a4 Mon Sep 17 00:00:00 2001
From: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
Date: Sat, 23 Aug 2014 14:58:20 +0800
Subject: [PATCH 09/23] x86_64: modify help -k only to display online cpus'
 number

help -k will display total number of cpus. This patch skips offline
cpu and only calculates online cpus' number.

Signed-off-by: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
---
 kernel.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel.c b/kernel.c
index 6fc44c2..127bf3a 100755
--- a/kernel.c
+++ b/kernel.c
@@ -5229,7 +5229,8 @@ dump_kernel_table(int verbose)
         fprintf(fp, "    init_begin: %lx\n", kt->init_begin);
         fprintf(fp, "      init_end: %lx\n", kt->init_end);
         fprintf(fp, "           end: %lx\n", kt->end);
-        fprintf(fp, "          cpus: %d\n", kt->cpus);
+        fprintf(fp, "          cpus: %d\n", machine_type("X86_64") ?
+		get_cpus_to_display() : kt->cpus);
         fprintf(fp, " cpus_override: %s\n", kt->cpus_override);
         fprintf(fp, "       NR_CPUS: %d (compiled-in to this version of %s)\n",
 		NR_CPUS, pc->program_name); 
-- 
1.8.5.3

