Skip to content

Normalize physical core ID when showCPUSMTLabels is set#1940

Merged
natoscott merged 3 commits intohtop-dev:mainfrom
tjk213:normalized-physcore-id
Apr 6, 2026
Merged

Normalize physical core ID when showCPUSMTLabels is set#1940
natoscott merged 3 commits intohtop-dev:mainfrom
tjk213:normalized-physcore-id

Conversation

@tjk213
Copy link
Copy Markdown
Contributor

@tjk213 tjk213 commented Apr 5, 2026

Summary

This PR normalizes the physical core IDs used when the showCPUSMTLabels option is set.

Changes

  • add coreIndex in LinuxMachine which tracks normalized ID
  • return coreIndex in Machine_getCPUPhysicalCoreID()

Motivation

This fixes the IDs displayed on systems with non-contiguous core IDs such as the xeon system that @lilydjwg tested on in #1902
cpuinfo.txt

Future Work

It would be cool to have a mode that renders the CPU IDs as socket.core.thread, but this requires more than the three characters of space currently available.

Comment thread linux/LinuxMachine.c
Comment thread linux/LinuxMachine.c Outdated
@tjk213 tjk213 force-pushed the normalized-physcore-id branch from 3e0d0da to d515e2e Compare April 5, 2026 22:37
Comment thread linux/LinuxMachine.c
Co-authored-by: Kang-Che Sung (宋岡哲) <Explorer09@gmail.com>
@tjk213 tjk213 force-pushed the normalized-physcore-id branch from d515e2e to c616371 Compare April 5, 2026 23:43
@natoscott natoscott merged commit c616371 into htop-dev:main Apr 6, 2026
20 checks passed
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.

3 participants