Commit b312d880 authored by Zhang Rui's avatar Zhang Rui Committed by Len Brown
Browse files

tools/power turbostat: Allow Zero return value for some RAPL registers



turbostat aborted with below messages on a dual-package system,

   turbostat: turbostat.c:3744: rapl_counter_accumulate: Assertion `dst->unit == src->unit' failed.
   Aborted

This is because
1. the MSR_DRAM_PERF_STATUS returns Zero for one package, and non-Zero
   for another package
2. probe_msr() treats Zero return value as a failure so this feature is
   enabled on one package, and disabled for another package.
3. turbostat aborts because the feature is invalid on some package

Unlike the RAPL energy counter registers, MSR_DRAM_PERF_STATUS can
return Zero value, and this should not be treated as a failure.

Fix the problem by allowing Zero return value for RAPL registers other
than the energy counters.

Fixes: 7c6fee25 ("tools/power turbostat: Check for non-zero value when MSR probing")
Reported-by: default avatarArtem Bityutskiy <artem.bityutskiy@intel.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 1c7c7388
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment