Skip to content

cpuinfo: parse arm64 CPU identity fields (implementer/variant/part/revision) - #876

Open
CodeAlex52 wants to merge 2 commits into
prometheus:masterfrom
CodeAlex52:fix/arm64-cpuinfo-identity
Open

CodeAlex52 wants to merge 2 commits into
prometheus:masterfrom
CodeAlex52:fix/arm64-cpuinfo-identity

Conversation

@CodeAlex52

Copy link
Copy Markdown

Summary

The arm64 cpuinfo parser only read processor, BogoMIPS, Features and model name. arm64 kernels do not emit a model name line, so VendorID, CPUFamily, Model and Stepping were always empty and node_cpu_info lost all CPU identity labels on arm64 hosts.

Root cause

The arm64 kernel (arch/arm64/kernel/cpuinfo.c) identifies each CPU through the CPU implementer, CPU variant, CPU part and CPU revision lines; the parser ignored all four.

Fix

Parse those lines into the existing identity fields, preserving the parser's per-processor structure (each processor block repeats the implementer/variant/part/revision values). Non-arm64 behavior is unchanged.

Testing

Fixes #875

…vision)

The arm64 parser only read processor/BogoMIPS/Features/model name.
arm64 kernels do not emit a "model name" line, so VendorID, CPUFamily,
Model and Stepping were always empty and node_cpu_info lost all CPU
identity labels on arm64 hosts.

Parse the CPU implementer/variant/part/revision lines into the existing
identity fields, following the kernel's arch/arm64/kernel/cpuinfo.c
output.  Non-arm64 behavior is unchanged.

Regression: two-CPU arm64 fixture asserting the identity fields.

Closes prometheus#875

Signed-off-by: CodeAlex <59381946+CodeAlex52@users.noreply.github.com>
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.

cpuinfo: arm64 parser ignores CPU implementer/variant/part/revision, so CPU identity is empty on arm64 servers

1 participant