Skip to content

lisa.energy_meter: Cleanup EnergyMeter configuration

Douglas Raillard requested to merge github/fork/douglas-raillard-arm/_pr95 into next

Use one configuration class per type of EnergyMeter, so that all keys are properly described, and each of them will get an independent configuration format to be used with EnergyMeter.from_conf()

Disclaimer: that is untested code Disclaimer 2: the change has only been done for HWMon as an example, the same would need to be done for the other classes as well.

Using it would give:

target = ...
res_dir = ...
conf = HWMonConf.from_yaml_map('path/to/hwmon_conf.yml')
emeter = HWMon.from_conf(target, conf, res_dir)

With hwmon_conf.yml:

hwmon-conf:
     channel-map: ...

OR

target = ...
res_dir = ...
emeter = HWMon(target, channel_map=..., res_dir=res_dir)

HWMonConf documentation would describe the available keys just like FtraceCollectorConf does.

Merge request reports