Reimplement tegra with read directly from sysfs
This merge request introduces a complete reimplementation of the Tegra backend. The previous approach has been replaced with a more robust and flexible solution that reads power consumption data directly from the hwmon sysfs interface. The new implementation dynamically detects available power sensors, ensuring compatibility across different NVIDIA Jetson platforms.
At the core of this rework is the Powermon class, which manages sensor discovery, voltage and current readings, and power computation. This replaces the previous method, which relied on tegrastats logging.
The new approach improves reliability and has been tested on an NVIDIA AGX Orin, confirming correct sensor detection and power readings. By reading voltages and currents directly from hwmon, this implementation offers significantly higher time resolution than the previous version.
The plot below compares the new backend against PowerSensor3, demonstrating its excellent time resolution:
Note that the offset added to Tegra's total power accounts for the energy consumption of the carrier board, which is not measured by the onboard sensors.