29 releases
Uses new Rust 2024
| new 0.2.2 | Jun 3, 2026 |
|---|---|
| 0.2.1 | Mar 20, 2026 |
| 0.1.25 | Feb 20, 2026 |
| 0.1.24 | Aug 26, 2025 |
| 0.1.9 | Jul 24, 2024 |
#214 in Profiling
131 downloads per month
Used in 3 crates
(2 directly)
24KB
382 lines
RAPL Energy
Reading CPU energy consumption and controlling CPU power limits through RAPL.
Reading RAPL requires elevated permissions.
RAPL permissions
- Create a new
raplgroup.
sudo groupadd rapl
sudo usermod -aG rapl $USER
- Create a new file
sudo nano /etc/udev/rules.d/70-intel-rapl.rulesand add the following rule.
ACTION=="add", SUBSYSTEM=="powercap", KERNEL=="intel-rapl:*", \
RUN+="/usr/bin/chgrp rapl /sys/%p/energy_uj", \
RUN+="/usr/bin/chmod g+r /sys/%p/energy_uj"
Reboot, and check if you can read cat /sys/class/powercap/intel-rapl:*/energy_uj
Dependencies
~0.6–1.4MB
~26K SLoC