[Crash-utility] [PATCH v2 09/25] modify display_sys_stats() to hide cpus' number

Qiao Nuohan qiaonuohan at cn.fujitsu.com
Mon Sep 29 02:09:07 UTC 2014


function display_sys_stats will display the cpus' total number at initiation
when crash is executed or when command sys is called. With this patch, only
the total number of online cpus will be displayed.

The has 4 cpus and cpu#2 is offline. The original display is like below:
<cut>
      KERNEL: ../kdump/vmlinux
    DUMPFILE: ../kdump/vmcore  [PARTIAL DUMP]
        CPUS: 4
        DATE: Tue Sep 23 14:54:26 2014
      UPTIME: 00:02:45
...
<cut>

With this patch, the output is like below:
<cut>
      KERNEL: ../kdump/vmlinux
    DUMPFILE: ../kdump/vmcore  [PARTIAL DUMP]
        CPUS: 3
        DATE: Tue Sep 23 14:54:26 2014
      UPTIME: 00:02:45
...
<cut>

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

diff --git a/kernel.c b/kernel.c
index f5f98ca..8f34a3e 100755
--- a/kernel.c
+++ b/kernel.c
@@ -4796,8 +4796,7 @@ display_sys_stats(void)
 				pc->kvmdump_mapfile);
 	}
 	
-	fprintf(fp, "        CPUS: %d\n",
-		machine_type("PPC64") ? get_cpus_to_display() : kt->cpus);
+	fprintf(fp, "        CPUS: %d\n", get_cpus_to_display());
 	if (ACTIVE())
 		get_xtime(&kt->date);
         fprintf(fp, "        DATE: %s\n", 
-- 
1.8.5.3




More information about the Crash-utility mailing list