OSDN Git Service

tools/power turbostat: Make interval calculation per thread to reduce jitter
authorYazen Ghannam <yazen.ghannam@amd.com>
Mon, 25 Mar 2019 17:32:42 +0000 (17:32 +0000)
committerLen Brown <len.brown@intel.com>
Sat, 31 Aug 2019 18:48:34 +0000 (14:48 -0400)
commitd4794f25f122aa1a8a073be51112edaa723ffff4
treee5af54bf729d07048fcda38ab7777853724a3dc0
parentd743dae6d1936160366a32f3400f03db1da9421b
tools/power turbostat: Make interval calculation per thread to reduce jitter

Turbostat currently normalizes TSC and other values by dividing by an
interval. This interval is the delta between the start of one global
(all counters on all CPUs) sampling and the start of another. However,
this introduces a lot of jitter into the data.

In order to reduce jitter, the interval calculation should be based on
timestamps taken per thread and close to the start of the thread's
sampling.

Define a per thread time value to hold the delta between samples taken
on the thread.

Use the timestamp taken at the beginning of sampling to calculate the
delta.

Move the thread's beginning timestamp to after the CPU migration to
avoid jitter due to the migration.

Use the global time delta for the average time delta.

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c