diff options
author | Len Brown <len.brown@intel.com> | 2025-01-27 20:58:42 -0600 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2025-01-27 21:14:18 -0600 |
commit | 5499b5ac0b2c661cc37190a23a4aee9308b3d3ee (patch) | |
tree | 46dfc2e6e796c49f1526111f1053a99ec6a3e193 /net/lapb/lapb_timer.c | |
parent | b32c36975da48afc9089f8b61f7b2dcc40e479d2 (diff) | |
download | linux-5499b5ac0b2c661cc37190a23a4aee9308b3d3ee.tar.gz linux-5499b5ac0b2c661cc37190a23a4aee9308b3d3ee.tar.bz2 linux-5499b5ac0b2c661cc37190a23a4aee9308b3d3ee.zip |
tools/power turbostat: Harden one-shot mode against cpu offline
when turbostat interval mode can't migrate to a CPU, it complains,
prints no data, re-initializes with the new CPU configuration
and starts a new interval.
But this strategy in the face of a CPU hotplug offline during an interval
doesn't help in one-shot mode. When the missing CPU is discovered
at the end of the interval, the forked program has already returned
and there is nothing left for a new interval to measure.
So instead of aborting get_coutners() and delta_cpu() if a missing CPU
is detected, complain, but carry on and output what statistics are
actually present.
Use the same strategy for delta_cpu when aperf:mperf are observed
to have been reset -- complain, but carry on and print data for
the CPUs that are still present.
Interval mode error handling is unchanged.
One-shot mode can now do this:
$ sudo chcpu -e 1 ; sudo ./turbostat --quiet --show PkgWatt,Busy%,CPU chcpu -d 1
CPU 1 enabled
CPU 1 disabled
get_counters: Could not migrate to CPU 1
./turbostat: Counter reset detected
0.036920 sec
CPU Busy% PkgWatt
- 0.00 10.00
0 99.73 10.00
1 0.00
2 91.53
3 16.83
Suggested-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'net/lapb/lapb_timer.c')
0 files changed, 0 insertions, 0 deletions