Fix 'virtualized' CPU bar color in non-detailed mode#1922
Open
Explorer09 wants to merge 4 commits intohtop-dev:mainfrom
Open
Fix 'virtualized' CPU bar color in non-detailed mode#1922Explorer09 wants to merge 4 commits intohtop-dev:mainfrom
Explorer09 wants to merge 4 commits intohtop-dev:mainfrom
Conversation
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>
This was referenced Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The virtualized CPU time will now write to the
CPU_METER_STEALitem 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.