What are ms/s units in Powertop and how can I get power consumption in watts?
When I use the powertop
command I get the following result:
Summary: 1089.0 wakeups/second, 0.0 GPU ops/seconds, 0.0 VFS ops/sec and 27.2% CPU use
Usage Events/s Category Description
182.5 ms/s 330.0 Process /usr/lib/firefox-esr/firefox-esr --sm-config-prefix /firefox-esr-klqqqA/ --sm-client-id 1012e4d86df26338ae1472160
2.7 ms/s 139.4 Timer hrtimer_wakeup
0.8 ms/s 126.7 kWork od_dbs_timer
4.0 ms/s 95.6 Interrupt PS/2 Touchpad / Keyboard / Mouse
6.4 ms/s 67.4 Process /usr/bin/pulseaudio --start
21.3 ms/s 46.1 Process gnome-shell --sm-client-id 106a72cd31b552c96146814382785334200000065240000
1.7 ms/s 62.6 Process /opt/teamviewer/tv_bin/teamviewerd -d
1.5 ms/s 59.0 Timer tick_sched_timer
0.7 ms/s 47.7 Process [rcu_sched]
20.7 ms/s 22.7 Process /usr/bin/Xorg :0 -novtswitch -background none -noreset -verbose 3 -auth /var/run/gdm3/auth-for-Debian-gdm-y51QIr/
437.3 µs/s 16.5 Process /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-er
0.8 ms/s 12.2 Interrupt [48] nouveau
6.1 ms/s 6.3 kWork nouveau_fence_work_handler
0.9 ms/s 7.5 Process ovs-vswitchd unix:/var/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --mlockall --no-chdir --lo
2.1 ms/s 5.9 Interrupt [6] tasklet(softirq)
619.4 µs/s 5.9 Interrupt [9] RCU(softirq)
181.4 µs/s 5.0 Interrupt [4] block(softirq)
96.6 µs/s 4.3 kWork ieee80211_iface_work
319.2 µs/s 3.7 Process /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session
421.4 µs/s 3.4 kWork ttm_bo_delayed_workqueue
1.1 ms/s 2.1 Process /usr/bin/python /usr/bin/guake
1.7 ms/s 1.0 Interrupt [42] hpet4
146.5 µs/s 1.1 Process nm-applet
15.8 µs/s 1.3 Timer watchdog_timer_fn
94.4 µs/s 1.2 Process /usr/lib/speech-dispatcher-modules/sd_flite /etc/speech-dispatcher/modules/flite.conf
696.9 µs/s 0.9 Interrupt [7] sched(softirq)
1.7 ms/s 0.3 Interrupt [43] hpet5
1.7 µs/s 0.9 kWork blk_delay_work
1.1 ms/s 0.3 Interrupt [41] hpet3
42.3 µs/s 0.7 Process [ksoftirqd/0]
236.3 µs/s 0.6 kWork _brcms_timer
88.7 µs/s 0.6 Process /usr/bin/totem
61.3 µs/s 0.6 Process ovs-vswitchd
51.3 µs/s 0.6 Process /usr/lib/speech-dispatcher-modules/sd_dummy /etc/speech-dispatcher/modules/dummy.conf
1.7 ms/s 0.00 Process top
1.3 µs/s 0.6 kWork cfq_kick_queue
93.6 µs/s 0.6 kWork cache_reap
43.0 µs/s 0.6 Process /usr/lib/speech-dispatcher-modules/sd_espeak /etc/speech-dispatcher/modules/espeak.conf
33.4 µs/s 0.6 Process /usr/lib/speech-dispatcher-modules/sd_cicero /etc/speech-dispatcher/modules/cicero.conf
Some of the 'usage' statistics are in ms/s and others are µs/s. I want to know what these are, and how I can convert them to watts to determine power consumption.
When you have a laptop that can run on battery, in default interactive mode (launching with sudo powertop
) on the overview tab, the first column shows estimated power consumption in mW (milliwatts) or µW (microwatts)
The units in the usage column are ms/s (milliseconds per second) and µs/s (microseconds per second) which show how much time per second the processor is spending on those tasks (so they can't be converted to watts)
PowerTOP 2.8 Overview Idle stats Frequency stats Device stats Tunables
The battery reports a discharge rate of 3.51 W
The estimated remaining time is 9 hours, 32 minutes
Summary: 1017.3 wakeups/second, 7.0 GPU ops/seconds, 0.0 VFS ops/sec and 3.8% CPU use
Power est. Usage Events/s Category Description
1.97 W 50.0% Device Display backlight
980 mW 3.5 pkts/s Device Network interface: wlan0 (brcmfmac_sdio)
100 mW 100.0% Device radio:hci0
43.3 mW 1.1 ms/s 559.1 Interrupt [1] timer(softirq)
22.6 mW 0.8 ms/s 290.8 Timer intel_pstate_timer_func
10.8 mW 15.3 ms/s 31.5 Process /usr/lib/firefox/firefox
9.62 mW 433.2 µs/s 14.6 Process marco
3.79 mW 6.9 ms/s 0.00 Interrupt [7] sched(softirq)
2.22 mW 204.1 µs/s 27.6 Interrupt [6] tasklet(softirq)
2.01 mW 3.6 ms/s 0.05 Process [khugepaged]
1.72 mW 459.2 µs/s 19.2 Process /usr/lib/mate-panel/wnck-applet
1.27 mW 2.2 ms/s 0.9 Process /usr/lib/xorg/Xorg -nolisten tcp :1 vt1 -keeptty -auth /tmp/serverauth.JdmwHkcqKp
1.12 mW 1.0 ms/s 3.4 Process mate-terminal
819 µW 0.7 ms/s 5.5 Process [mmcqd/0]
The man
page for powertop seems to suggest that power usage (the first column) is only available while running on battery. However, I find that this is not the case - it always shows me that column on my Ubuntu machine, which is a laptop with a healthy battery
However @edwinksl very helpfully pointed out that 'a minimum of 270 measurements are needed' running on battery only to give power usage estimates. This is for calibration.
Therefore, it seems that you need to run powertop on battery only for some time before it can give power consumption statistics.
If running on a desktop machine or laptop with no battery of course, this information would never become available. I've tried it with a battery-less laptop (running Arch), and there's no sign of the power usage column.
One more caveat from the user guide - /var/cache/powertop
must be empty for power consumption estimates to show.