Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT] Calculating power consumption of a running program?
Date: Wed, 23 Aug 2017 22:54:49
Message-Id: 7723d867-fc55-ba5e-2829-9c7ccbd78893@gmail.com
In Reply to: [gentoo-user] [OT] Calculating power consumption of a running program? by R0b0t1
1 On 24/08/2017 00:29, 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 can use PowerTOP, but it seems to be limited to rough measurements
7 > on the order of tenths of a watt. This measurement can be divided
8 > among the wakeup events in an attempt to calculate software power
9 > consumption but it seems imperfect if I want to monitor a single
10 > process that may be competing relatively equally for resources with
11 > the kernel and other user processes.
12 >
13 > PMBus is a spinoff of SMBus which is a spinoff of I2C which is found
14 > on many motherboards. PMBus is supposed to be the interface which
15 > controls and reports power supply activity. Besides the main kW power
16 > supply, there is usually a power supply near your processor that steps
17 > down 3.3V or 5V to 2.8V, 1.8V, or lower (I've seen as low as 0.8V, but
18 > not on a desktop). I was not aware these had a visible interface.
19 >
20 > Apparently you can talk to these, but my searches can only find code
21 > which seems highly experimental. The other replies seem to be for
22 > embedded Linux systems running on FPGAs and perhaps Cortex-A parts.
23 >
24 > If I were using a microcontroller I could get uA or nA draw per MHz
25 > and I know my operating voltage and operating time. However, desktop
26 > processors are much more complex, and I am not sure if they have been
27 > entirely characterized. The most advanced tool I can find is PowerTOP
28 > and it does not seem very accurate.
29 >
30 > Does anyone have any suggestions? Should I start reading source code
31 > or post on the forums?
32
33 Both of these sound good
34
35 > Or perhaps someone has used PowerTOP and found
36 > it to be reasonably accurate?
37
38 No not this. PowerTOP was designed to find badly-behaving programs like
39 pidgin that woke up and polled it's queue every 1ms or so. It's not for
40 what you want at all, not even close.
41
42
43 >
44 > R0b0t1.
45 >
46
47
48 --
49 Alan McKinnon
50 alan.mckinnon@×××××.com