On Tue, Jan 14, 2025 at 11:52 AM <devel-requ...@lists.crash-utility.osci.io> wrote:
> Date: Thu, 9 Jan 2025 15:59:20 +1300 > From: Tao Liu <l...@redhat.com> > Subject: [Crash-utility] Re: [PATCH] Fix misleading CPU count in > display_sys_stats() > To: soak...@redhat.com > Cc: devel@lists.crash-utility.osci.io > Message-ID: > < > cao7dbbxo5q4ad049r4qtj14hoi97xy_13-nja-1vmuwggge...@mail.gmail.com> > Content-Type: text/plain; charset="UTF-8" > > Hi Lucas, > > Thanks for the fix, LGTM, so ack. > Applied(with slight changes): https://github.com/crash-utility/crash/commit/88453095a3dd54b0950f7d9011fb32b47aaaa0c7 Thanks Lianbo > > Thanks, > Tao Liu > > > On Sat, Jan 4, 2025 at 10:54 AM <soak...@redhat.com> wrote: > > > > From: Lucas Oakley <soak...@redhat.com> > > > > This simplication fixes the total CPU count being reported > > incorrectly in ppc64le and s390x systems when some number of > > CPUs have been offlined, as the kt->cpus value is adjusted. > > This adds the word "OFFLINE" to the 'sys' output for s390x > > and ppc64le, like exists for x86_64 and aarch64 when examining > > systems with offlined CPUs. > > > > Without patch: > > > > KERNEL: /debug/4.18.0-477.10.1.el8_8.s390x/vmlinux > > DUMPFILE: /proc/kcore > > CPUS: 1 > > > > With patch: > > > > KERNEL: /debug/4.18.0-477.10.1.el8_8.s390x/vmlinux > > DUMPFILE: /proc/kcore > > CPUS: 2 [OFFLINE: 1] > > > > Signed-off-by: Lucas Oakley <soak...@redhat.com> > > --- > > kernel.c | 16 +++++++--------- > > 1 file changed, 7 insertions(+), 9 deletions(-) > > > > diff --git a/kernel.c b/kernel.c > > index 8c2e0ca..3e190f1 100644 > > --- a/kernel.c > > +++ b/kernel.c > > @@ -5816,15 +5816,13 @@ display_sys_stats(void) > > pc->kvmdump_mapfile); > > } > > > > - if (machine_type("PPC64")) > > - fprintf(fp, " CPUS: %d\n", get_cpus_to_display()); > > - else { > > - fprintf(fp, " CPUS: %d", kt->cpus); > > - if (kt->cpus - get_cpus_to_display()) > > - fprintf(fp, " [OFFLINE: %d]", > > - kt->cpus - get_cpus_to_display()); > > - fprintf(fp, "\n"); > > - } > > + int number_cpus_to_display = get_cpus_to_display(); > > + int number_cpus_present = get_cpus_present(); > > + fprintf(fp, " CPUS: %d", number_cpus_present); > > + if (number_cpus_present != number_cpus_to_display) > > + fprintf(fp, " [OFFLINE: %d]", > > + number_cpus_present - number_cpus_to_display); > > + fprintf(fp, "\n"); > > > > if (ACTIVE()) > > get_xtime(&kt->date); > > -- > > 2.47.1 >
-- Crash-utility mailing list -- devel@lists.crash-utility.osci.io To unsubscribe send an email to devel-le...@lists.crash-utility.osci.io https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/ Contribution Guidelines: https://github.com/crash-utility/crash/wiki