Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data...

64
Carat: Collaborative Detection of Energy Bugs Adam Oliner, Anand Iyer, and Ion Stoica AMP Lab, UC Berkeley Eemil Lagerspetz, Sasu Tarkoma U of Helsinki

Transcript of Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data...

Page 1: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Carat: Collaborative Detection of Energy Bugs

Adam Oliner, Anand Iyer, and Ion StoicaAMP Lab, UC Berkeley

Eemil Lagerspetz, Sasu TarkomaU of Helsinki

Page 2: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Mobile is Hot• ... sometimes, literally:

2

Page 3: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

A Day in the Life

3

Page 4: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

A Day in the Life

3

Page 5: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

A Day in the Life

3

Page 6: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

A Day in the Life

3

Page 7: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

A Day in the Life

3

Page 8: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

A Day in the Life

3

Page 9: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

A Day in the Life

3

Page 10: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

A Day in the Life

3

Page 11: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

A Day in the Life

3

Page 12: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Users’ Questions• Why is my battery draining?

• Is that normal?

• What can I do about it?

4

Page 13: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Prior Approaches• Ad hoc

• e.g., no-sleep bug

• Intrusive

• Generic

• “Kill all background apps”

• “Dim the screen”

5

Page 14: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Prior Approaches• Ad hoc

• e.g., no-sleep bug

• Intrusive

• Generic

• “Kill all background apps”

• “Dim the screen”

5

Page 15: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Our Approach

instrumentationdata

actions andreports

Spark onEC2

thecrowd

thecloud

bigdata

raw andderived data

statistical analysis

DynamoDBand S3

Page 16: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Our Approach

instrumentationdata

actions andreports

Spark onEC2

thecrowd

thecloud

bigdata

raw andderived data

statistical analysis

First collaborative approach for diagnosing energy problems.

DynamoDBand S3

Page 17: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Carat• Mobile app for iOS and Android

• Personalized energy debugging

• What is misbehaving

• Whether that is normal

• What you can do about it

• How much it will help

7

Page 18: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Carat

Page 19: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Today• Collecting data

• Generating results

• Quantifying uncertainty

• Real-world deployment

9

Page 20: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Carat Sampling

t1 WiFi? iOS5.1? ...

Page 21: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Carat Sampling

t1 WiFi? iOS5.1? ...

t2 WiFi? iOS5.1? ...

Page 22: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Carat Sampling

t1 WiFi? iOS5.1? ...

t2 WiFi? iOS5.1? ...

t3 WiFi? iOS5.1? ...

Page 23: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Carat Sampling

t4 WiFi? iOS5.1? ...

t1 WiFi? iOS5.1? ...

t2 WiFi? iOS5.1? ...

t3 WiFi? iOS5.1? ...

Page 24: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

t2 WiFi? iOS5.1? ...

t1 WiFi? iOS5.1? ...

Computing Rates

Page 25: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

t2 WiFi? iOS5.1? ...

t1 WiFi? iOS5.1? ...

Computing Rates

∆t

∆t

Page 26: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

t2 WiFi? iOS5.1? ...

t1 WiFi? iOS5.1? ...

Computing Rates

∆t∆% = discharge rate (%/s)

∆%

Page 27: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

t2 WiFi? iOS5.1? ...

t1 WiFi? iOS5.1? ...

Computing Rates

∆t∆% = discharge rate (%/s)

F

| F

Page 28: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Energy Hog

Energy Rate (% / s)

Prob

abili

tyF

Page 29: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Energy Hog

Energy Rate (% / s)

Prob

abili

tyF

Page 30: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Energy Hog

Energy Rate (% / s)

Prob

abili

tyF

Page 31: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Energy Hog

Energy Rate (% / s)

Prob

abili

tyF

energy hog

Page 32: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Energy Bug

Energy Rate (% / s)

Prob

abili

ty

Page 33: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Energy Bug

Energy Rate (% / s)

Prob

abili

ty

Without the crowd, there is no way to know whether this use is normal.

Page 34: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Energy Bug

Energy Rate (% / s)

Prob

abili

ty

(Given is not a Hog.)

