From 94ce970f126c45b00f6215dd657df19f6cf1c593 Mon Sep 17 00:00:00 2001 From: Qiao Nuohan Date: Thu, 2 Oct 2014 10:35:25 +0800 Subject: [PATCH v3 08/21] modify display_sys_stats() to indicate offline cpus 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, offline cpus's total number will also be displayed. The has 4 cpus and cpu#2 is offline. The original display is like below: KERNEL: ../kdump/vmlinux DUMPFILE: ../kdump/vmcore [PARTIAL DUMP] CPUS: 4 DATE: Tue Sep 23 14:54:26 2014 UPTIME: 00:02:45 ... With this patch, the output is like below: KERNEL: ../kdump/vmlinux DUMPFILE: ../kdump/vmcore [PARTIAL DUMP] CPUS: 4 [1 OFFLINE] DATE: Tue Sep 23 14:54:26 2014 UPTIME: 00:02:45 ... Signed-off-by: Qiao Nuohan --- kernel.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel.c b/kernel.c index f5f98ca..90e6f79 100755 --- a/kernel.c +++ b/kernel.c @@ -4796,8 +4796,11 @@ display_sys_stats(void) pc->kvmdump_mapfile); } - fprintf(fp, " CPUS: %d\n", - machine_type("PPC64") ? get_cpus_to_display() : kt->cpus); + if (machine_type("PPC64")) + fprintf(fp, " CPUS: %d\n", get_cpus_to_display()); + else + fprintf(fp, " CPUS: %d [%d OFFLINE]\n", kt->cpus, + kt->cpus - get_cpus_to_display()); if (ACTIVE()) get_xtime(&kt->date); fprintf(fp, " DATE: %s\n", -- 1.8.5.3