A useful feature on modern x86 CPUs is the Running Average Power Limit (RAPL) that allows one to monitor System on Chip (SoC) power consumption. Combine this data with the ability to accurately measure CPU cycles and instructions via perf and we can get some way to get a rough estimate energy consumed to perform a single operation on the CPU.
power-calibrate is a simple tool that hacked up to perform some synthetic loading of the processor, gather the RAPL and CPU stats and using simple linear regression to compute some power related metrics.
In the example below, I run power-calibrate on an Intel i5-3210M (2 Cores, 4 threads) with each test run taking 10 seconds (-r 10), using the RAPL interface to measure power and gathering 11 samples on CPU threads 1..4:
The results at the end are estimates based on the gathered samples. The samples are compared to the computed linear regression coefficients using the coefficient of determination (R^2); a value of 1 is a perfect linear fit, less than 1 a poorer fit.
For more accurate results, increase the run time (-r option) and also increase the number of samples (-s option).
Power-calibrate is available in Ubuntu Wily 15.10. It is just an academic toy for getting some power estimates and may be useful to compare compute vs power metrics across different x86 CPUs. I've not been able to verify how accurate it really is, so I am interested to see how this works across a range of systems.