Index | Thread | Search

From:
Brent Cook <busterb@gmail.com>
Subject:
Re: [Fix] Patch btop to report active CPU usage correctly, remove desktop runtime dependency
To:
Theo Buehler <tb@theobuehler.org>
Cc:
ports@openbsd.org
Date:
Fri, 17 Apr 2026 08:02:08 -0500

Download raw body.

Thread
On Fri, Apr 17, 2026 at 7:53 AM Brent Cook <busterb@gmail.com> wrote:

> On Thu, Apr 16, 2026 at 11:14 PM Theo Buehler <tb@theobuehler.org> wrote:
> >
> > On Thu, Apr 16, 2026 at 09:47:54PM -0500, Brent Cook wrote:
> > > I like to use btop to monitor resource usage on servers, but it wasn't
> > > reporting per-core CPU usage correctly on OpenBSD. I reported and got
> > > the issue fixed upstream, but it might be a while until the next
> > > release, so I wanted to pull that diff into ports in the mean time:
> > >
> > > https://github.com/aristocratos/btop/pull/1587
> > >
> > The CPU one makes sense to me and it definitely improves things in the
> > default display. However, the tool can't handle CPUs being added at
> > runtime. If you remove S from hw.blockcpu (or toggle hw.smt 0 -> 1),
> > a running btop throws an exception and dies:
> >
> > ERROR: Exception in runner thread -> Cpu:: -> collect() : vector
> >
> > I have no real opinion on whether that is acceptable or not. It doesn't
> > look like an absolute blocker to me, but it doesn't seem ideal.
> >
> > You'd need to add REVISION=0 to the Makefile, and I would also add a link
> > to your PR at the top of the patch.
>
> Here's v2, with a check made to active CPU count on each poll so the
> stats vectors are resized and the UI is redrawn when that changes.
>
> My 4 core machine didn't crash for some reason in testing, but I think

As I was feeding the chickens this morning, it came to me - I was
testing with all of the cores/threads active, then removing them while
btop was running, which meant the vectors were already sized big
enough to avoid the crash. <facepalm>