Page 35: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Energy Bug

Energy Rate (% / s)

Prob

abili

tyenergy bug

(Given is not a Hog.)

Page 36: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Original Distribution

14

Energy Rate (% / s)

Prob

abili

ty

Page 37: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Original Distribution

14

Energy Rate (% / s)

Prob

abili

ty

E[reference]E[subject]

Page 38: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Original Distribution

14

Energy Rate (% / s)

Prob

abili

ty

E[reference]E[subject]

D

Page 39: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Mean Distribution

15

E[Energy Rate] (% / s)

Prob

abili

ty

E[subject]E[reference]

Page 40: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Error and Confidence

16

E[Energy Rate] (% / s)

Prob

abili

ty

EV

Page 41: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Error and Confidence

16

E[Energy Rate] (% / s)

Prob

abili

ty

EV ± e %/s50% confidence

Page 42: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

± E %/s95% confidence

Error and Confidence

16

E[Energy Rate] (% / s)

Prob

abili

ty

EV

Page 43: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Confidence Factors

17

EV

Energy Rate (% / s)

Prob

abili

ty

Page 44: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Confidence Factors

17

EV

Energy Rate (% / s)

Prob

abili

ty

Page 45: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Confidence Factors

17

EV

Energy Rate (% / s)

Prob

abili

ty

Page 46: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Classification

18

Energy Rate (% / s)Pr

obab

ility

Energy Rate (% / s)

Prob

abili

ty

Energy Rate (% / s)

Prob

abili

ty

Fnot-F

Page 47: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Classification

18

Energy Rate (% / s)Pr

obab

ility

Energy Rate (% / s)

Prob

abili

ty

Energy Rate (% / s)

Prob

abili

ty

Fnot-F

Page 48: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Classification

18

Energy Rate (% / s)Pr

obab

ility

Energy Rate (% / s)

Prob

abili

ty

Energy Rate (% / s)

Prob

abili

ty

Fnot-F

Page 49: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Diagnosis

19

a

not-v

x

Page 50: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Diagnosis

19

a

not-v

x

“Killing app a will give x±e of battery life

(95% confidence), as would upgrading the

OS to version v.”

Page 51: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Initial Deployment• TestFlight over-the-air beta

• 100 sign-ups (Apple’s max)

• 75 installs

• Collected 10,000+ samples

20

Page 52: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Initial Results• Found 35 apps exhibiting energy bugs

• e.g., Facebook, Kindle, Flipboard

• Corroborated with forum posts, news articles, and data correlations

• Injected three bugs in Wikipedia

• Detected all of them

21

Page 53: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Flipboard Bug• Digital magazine app

• Bug on 6 clients

• Support thread: iOS 5.0.1

• Confirmed by our data

• OS upgrade → 44m 17s improvement

22

Page 54: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Kindle Bug• E-book reader

• Bug on 5 clients

• Forum: WhisperSync

• Confirmed by our data

• Turn on WiFi → 1h 33m improvement

23

Page 55: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Suddenly...

Page 56: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Suddenly...

Page 57: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Suddenly...

Page 58: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Suddenly...

Page 59: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Suddenly...

Page 60: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

Suddenly...

Carat went viral. In 24 hours, there were dozens of articles and we had

more than 100,000 users.

Page 61: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Carat Today• 320,000+ devices

• 190,000+ on iOS

• 130,000+ on Android

• 20M+ samples

• 20,000+ hogs and 2M+ buggy instances

25

Page 62: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Some Lessons Learned• Cloud ≠ free scaling

• “Research product” cuts both ways

• Contract with the crowd

26

Page 63: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

Next Steps• Quantifying and improving confidence

• API for developers

• Deploy to the crowd; debug in the cloud

• Platform for collaborative debugging

• Statistics as a service

27

carat.cs.berkeley.edu

Page 64: Carat: Collaborative Detection of Energy Bugs - The UC Berkeley Big Data …ampcamp.berkeley.edu/wp-content/uploads/2012/06/adam-o... · 2012-08-22 · cloud big data raw and derived

AMP Camp 22/08/12

FinYou have reached the end of the presentation. Please turn back.

28