Skip to content

explorer/cpu_sockets: Fix counting for QEMU processor models #131

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

Merged

Conversation

sideeffect42
Copy link
Member

Without proper anchors, the word "processor" in e.g. "Common KVM processor" is also counted as a CPU socket. This is, of course, incorrect.

~ # grep -cF 'processor' /proc/cpuinfo
2
~ # grep -F 'processor' /proc/cpuinfo
processor	: 0
model name	: Common KVM processor

This commit uses the same grep(1) command which is also used in cpu_cores as a fallback.

Without proper anchors, the word "processor" in e.g. "Common KVM
processor" is also counted as a CPU socket. This is, of course,
incorrect.

	~ # grep -cF 'processor' /proc/cpuinfo
	2
	~ # grep -F 'processor' /proc/cpuinfo
	processor	: 0
    model name	: Common KVM processor

This commit uses the same grep(1) command which is also used in
cpu_cores as a fallback.
@sideeffect42 sideeffect42 requested a review from 4nd3r April 6, 2025 15:27
@4nd3r 4nd3r merged commit 2356ac5 into skonfig:main Apr 6, 2025
1 check passed
@sideeffect42 sideeffect42 deleted the fix/explorer/cpu_sockets/grep-anchors branch April 7, 2025 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants