Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-133858 / 25.10 / Make sure CPU temperature is reported for virtual cores #15514

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Qubad786
Copy link
Contributor

Problem

Currently, the Netdata CPU temperature plugin does not report temperatures for virtual cores.

Solution

Mirror the temperature readings from physical cores to their respective virtual cores, similar to how htop handles it.

Ref: https://unix.stackexchange.com/questions/400605/understanding-core-ids

@Qubad786 Qubad786 requested a review from yocalebo January 29, 2025 10:44
@bugclerk bugclerk changed the title Make sure CPU temperature is reported for virtual cores NAS-133858 / 25.10 / Make sure CPU temperature is reported for virtual cores Jan 29, 2025
@bugclerk
Copy link
Contributor

@truenas truenas deleted a comment from bugclerk Jan 29, 2025
core_id = None

for line in cpu_block.splitlines():
if match := RE_PROCESSOR.match(line):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason to use regex here. Just use if line.startswith('core id')

core_id = match.group(1)

# Ensure valid data is collected before adding to mapping
if processor_id is not None and core_id is not None and processor_id != core_id:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if processor_id is not None and core_id is not None and processor_id != core_id:
if all((processor_id, core_id)) and processor_id != core_id:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants