From: cheloha Date: Fri, 16 Dec 2022 15:54:27 +0000 (+0000) Subject: top(1): always recount number of online CPUs X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2ea969edd50dc3359f21b08de4b38168e4dcb26d;p=openbsd top(1): always recount number of online CPUs If hw.smt is toggled while top(1) is running in "combined" mode the CPU count on the CPU state line is incorrect. We always need to recount the number of online CPUs. --- diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index c5267b17d3e..227df4fdc2e 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -1,4 +1,4 @@ -/* $OpenBSD: top.c,v 1.107 2022/09/10 16:58:51 cheloha Exp $ */ +/* $OpenBSD: top.c,v 1.108 2022/12/16 15:54:27 cheloha Exp $ */ /* * Top users/processes display for Unix @@ -544,7 +544,7 @@ restart: * don't display stats for offline CPUs: resize if we're * interactive and CPUs have toggled on or offline */ - if (interactive && !combine_cpus) { + if (interactive) { for (i = ncpuonline_now = 0; i < ncpu; i++) if (system_info.cpuonline[i]) ncpuonline_now++;