Skip to content

Fix 'virtualized' CPU bar color in non-detailed mode#1922

Open
Explorer09 wants to merge 4 commits intohtop-dev:mainfrom
Explorer09:cpu-meter-items
Open

Fix 'virtualized' CPU bar color in non-detailed mode#1922
Explorer09 wants to merge 4 commits intohtop-dev:mainfrom
Explorer09:cpu-meter-items

Conversation

@Explorer09
Copy link
Contributor

@Explorer09 Explorer09 commented Mar 17, 2026

The virtualized CPU time will now write to the CPU_METER_STEAL item in the non-detailed CPU meter mode. Also fix the CPU meter text in the help screen.

This pull request also includes code cleanups such as unnecessary assignments of v[CPU_METER_IRQ] in NetBSD and OpenBSD platforms.

I think my approach is better than what's proposed in #1921.

Resolves #1920.

When both the options "Add guest time in CPU meter percentage" and
"Detailed CPU time" are turned off, the CPU meter used to show the
"virtual" CPU time in the bar display as a glitch. Now fix it.

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
The time displayed is (steal+guest), not just guest CPU time.

Regression from 3d8fa0b

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
Linux and PCP platform code used to write the 'virtualized'
(steal+guest) CPU time into the CPU_METER_IRQ item when the "detailed
CPU time" option is off, which would result in a wrong color painted for
virtual CPU time in bar mode. Correct it by writing to the
CPU_METER_STEAL item instead.

Also update the "virtualized" CPU meter item in the help screen: (1) The
color is now CPU_STEAL for consistency. (2) In monochrome mode, two
dummy items are displayed before the "virtualized" word so that the
bar meter symbol mapping is correct.

Resolves: htop-dev#1920

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Help is missing description of orange-colored CPU bar

1 participant