IPSN 2013 NSLab study group 2013/06/17 Presented by: Yu-Ting
Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April...
-
date post
20-Dec-2015 -
Category
Documents
-
view
218 -
download
3
Transcript of Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April...
![Page 1: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/1.jpg)
Energy Metering and Tracking with iCount and Quanto
IPSN 2009 Tutorial – San Francisco – April 16th, 2009
Prabal DuttaRodrigo FonsecaThoma Schmid
![Page 2: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/2.jpg)
quanto /’kwänto/
Portuguese (from Latin quantu)
interrogative pronoun - how much, what amount, what quantity, what number, what price
![Page 4: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/4.jpg)
Schedule
• 1:00 – 2:30 Presentation• 2:30 – 3:00 Break• 3:00 – 5:00 Hands on
• Goals:– Present the concepts behind Quanto– Get you excited by instrumenting, running, and
analyzing simple applications
![Page 5: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/5.jpg)
Outline
• Demo: Blink• Introduction• How much energy? iCount
– Principles– Calibration
• What is using my energy?– Energy breakdown
• Why is it using my energy?– Activity Tracking
• Quanto in Practice– Architecture– Interesting Findings– Recording Information
• Hands on Session
![Page 6: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/6.jpg)
Blink Demo
![Page 7: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/7.jpg)
7
Blink: What’s happening?
48 seconds of Blink
DedicatedResources
LogicalThreads ofExecution
SharedResources
![Page 8: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/8.jpg)
8
Energy Pie Chart
Red Green Blue CPU
Where have all the Joules gone?
“Slice” by device
“Track” by activity
48 seconds of Blink
![Page 9: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/9.jpg)
9
Blink: Instrumentation
module BlinkC () { uses interface Timer<TMilli> as Timer0; uses interface Timer<TMilli> as Timer1; uses interface Timer<TMilli> as Timer2; uses interface Leds; uses interface Boot;}
Implementation { event void Boot.booted() {
call Timer0.startPeriodic(250);
call Timer1.startPeriodic(500);
call Timer2.startPeriodic(1000); }
event void Timer0.fired() { call Leds.led0Toggle(); } event void Timer1.fired() { call Leds.led1Toggle(); } event void Timer2.fired() { call Leds.led2Toggle(); }}
module BlinkC () { uses interface Timer<TMilli> as Timer0; uses interface Timer<TMilli> as Timer1; uses interface Timer<TMilli> as Timer2; uses interface Leds; uses interface Boot;}
Implementation { event void Boot.booted() { call CPUActivity.set(ACT_LED0); call Timer0.startPeriodic(250); call CPUActivity.set(ACT_LED1); call Timer1.startPeriodic(500); call CPUActivity.set(ACT_LED2); call Timer2.startPeriodic(1000); }
event void Timer0.fired() { call Leds.led0Toggle(); } event void Timer1.fired() { call Leds.led1Toggle(); } event void Timer2.fired() { call Leds.led2Toggle(); }}
![Page 10: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/10.jpg)
10
Real applications:Many services making concurrent use of same hardware
Hardware Power SupplySensorsMCU Radio Storage
“Trio Network”[Dutta06]
![Page 11: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/11.jpg)
11
Three basic challenges
• Energy metering– Measure energy usage– i(t) p(t) ∫p(t)dt
• Energy breakdown– Slice usage horizontally– Allocate usage to energy
sinks
• Activity tracking– Dice usage vertically– Track causal connections
iCount
iCount+
P-states+
Regression
Labels
![Page 12: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/12.jpg)
Outline
• Demo: Blink• Introduction• How much energy? iCount
– Principles– Calibration
• What is using my energy?– Energy breakdown
• Why is it using my energy?– Activity Tracking
• Quanto in Practice– Architecture– Interesting Findings– Toolchain
• Hands on Session
![Page 13: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/13.jpg)
13
Three basic challenges
• Energy metering– Measure energy usage– i(t) p(t) ∫p(t)dt
• Energy breakdown– Slice usage horizontally– Allocate usage to energy
sinks
• Activity tracking– Dice usage vertically– Track causal connections
iCount
Labels
iCount+
P-states+
Regression
![Page 14: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/14.jpg)
14
Measuring: wide horizontal/vertical dynamic range
TX packet at 1% duty cycle (20 ms / 2 s)
4,000 ms
640,000 ms
86,400,000 ms
[Farkas00]
30 ms
![Page 15: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/15.jpg)
15
Dynamic range in power draw exceeds 10,000:1
< 1 µW
> 50 mW
![Page 16: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/16.jpg)
16
Current energy metering techniques are inadequate
cumbersome, expensive, not distributed,not scalable, not embedded, low resolution
cumbersome, expensive, not distributed,not scalable, not embedded,
low resolution, low responsiveness, high quiescent power
low responsiveness, high cost, high quiescent power
DS2438ADM1191BQ2019BQ27500 [Jiang07]
![Page 17: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/17.jpg)
17
Key insight: Switching regulators inherently meter energy
If your platform has a PFM switching regulator…(many do)
add a wire
iCountenergymeterdesign
![Page 18: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/18.jpg)
18
How does it work?
Source: Maxim Semiconductor
Cin
LxVin
VinCout
Vout
Rload
iLX
Energize
Transfer
Monitor
S1
S2
VLX
E=½Li2
PFMRegulator
![Page 19: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/19.jpg)
19
Each cycle transfers a fixed energy quanta to the load
ΔE=½Li2
P=ΔE/Δt
Counting cycles translates to measuring energy
Regulator Cycles
![Page 20: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/20.jpg)
20
This simple design works surprisingly well
MAX1724
Prototype implementation
[HydroWatch]
(UCB)
[Benchmark](UCB)
[Quanto](UCB)
[Quanto+](UCLA)
[Senseweb](WSU)
![Page 21: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/21.jpg)
21
Hardware costs: wire and counter
“wire”Counter
HydroSolar Node (v2)
![Page 22: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/22.jpg)
22
iCount Performance summary
Performance Metric iCount
Range 1 µA – 100 mA
Accuracy ±10% (±20%, full range)
Resolution 0.1 µJ – 0.5 µJ
Read latency 24 µs
Power overhead 0.01% - 1%
Responsiveness < 125 µs
Precision±1.5% (over 2 secs,
N=167)
Stability ±1% (over 1 week)*
* Frequency averaged over 1 second
![Page 23: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/23.jpg)
Outline
• Demo: Blink• Introduction• How much energy? iCount
– Principles– Calibration
• What is using my energy?– Energy breakdown
• Why is it using my energy?– Activity Tracking
• Quanto in Practice– Architecture– Interesting Findings– Toolchain
• Hands on Session
![Page 24: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/24.jpg)
24
Three basic challenges
• Energy metering– Measure energy usage– i(t) p(t) ∫p(t)dt
• Energy breakdown– Slice usage horizontally– Allocate usage to energy
sinks
• Activity tracking– Dice usage vertically– Track causal connections
iCount
Labels
iCount+
P-states+
Regression
![Page 25: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/25.jpg)
25
Slicing: breaking down the envelope into its parts
Marc A. Viredaz and Deborah A. Wallach,“Power Evaluation of a Handheld Computer”,IEEE Micro, Jan-Feb, 2003
“Itsy”
![Page 26: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/26.jpg)
26
Not all energy sinks can be instrumented
MCU
Radio
Power
Flash Sensors LEDs
Power Data Control
USART
DMA
OSC
Timer ADC
RX TX
LNAPA
CPU
![Page 27: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/27.jpg)
27
A different approach to energy slicing: power state tracking*OnOff
* H. Zeng et al. “ECOSystem: Managing Energy as a First Class Operating Systems Resource”, ASPLOS’02, 2002.
Export device power states
Through a narrow interface
OS tracks/logs state transitions
![Page 28: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/28.jpg)
28
Estimate energy breakdowns with regression
• For every power state transition– Snapshot system-wide power states (α1,…, αn)
– Snapshot global energy usage (ΔE)– Snapshot system clock (Δt)
• Generate an equation of the formΔE/Δt = α1p1 +… +, αnpn
(p’s are the unknown power draws)
• Solve for p’s using weighted multivariate least squares
High-resolution, high-speed energy meter key for good results
Δt
ΔE
α’s pi
![Page 29: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/29.jpg)
29
Example power state equations
ΔE/Δt = α1p1 + α2p2 + α3p3 + α4p4
+ α5p5
2/1 = 1·p1 + 1·p2 + 1·p3 + 1·p4
+ 0·p5
3/1.1 = 1·p1 + 1·p2 + 1·p3 + 1·p4
+ 1·p5
1/0.4 = 1·p1 + 0·p2 + 1·p3 + 1·p4
+ 1·p5
0/0.4 = 1·p1 + 0·p2 + 0·p3 + 1·p4
+ 1·p5
1/0.6 = 1·p1 + 0·p2 + 0·p3 + 0·p4
+ 1·p5
0/0.6 = 1·p1 + 0·p2 + 0·p3 + 0·p4
+ 0·p5
ΔE
α’s pi
Y = ΔE/ΔtAP = YP = A-1Y
W = diag( √(Δt*ΔE) )P = (ATWA)-1ATWY
![Page 30: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/30.jpg)
Outline
• Demo: Blink• Introduction• How much energy? iCount
– Principles– Calibration
• What is using my energy?– Energy breakdown
• Why is it using my energy?– Activity Tracking
• Quanto in Practice– Architecture– Interesting Findings– Toolchain
• Hands on Session
![Page 31: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/31.jpg)
31
Three basic challenges
• Energy metering– Measure energy usage– i(t) p(t) ∫p(t)dt
• Energy breakdown– Slice usage horizontally– Allocate usage to energy
sinks
• Activity tracking– Dice usage vertically– Track causal connections
iCount
Labels
iCount+
P-states+
Regression
![Page 32: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/32.jpg)
32
Tracking: gap between what is measured and what matters
• Itsy measured– Breakdown by
subsystem– For each application
• PowerScope measured:– Breakdown by PC– Breakdown by PID
Marc A. Viredaz and Deborah A. Wallach,“Power Evaluation of a Handheld Computer”,IEEE Micro, Jan-Feb, 2003
Jason Flinn and M. Satyanarayanan,“Energy-Aware Adaptation for Mobile Apps.”,SOSP’99, Kiawah Island, SC, 1999
![Page 33: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/33.jpg)
33
What’s wrong with subsystems, PCs, and PIDs?
• Subsystem– No distinction between different logical activities– Is radio sending a routing beacon or data packet?
• Program Counter– Pinpoints code hotspots– But, not the data on which the code operates– Routing beacon? Time sync packet? Data packet?
• Process ID– Most sensornet applications are I/O bound– Most energy is spent outside the CPU– For I/O-bound processes, PID-based sampling is
biased
![Page 34: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/34.jpg)
34
Activities* are what actually matters
* M.B. Jones et al., “Modular Real-Time Resource Management in the Rialto Operating System”, HotOS’95, 1995. G. Banga et al. “Resource Containers: A New Facility for Resource Management in Server Systems”, OSDI’99, 1999. H. Zeng et al. “ECOSystem: Managing Energy as a First Class Operating Systems Resource”, ASPLOS’02, 2002.
• A causally-connected set of operations…• whose distinct resource consumptions…• should be grouped together for accounting*
![Page 35: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/35.jpg)
35
Three steps to activity tracking
• Annotating– Any abstraction can introduce an annotation– Associates an activity “label” with an execution– Labels are < origin-node : activity-identifier > pairs
• Propagating– System software transfers activity labels– Across subsystems, nodes, and deferred
computations
• Recording– Track, log, and post-process resource usage
![Page 36: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/36.jpg)
36
Annotating an activity “paints” causally-connected actions
• “Sensing” involves– Sensor...– CPU, ADC, I2C bus, …
• “Storing” involves– Flash…– CPU, SPI bus, timers, …
• Initiate annotation withCPUActivity.set(<label>)
• Quanto automatically propagates labels
...CPUActivity.set(ACT_SENSING);Sensor.read();...CPUActivity.set(ACT_STORING);Flash.write(...);...
CPU
Sensor
Flash
Node A
Act: sensingAct: storing
![Page 37: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/37.jpg)
37
Propagating labels over deferred computations
• Examples– CPU Post task (deferred function call) CPU– CPU Queue object CPU
• Task Scheduler– Add activity field to task structure– Set activity field on task posting– Restore activity on task invocation
• Queue– Tag each entry with its activity label– Write activity label on enqueue– Restore activity label on dequeue
![Page 38: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/38.jpg)
38
Propagating labels over the network
CPU
Flash
Radio
Node B
CPU
Sensor
Radio Node A
Act: sensing Act: sending
Proxy Rx activity Packet Tx
• Add hidden field to packet• Sender’s OS sets activity
field
Radio.send(message_t* msg) {
. . .
msg->header->activity = CPUActivity.get();
. . .
}
![Page 39: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/39.jpg)
39
Propagating unknown labels using proxy activities
CPU
Flash
Radio
Node B
CPU
Sensor
Radio Node A
Act: sensing Act: sending
Proxy Rx activity Packet Tx
• Every interrupt causes energy consumption
• before activity label is identified– Interrupt CPU– Timer CPU– Radio CPU
• Proxy activity provides ephemeral label
• Binding with real activity occurs when label is clear
message_t* Radio.recv(message_t* msg,
void* payload, uint8_t len) {
. . .
CPUActivity.bind(msg->hdr->activity);
. . .
}
![Page 40: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/40.jpg)
40
Concurrent activities on shared resources
async command void Timer.start() {
call TimerActivity.add(call CPUActivity.get());
...
}
async event void HardwareTimer.fired() {
signal Timer.fired();
call TimerActivity.remove(call CPUActivity.get());
...
}
Activity A
Activity B
Timer Power State
Timer.firedTimer.start
Timer.firedTimer.start
A A/B BTimer Activities
Add A Add B Rem A Rem BTime
![Page 41: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/41.jpg)
41
Three basic challenges
• Energy metering– Measure energy usage– i(t) p(t) ∫p(t)dt
• Energy breakdown– Slice usage horizontally– Allocate usage to energy
sinks
• Activity tracking– Dice usage vertically– Track causal connections
iCount
iCount+
P-states+
Regression
Labels
![Page 42: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/42.jpg)
Outline
• Demo: Blink• Introduction• How much energy? iCount
– Principles– Calibration
• What is using my energy?– Energy breakdown
• Why is it using my energy?– Activity Tracking
• Quanto in Practice– Architecture– Interesting Findings– Recording Information
• Hands on Session
![Page 43: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/43.jpg)
43
Summary of Quanto energy profiling architecture
Device Drivers
Hardware
Application
Operating System
<PowerStateTrack>, <SingleActivityTrack>, <MultiActivityTrack>, <EnergyMeter>
<PowerState>, <SingleActivity>, <MultiActivity>
propagate labels over deferred computations
monitor/expose power statessave/restore/expose activity
meter energy usage
annotate code with activity labels
propagate labels to/from devices
log and process activity/power data
![Page 44: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/44.jpg)
44
Interesting Findings: catching power bugs.Why is TIMERA firing at 16Hz?!?
![Page 45: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/45.jpg)
45
How much time and energy does using DMA really save?
Using DMA can subvert MAC layer fairness
![Page 46: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/46.jpg)
46
What’s the cost of false alarms in Low-Power Listening?
Preamble DTX
RX D
Tlisten Noise
Overhearing adds significant unpredictability to node lifetime
![Page 47: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/47.jpg)
47
Recording: log, export, and post-process data
• Challenge is getting data off the node• Reason most applications are still toys
Burst:10KB RAM Log
+ UART Out
Burst128K FIFO Log+ UART Out
Continuous:Compression+ UART Out
Continuous:Parallel Out+ Ethernet
![Page 48: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/48.jpg)
Logging Solutions
• Log to RAM:– 12 bytes per logged event– Buffer for 700 events– Dump to UART once buffer is full
• Log to parallel port– Fast, real-time logging– Not scalable to multiple nodes
• Log to the UART, compressed– Blink running at 50ms, no compression: logging takes 80.9%
of CPU time– With compression: 25% of CPU time, compression of
3.84X (each log entry ~ 3.1 bytes)– Not enough for larger applications
• RadioCountToLeds, 2 nodes @100ms:– 427 ev/s– With LPL: 1617 ev/s
![Page 49: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/49.jpg)
Logging Solutions
• Don’t trace: count• Step 1: online accounting of activities
– Time per activity per resource– Almost ready
• Step 2: online regression– Accumulating power state info– Doing regression online
• Current Status– The next release of Quanto will have online
accounting of the activity times
![Page 50: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/50.jpg)
Hands-on Section
• Instrument, record data, process, visualize– Basic: Blink– Cross-network: RadioCountToLeds
• If we have time:– LPL: Bounce– Another example: FTSP
![Page 51: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/51.jpg)
Questions
![Page 52: Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.](https://reader036.fdocuments.in/reader036/viewer/2022062714/56649d415503460f94a1b13e/html5/thumbnails/52.jpg)
References
• Quanto Website:– http://quanto.cs.berkeley.edu
• Quanto code:– tinyos-2.x-contrib/berkeley/quanto
• Network Management Interface:
• Papers:– “Energy Metering for Free: Augmenting Switching Regulators
for Real-Time Monitoring” Prabal Dutta, Mark Feldmeier, Joseph Paradiso, David Culler. IPSN’08
– “Quanto: Tracking Energy in Networked Embedded Systems”, Rodrigo Fonseca, Prabal Dutta, Philip Levis, and Ion Stoica. OSDI’08