Closed retunelars closed 1 year ago
I could do that, but there are three issues doing it that way:
There is nothing in the hwmon system to collect such statistics and misusing hwmon for this would annoy other kernel developers. So I would provide it via debugfs, just like the uptimes.
Data is only collected if the sysfs/debugfs entries are read, there is no continuously collecting going on. I can only update the statistics if the corresponding sysfs/debugfs entry is read. That also means you have to provide the "external tick" and this also means, you could do your own value comparison to find the max value.
If I add that functionality it will go into the enhanced driver. There is no way this will be accepted into mainline, because that kind of work usually goes into userspace and has no place in kernelspace.
Sounds like a good solution to me.
I have to correct myself. The hwmon subsystem indeed includes mechanisms for statistical data. Though, for that I have to redesign the driver to some degree to add a tick (background task that triggers the sensors, lets say every second). For now I will commit the debugfs approach which also seems to work.
I will try to add using of hwmon statistics to the enhanced driver, just a matter of time.
I was wondering if it would be possible to expose maximum statistics for relevant metrics, for example power consumption? This can of course be monitored via the hwmon files, but I assume that given the high frequency needed for this monitoring, it can be done better in the driver. Such a feature would be helpful in order to see the maximum power consumption observed in relation to the PSUs rated specification.