Re: [PATCH 1/2] tools/power turbostat: Support thermal throttle count print

From: Chen Yu
Date: Fri Feb 11 2022 - 11:14:59 EST


Hi Len,
On Fri, Feb 11, 2022 at 10:14:12AM +0800, Brown, Len wrote:
> What is the scope of this counter -- per-core or per-CPU?
>
The counter is read from
/sys/devices/system/cpu/cpu0/thermal_throttle/core_throttle_count,
which is calculated from MSR_IA32_THERM_STATUS (0x19c) in therm_throt.c.
According to sdm, this MSR is of core scope.

thanks,
Chenyu
> -----Original Message-----
> From: Chen, Yu C <yu.c.chen@xxxxxxxxx>
> Sent: Friday, November 12, 2021 6:52 AM
> To: linux-pm@xxxxxxxxxxxxxxx; Len Brown <lenb@xxxxxxxxxx>
> Cc: Artem Bityutskiy <artem.bityutskiy@xxxxxxxxxxxxxxx>; Rafael J. Wysocki <rafael@xxxxxxxxxx>; Brown, Len <len.brown@xxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx; Chen, Yu C <yu.c.chen@xxxxxxxxx>
> Subject: [PATCH 1/2] tools/power turbostat: Support thermal throttle count print
>
> The turbostat data is collected by end user for power evaluationit. However it looks like we are missing enough thermal context there. Already a couple of time we found that power management developer asking something like this:
> grep -r . /sys/devices/system/cpu/cpu*/thermal_throttle/*
>
> Print the per core thermal throttle count so as to get suffificent thermal context.
>
> turbostat -i 5 -s Core,CPU,CoreThr
> Core CPU CoreThr
> - - 104
> 0 0 61
> 0 4
> 1 1 0
> 1 5
> 2 2 104
> 2 6
> 3 3 7
> 3 7
>
> Suggested-by: Artem Bityutskiy <artem.bityutskiy@xxxxxxxxxxxxxxx>
> Signed-off-by: Chen Yu <yu.c.chen@xxxxxxxxx>