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(-)
--
2.51.0