tools/power turbostat: Fix segfault and restart loop issues
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 13 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | tools/power turbostat: avoid segfault referencing fd_instr_count_percputools/ | +4 | 2 replies | |
| 2/3 | tools/power turbostat: avoid an infinite loop of restartstools/ | +5 | 4 replies | |
| 3/3 | tools/power turbostat: allow turbostat to work when aperf is not availabletools/ | +4 | 7 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] tools/power turbostat: Fix segfault and restart loop issues
This patch series addresses three stability issues found in turbostat, primarily affecting virtualized environments where specific hardware counters (like APERF) or MSR access may be restricted or inconsistent.
Patch 1 fixes a segmentation fault caused by referencing a NULL fd_instr_count_percpu pointer. This occurs on systems where has_aperf is 0 (preventing allocation), but has_aperf_access is 1 (allowing the function call).
Patch 2 prevents an infinite loop when turbostat attempts to restart. It ensures the restart limit is checked in all error paths and removes logic that incorrectly reset the retry counter.
Patch 3 allows turbostat to proceed gracefully when APERF is unavailable. Previously, the missing counter caused delta_thread() to error out, triggering the restart mechanism.
David Arcari (3):
tools/power turbostat: avoid segfault referencing
fd_instr_count_percpu
tools/power turbostat: avoid an infinite loop of restarts tools/power turbostat: allow turbostat to work when aperf is not
available
tools/power/x86/turbostat/turbostat.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
Signature · 1 line
2.51.0