[Bug 280600] sysutils/htop CPU usage meters reporting wildly inaccurate CPU usage

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 07 Aug 2024 20:54:49 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=280600

bsd_orsolic <bsd@orsolic.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bsd@orsolic.org

--- Comment #1 from bsd_orsolic <bsd@orsolic.org> ---
It seems that error is introduced with commit
c803ec6dae5556fa35d6bd8124aa536633887f77

Small diff will fix it:
--- a/freebsd/Platform.c
+++ b/freebsd/Platform.c
@@ -210,7 +210,7 @@ double Platform_setCPUValues(Meter* this, unsigned int cpu)
{
       this->curItems = 4;
       percent = v[CPU_METER_NICE] + v[CPU_METER_NORMAL] + v[CPU_METER_KERNEL]
+ v[CPU_METER_IRQ];
    } else {
-      v[CPU_METER_NORMAL] = cpuData->systemAllPercent;
+      v[CPU_METER_KERNEL] = cpuData->systemAllPercent;
       this->curItems = 3;
       percent = v[CPU_METER_NICE] + v[CPU_METER_NORMAL] + v[CPU_METER_KERNEL];
    }

I'll report it to the upstream.

-- 
You are receiving this mail because:
You are the assignee for the bug.