Gentoo Archives: gentoo-user

From: Alec Ten Harmsel <alec@××××××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT] Calculating power consumption of a running program?
Date: Thu, 24 Aug 2017 01:39:26
Message-Id: 20170824013912.GA3039@bidness
In Reply to: [gentoo-user] [OT] Calculating power consumption of a running program? by R0b0t1
1 On Wed, Aug 23, 2017 at 05:29:13PM -0500, R0b0t1 wrote:
2 > As an example, I am interested in characterizing the power consumption
3 > of rendering a PDF document. I would hopefully only need to run the
4 > renderer once.
5
6 I remember in college some interesting work in security-related stuff
7 that was about characterizing power draw in order to crack passwords.
8 Potentially that could be useful, as you could record the waveforms
9 going into your power supply while rendering a PDF, but it sure sounds
10 complicated.
11
12 > Apparently you can talk to these, but my searches can only find code
13 > which seems highly experimental. The other replies seem to be for
14 > embedded Linux systems running on FPGAs and perhaps Cortex-A parts.
15
16 Even if you could talk to these, taking periodic measurements of
17 current and voltage, then integrating over time would probably give
18 results with large errors.
19
20 > If I were using a microcontroller I could get uA or nA draw per MHz
21 > and I know my operating voltage and operating time. However, desktop
22 > processors are much more complex, and I am not sure if they have been
23 > entirely characterized. The most advanced tool I can find is PowerTOP
24 > and it does not seem very accurate.
25
26 Due to modern processors having things like pipelines and all of the
27 caching and memory pre-fetching going on behind the scenes, it's probably
28 not easy to measure this with any degree of accuracy.
29
30 Have fun,
31
32 Alec

Replies