A lightweight Qt desktop app that visualizes per-PID energy from the procpower kernel extension in real time (1-second default).
It reads /proc/energy/cgroup, plots a live line chart, shows the latest readings in a sortable table, and includes the raw file for debugging.
- Live chart of energy (kWh) by PID (updates every second by default)
- Sortable table of the latest readings (PID,
comm, energy) - Raw
/proc/energy/cgroupview for debugging - Adjustable polling interval and max points from the UI
- Gaps are handled gracefully when PIDs appear/disappear
- Linux with
procpowerinstalled and/proc/energy/cgroupavailable
Create a virtual environment and install dependencies:
python3 -m venv venv
source venv/bin/activate
pip install PySide6 pyqtgraph numpypython energy_show.pyCommand-line options:
--file PATH Path to /proc/energy/cgroup (default: /proc/energy/cgroup)
--interval MS Polling interval in milliseconds (default: 1000; min: 200)
--max-points N How many points to keep in the rolling chart window (default: 300)
Examples:
# Faster updates
python energy_show.py --interval 500
# Keep a longer history
python energy_show.py --max-points 1200
# Read from a different file
python energy_show.py --file /tmp/cgroup_snapshot- Status (top left): current state and timestamp of last read
- Chart (left): per-PID energy over time; legend autoupdates if a PID’s
commchanges - Table (right): latest readings sorted by energy (desc)
- Raw file (right): the exact content read from
/proc/energy/cgroup
Use the footer controls to tweak Polling interval and Max points while running.
The chart doesn’t move / table stays empty
- The app could not parse any entries. Open the Raw file panel and confirm it contains lines like:
pid=123 energy=456789 ... comm=pythonpid,comm, andenergyare required.
