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 <[email protected]>
---
 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

--
Crash-utility mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/crash-utility

Reply via email to