Skip to content

Don't claim PowerCap is missing on a CPUID table miss - #599

Closed
karanshukla wants to merge 1 commit into
intel:masterfrom
karanshukla:fix-powercap-message
Closed

karanshukla wants to merge 1 commit into
intel:masterfrom
karanshukla:fix-powercap-message

Conversation

@karanshukla

Copy link
Copy Markdown
Contributor

check_cpu_id() prints " Need Linux PowerCap sysfs" on any intel_id_table[] miss, without checking whether powercap is actually present.

The message goes back to 9b1fae1, where it was meant to state a requirement rather than a finding: an unmatched CPU can still be driven as long as the kernel exposes powercap sysfs. It reads as a diagnosis, so on a machine where /sys/class/powercap/intel-rapl is fully populated it points at the wrong subsystem. I chased it for a while on an unlisted platform before finding the real cause was the missing table entry (since fixed by dd0eb7e).

This stats the path and reports whichever case applies:

powercap sysfs message
present CPU model not in the supported list, using Linux PowerCap sysfs
absent Unsupported CPU model and no Linux PowerCap sysfs

No behavior change, proc_list_matched and the return value are untouched. Only the log line differs.

Testing

Built clean on master at 19f29af.

The runtime path is hard for me to exercise honestly now: this box is Wildcat Lake, which dd0eb7e added to the table, so !valid is no longer reachable here. Forcing a table miss to reach it needs root and I only confirmed the pieces: csys_fs::exists() resolves to stat(base_path), and /sys/class/powercap/intel-rapl/ stats successfully on this machine, so it would take the first row above. Compile-tested, not run through both branches.

Follow-up to #598, which I closed as a duplicate.

… miss

check_cpu_id() prints " Need Linux PowerCap sysfs" on any intel_id_table[]
miss, without checking whether powercap is actually present. The message
dates to 9b1fae1, where it was meant to state a requirement rather than a
finding: an unmatched CPU can still be driven as long as the kernel exposes
powercap sysfs. It reads as a diagnosis, so on a machine with a fully
populated /sys/class/powercap/intel-rapl it points at the wrong subsystem
and costs time to chase.

Stat the path and report whichever case actually applies.

Signed-off-by: Karan Shukla <karan_shukla@live.com>
@spandruvada

Copy link
Copy Markdown
Contributor

Applied thanks.

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.

2 participants