linux/drivers/thermal
Viresh Kumar 8ea229511e thermal: Add cooling device's statistics in sysfs
This extends the sysfs interface for thermal cooling devices and exposes
some pretty useful statistics. These statistics have proven to be quite
useful specially while doing benchmarks related to the task scheduler,
where we want to make sure that nothing has disrupted the test,
specially the cooling device which may have put constraints on the CPUs.
The information exposed here tells us to what extent the CPUs were
constrained by the thermal framework.

The write-only "reset" file is used to reset the statistics.

The read-only "time_in_state_ms" file shows the time (in msec) spent by the
device in the respective cooling states, and it prints one line per
cooling state.

The read-only "total_trans" file shows single positive integer value
showing the total number of cooling state transitions the device has
gone through since the time the cooling device is registered or the time
when statistics were reset last.

The read-only "trans_table" file shows a two dimensional matrix, where
an entry <i,j> (row i, column j) represents the number of transitions
from State_i to State_j.

This is how the directory structure looks like for a single cooling
device:

$ ls -R /sys/class/thermal/cooling_device0/
/sys/class/thermal/cooling_device0/:
cur_state  max_state  power  stats  subsystem  type  uevent

/sys/class/thermal/cooling_device0/power:
autosuspend_delay_ms  runtime_active_time  runtime_suspended_time
control               runtime_status

/sys/class/thermal/cooling_device0/stats:
reset  time_in_state_ms  total_trans  trans_table

This is tested on ARM 64-bit Hisilicon hikey620 board running Ubuntu and
ARM 64-bit Hisilicon hikey960 board running Android.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2018-04-02 21:49:01 +08:00
..
broadcom thermal: add brcmstb AVS TMON driver 2017-10-31 19:32:19 -07:00
int340x_thermal thermal: int3400_thermal: fix error handling in int3400_thermal_probe() 2018-01-13 21:19:25 +08:00
qcom thermal: qcom: tsens: Fix return value check in init_common() 2016-09-27 14:02:16 +08:00
samsung thermal: exynos: constify thermal_zone_of_device_ops structures 2017-08-11 11:38:30 +08:00
st thermal: Enhance thermal_zone_device_update for events 2016-09-27 14:35:21 +08:00
tegra thermal: tegra: remove forward declarations 2018-01-01 10:51:02 -08:00
ti-soc-thermal Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2017-11-17 14:31:27 -08:00
armada_thermal.c thermal: armada: Give meaningful names to the thermal zones 2018-01-01 13:27:21 -08:00
clock_cooling.c thermal: convert clock cooling to use an IDA 2017-01-04 12:47:28 +08:00
cpu_cooling.c cpu_cooling: Drop static-power related stuff 2017-12-07 22:52:01 +01:00
da9062-thermal.c thermal: da9062/61: Thermal junction temperature monitoring driver 2017-04-06 21:48:03 -07:00
db8500_thermal.c thermal: db8500: Fix module autoload 2016-11-23 10:07:35 +08:00
devfreq_cooling.c trace: thermal: add another parameter 'power' to the tracing function 2017-05-05 15:54:45 +08:00
dove_thermal.c thermal: consistently use int for temperatures 2015-08-03 23:15:50 +08:00
fair_share.c thermal: fix source code documentation for parameters 2017-06-29 10:46:31 +08:00
gov_bang_bang.c thermal: bang-bang governor: act on lower trip boundary 2016-09-27 14:02:16 +08:00
hisi_thermal.c thermal/drivers/hisi: Remove bogus const from function return type 2018-01-02 10:44:58 -08:00
imx_thermal.c thermal: imx: update to new formula according to NXP AN5215 2018-01-01 11:49:01 -08:00
intel_bxt_pmic_thermal.c thermal: bxt: remove redundant variable trip 2017-11-02 16:29:58 +08:00
intel_pch_thermal.c thermal: pch: Add Cannon Lake support 2017-11-02 16:30:44 +08:00
intel_powerclamp.c thermal/intel_powerclamp: pr_err()/pr_info() strings should end with newlines 2017-10-17 15:56:06 +08:00
intel_quark_dts_thermal.c x86/platform/iosf_mbi: Remove duplicate definitions 2015-12-09 01:18:34 +01:00
intel_soc_dts_iosf.c thermal: Enhance thermal_zone_device_update for events 2016-09-27 14:35:21 +08:00
intel_soc_dts_iosf.h
intel_soc_dts_thermal.c Thermal: Intel SoC DTS: Change interrupt request behavior 2017-05-05 16:00:10 +08:00
Kconfig thermal: Add cooling device's statistics in sysfs 2018-04-02 21:49:01 +08:00
kirkwood_thermal.c thermal: consistently use int for temperatures 2015-08-03 23:15:50 +08:00
Makefile ARM: SoC driver updates for v4.15 2017-11-16 16:05:01 -08:00
max77620_thermal.c thermal: max77620: fix pinmux conflict on reprobe 2017-06-13 11:07:32 +02:00
mtk_thermal.c thermal: mtk: Cleanup unused defines 2018-01-01 11:56:54 -08:00
of-thermal.c drivers: thermal: remove duplicate includes 2017-12-27 10:09:05 +08:00
power_allocator.c thermal: power_allocator: fix one race condition issue for thermal_instances list 2017-12-27 10:13:20 +08:00
qcom-spmi-temp-alarm.c thermal/drivers/qcom-spmi: Use devm_iio_channel_get 2017-10-31 19:32:17 -07:00
qoriq_thermal.c thermal: qoriq: constify thermal_zone_of_device_ops structures 2017-08-11 11:38:29 +08:00
rcar_gen3_thermal.c thermal: rcar_gen3_thermal: fix initialization sequence for H3 ES2.0 2017-10-31 19:32:14 -07:00
rcar_thermal.c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2016-10-12 11:05:23 -07:00
rockchip_thermal.c thermal: rockchip: Support the RV1108 SoC in thermal driver 2017-10-31 19:32:13 -07:00
spear_thermal.c thermal: spear: use __maybe_unused for PM functions 2016-02-09 14:12:08 -08:00
step_wise.c thermal/drivers/step_wise: Fix temperature regulation misbehavior 2017-10-31 19:32:17 -07:00
tango_thermal.c thermal: tango: Fix module autoload 2016-11-23 10:07:35 +08:00
thermal_core.c thermal: Add cooling device's statistics in sysfs 2018-04-02 21:49:01 +08:00
thermal_core.h thermal: Add cooling device's statistics in sysfs 2018-04-02 21:49:01 +08:00
thermal_helpers.c thermal: Add cooling device's statistics in sysfs 2018-04-02 21:49:01 +08:00
thermal_hwmon.c thermal: thermal_hwmon: Convert to hwmon_device_register_with_info() 2018-01-15 13:56:33 +08:00
thermal_hwmon.h
thermal_sysfs.c thermal: Add cooling device's statistics in sysfs 2018-04-02 21:49:01 +08:00
thermal-generic-adc.c thermal/drivers/generic-iio-adc: Switch tz request to devm version 2017-10-31 19:32:17 -07:00
uniphier_thermal.c thermal: uniphier: add UniPhier thermal driver 2017-08-11 10:49:52 +08:00
user_space.c thermal: fix source code documentation for parameters 2017-06-29 10:46:31 +08:00
x86_pkg_temp_thermal.c thermal/x86 pkg temp: Remove debugfs_create_u32() casts 2018-01-13 21:20:58 +08:00
zx2967_thermal.c thermal: zx2967: constify thermal_zone_of_device_ops structures 2017-08-11 11:38:30 +08:00