diff options
author | Scott Soule Cheloha <cheloha@cvs.openbsd.org> | 2022-12-16 15:54:28 +0000 |
---|---|---|
committer | Scott Soule Cheloha <cheloha@cvs.openbsd.org> | 2022-12-16 15:54:28 +0000 |
commit | 381b297d0a31406ca515106cb3dceb96dd0febdd (patch) | |
tree | 6033e833c9a90f162789f8d23e8b3bf7c0fae431 /usr.bin/top/top.c | |
parent | 33cc55479d942f8f08f6b9580855bcc8199730f2 (diff) |
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.
Diffstat (limited to 'usr.bin/top/top.c')
-rw-r--r-- | usr.bin/top/top.c | 4 |
1 files changed, 2 insertions, 2 deletions
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++; |