htop
htop copied to clipboard
Request for a setup option to hide offline CPUs in the CPUMeter
Hi. Would it be possible to add a configure flag (or even runtime option) to disable the showing of offline CPUs? It's taking up space in the terminal for no reason that I can see. Thanks.
Do you refer to LXC/cgroups cpu limiting?
No, this is about (for example) Intel CPUs with hyperthreading disabled. All the offline CPUs are still shown in htop, but wasting space in a small terminal.
@hyder365 Did you tried lates code from master?
It already uses /sys/devices/system/cpu/cpu*/online
lookups.
Issue still present in 3.2.1.
Issue still present in 3.2.1.
Features and bug fixes included with a new release are usually listed as part of the change log, but normally also appear as part of the respective milestone. Have a look at https://github.com/htop-dev/htop/milestone/8 for the 3.2.1 release.
Currently this issue is not yet included with any upcoming milestone and given that this is a new feature there is no guaranteed schedule for it's implementation.
I've built htop from git master as of today and still see the offline CPUs.
@hyder365: you will see that until you develop a patch, create a pull request, get that accepted and finally merged (or somebody else thinks this is request is worth being implemented and does it)
Ok. The comment by @sergey-dryabzhinsky led me to believe it was fixed in the master branch.
@hyder365: you will see that until you develop a patch, create a pull request, get that accepted and finally merged (or somebody else thinks this is request is worth being implemented and does it)
I think it's worth doing also, fwiw. As will likely any other heavy user of LXC.
I am impacted as well, having just upgraded to Debian Bookworm in an environment where virtual cores are disabled.
In case it can help anyone, there's a way around this issue.
First, you need to configure htop and remove all the CPU displayed by default, and re-add them one by one, half on the left, half on the right.
Then, you need to save the configuration so you don't have to repeat the operation (it takes a little while). On MacOS/iTerm I could do that with the keyboard combination "fn+F10", other systems likely have similar ways of saving the configuration to disk.
edit 1: I see that I messed up slightly as I have added one too many cores; not a problem, I will quickly adjust using the aforementioned method. edit 2: Careful though, this method is not dynamic; if cores that were previously offline are back online, they won't show up automatically anymore.
Unfortunate that such workarounds are needed for so basic a feature after two years.
Unfortunate that such workarounds are needed for so basic a feature after two years.
As this is a new feature its usually not high on the list of priorities, unless people supply a patch with it. Also with any feature involving additional items of configuration we are usually quite reluctant, as this adds a maintenance cost going forward. And the last item is the automatic height adjustment required for this feature to be "dynamically" hiding the meters is a bit more involved than might be visible on first glance: You not only have to determine the number of visible meters dynamically (doable), calculate the needed height from this (doable), but also map each meter to its proper spot (non-trivial if truly dynamic).
If you want to speed up the inclusion of this feature a working patch is a good first step in that direction.
Any update? People with HT disabled get all this wasted space in htop still.