Re: [PATCH V3] thermal: Add cooling device's statistics in sysfs

From: Viresh Kumar
Date: Tue Jan 16 2018 - 05:00:55 EST


On 15-01-18, 08:32, Eduardo Valentin wrote:
> Same set you added for cooling devices should also be reflected on
> thermal zones, but instead of cooling state, you want to do the account
> on trips, at least for the context of this patch set.

I never dived deep into the thermal core earlier and never had to implement any
SoC side of it as well, so consider me a newbie here :)

I tried to look into the core on what I can do to get some stats out for the
zones, but I am a bit confused.

handle_thermal_trip() looked to be the function where I could update stats but
then I realized that this is artificially called for every possible trip in most
of the cases from thermal_zone_device_update() and so this can't be the real
place.

Does it mean that this needs to be updated somehow from the thermal governor's,
->throttle() callback? I am not sure if doing it from every governor code is
what we want to do. And then the trip point of cooling devices can be different
within the same thermal zone.

And so I posted the first patch again without thermal zone stuff in it as that
would take more time.

--
viresh