I was wondering if you can give me any tools for energy profiling in linux. I'm going to use it to compare between two algorithms that are going to be used on a Raspberry Pi, and if possible, I need it to consider network operations also.

I'm going to use Debian Jessie, but I can use another distro if need be.

  • What is "energy" in this context?
    – joan
    Dec 9, 2015 at 10:12
  • 1
    well, our object will be constrained in energy, so we're trying to find the algorithme that is the least constraining to our power supply, so energy is simply how much watts are spent on the use of this algorithme, but if no such tool exist, we can work with something that gives a good idea of how much energy is spent , like intel energy profiler, who gives cpu-cstate and cpu-pstate as indicators Dec 9, 2015 at 10:20
  • The Pi has an ARM processor. I'm not sure that Intel experience will be relevant.
    – joan
    Dec 9, 2015 at 11:24
  • i don't expect it to be precise or anything like that, but it should give us an idea Dec 9, 2015 at 11:30
  • In the future, please try to put at least a little bit of effort into your capitalization, spelling, and punctuation. It's difficult to care about your question if you don't care enough to ask properly.
    – Jacobm001
    Dec 10, 2015 at 0:20

2 Answers 2


A quick way to gain insight in energy usage, would be powertop. It is in the Debian repositories. Powertop analyses the power usage of your device and gives you some hints on how to reduce it.

For laptops, that makes sense; fewer watts means longer battery time. I am not sure how it would help your Pi though.

[edit]: @joan: I am not sure about non-x86 architectures for powertop.

  • Does that tool work with ARM processors?
    – joan
    Dec 9, 2015 at 10:55
  • 1
    yeah it does ( from the site), but it's supposed to take days to start estimating, is there a way to speed up the process Dec 9, 2015 at 12:32
  • 1
    According to the Debian package page it does: packages.debian.org/jessie/powertop#pdownload Dec 9, 2015 at 12:54
  • 1
    How does this work internally ? So far i know the Pi has no current-measuring capability inside the SoC or even as onboard chip ?
    – flakeshake
    Dec 10, 2015 at 14:02

I'd approach this as a pure hardware problem -- log the current coming from the power supply. To do that you need an ammeter with either logging or output (USB/serial) capability. You could either run the logging code on the Pi itself or another unit (the ammeter itself, another Pi or a PC) for more accuracy as running extra code for logging will itself consume power.

Most modern bench meters have some form of digital output, though many need drivers that aren't available for Linux/ARM. Voltage loggers are more common and you may be able to log the voltage drop across a shunt resistor on the power input.

  • 1
    Of course your Pi has a shunt resistor already - it is called a "polyfuse" and is supposed to provide some protection against some fault conditions that can arise - especially with exposed GPIO pins (some of which carry the main 5V supply). Only issue is that it's resistance is not entirely constant (it is designed to be decidedly non-linear under fault conditions!) however at a constant room temperature and non-tripping fault levels you can calculate the resistance by determining the current with an ammeter temporarily in series (need to cut open a USB-to-microUSB lead perhaps)...
    – SlySven
    Dec 27, 2015 at 0:03
  • ... with the supply, note the current, and the voltage across the polyfuse then you know the resistance, and can use that to determine the current for other voltage drop values without the (non-logging) ammeter WITH THE BIG ASSUMPTION THAT THE POLYFUSE IS NOWHERE NEAR THE CURRENT ASSOCIATED WITH THE SELF-HEATING THAT CAUSES IT TO TRIP!
    – SlySven
    Dec 27, 2015 at 0:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.