48
연세대학교 컴퓨터과학과 모바일 임베디드 시스템 연구실 윤찬민 ([email protected] ) DEVIEW 2013 2013.10.14 Energy Management for Mobile Devices: Power Es8ma8on Technique for Modern Smartphones

144 deview-2013-smartphone pm

Embed Size (px)

Citation preview

Page 1: 144 deview-2013-smartphone pm

연세대학교 컴퓨터과학과  모바일 임베디드 시스템 연구실  

 윤찬민 ([email protected])  

 DEVIEW  2013  2013.10.14  

Energy  Management  for  Mobile  Devices:  Power  Es8ma8on  Technique    for  Modern  Smartphones  

Page 2: 144 deview-2013-smartphone pm

 

Mobile  Pla@orms

Mobile  Embedded  System  Lab.,  Yonsei  University   2  

Feature  Phone Galaxy  S Galaxy  S2 Galaxy  S3

Cellular Bluetooth WiFi NFC

1GHz  Single  core  GSM/HSDPA  

480x800  Display,  4.0  inch                        1500  mAh  baWery

1.2GHz  Dual  core  GSM/HSDPA  

480x800  Display,  4.3  inch        1650  mAh  baWery

1.4GHz  Quad  core  GSM/HSDPA/LTE  

720x1280  Display,  4.8  inch  2100  mAh  baWery

Camera Mic.

Accel Compass

Light GPS

Proximity

Thermometer Gyroscope Barometer

FM  Radio

 GSM  

240x320  Display

Galaxy  S4

1.6GHz  Octa  core  GSM/WCDMA/LTE  

1080x1920  Display(Full  HD),  5.0  inch  2600  mAh  baWery

IrDA

Gesture

Page 3: 144 deview-2013-smartphone pm

Energy  Management  for  Mobile  Devices

Mobile Embedded System Lab., Yonsei University 3

𝛼

Page 4: 144 deview-2013-smartphone pm

Energy  Management  Techniques

Mobile  Embedded  System  Lab.,  Yonsei  University   4  

•  단말/응용 가용시간 예측 •  사용자 요구 및 컨텍스트 반영 •  사용자중심 Energy-aware UX

•  실시간 응용프로그램 에너지 bug/hog 감지

•  응용프로그램의 에너지 특성에 따른 에너지 bug 및 hog 원인 분석 및 리포팅 시스템

Battery Lifetime; User Interaction; Requirement; User Experience; Personalization; Quality of Service; User Context; Spatiotemporal Context, …

Application; Energy Anomaly; Energy Bug; Energy Hog; Energy Leakage; Wakelock; Non-Sleep; Anomaly Detection; Debugging;

Anomaly Reporting, …

사용자 응용 프로그램

•  응용프로그램의 전력 소모 특성 정보 수집 관리 기술

•  가상 배터리 관리 기법 •  Energy-aware OS

•  하드웨어 전력프로파일링 및 모델링 •  하드웨어 컴포넌트 전력 최적화 •  DevFreq를 이용한 종합적 전력관리

Energy Usage; Application Energy Estimation; Process Energy Estimation; Virtualization; Battery Segmentation; Resource Management, …

하드웨어 시스템 소프트웨어

Hardware Component; Homogeneous; Heterogeneous;

Multicore System; Dynamic Voltage and Frequency; Devfreq Framework; Component Power

Management, …

Page 5: 144 deview-2013-smartphone pm

Researches  

Page 6: 144 deview-2013-smartphone pm

Hardware-­‐level  Power  Management  (1)

Mobile  Embedded  System  Lab.,  Yonsei  University   6  

Frequency  Scaling GPU

Dynamic  Voltage  &  Frequency  Scaling

CPU

Brightness  Level  Control Display

Opportunisac  Sensing  Scheduling Sensors

Adapave  Clock  Rate  Control Network

RGB  Level  Conversion

Page 7: 144 deview-2013-smartphone pm

Hardware-­‐level  Power  Management  (2)

•  DVFS  (Dynamic  Voltage  and  Frequency  Scaling)  –  Voltage  and  frequency  scaling  are  oden  used  together  to  save  power  in  mobile  

devices  including  cell  phones.    

•  DVFS  in  Android/Linux  (Power  Governor)  

Mobile  Embedded  System  Lab.,  Yonsei  University   7  

Ondemand Performance Powersave Hotplug PegasusQ

Features ü  DVFS only ü  Set the CPU sta

tically to the highest frequency

ü  Set the CPU statically to the lowest frequency

ü  Dual-core ü  Based on Onde

mand

ü  Multi-core ü  Based on Onde

mand

Frequency Control

ü  Utilization ü  CPU Frequency ― ― ü  Utilization

ü  CPU Frequency ü  Utilization ü  CPU Frequency

Multi-core Management ― ― ― ü  Average CPU U

tilization ü  CPU Frequency ü  # of Processes

Page 8: 144 deview-2013-smartphone pm

Hardware-­‐level  Power  Management  (3)

•  Is  DVFS  really  (or  always)  energy-­‐efficient?  –  “DVFS  scheme  reduces  power  consumpaon,  which  can  lead  to  significant  

reducaon  in  the  energy  required  for  a  computaaon,  paracularly  for  memory-­‐bound  (I/O-­‐bound)  workloads”  *

*  Le  Sueur,  and  Heiser,  G.,  “Dynamic  Voltage  and  Frequency  Scaling:  the  Laws  of  Diminishing  Returns,”    HotPower’10  

CPU-­‐bound

I/O-­‐bound

8 2

5 5

2 8 ame

10

16 2

10 5

18

15

CPU  jobs I/O  (memory)  jobs

4 8 12 ame

900  J

1080  J

900  J

900  J

10

10

900  J

720  J

Inefficient

Efficient

Performance  loss  in  every  case

Mobile  Embedded  System  Lab.,  Yonsei  University   8  

Page 9: 144 deview-2013-smartphone pm

Hardware-­‐level  Power  Management  (4)

•  OLED  –  OLED  display  power  model  is  a  linear  funcaon  of  linear  RGB  intensity  levels.  –  Different  OLED  displays  have  different  power  models  

•  Chameleon*  

*  M.  Dong  and  L.  Zhong,  “Chameleon:  a  color-­‐adapave  web  browser  for  mobile  OLED  displays”,  MobiSys    2011.

25%ê 34%ê 72%ê 66%ê

Mobile  Embedded  System  Lab.,  Yonsei  University   9  

Page 10: 144 deview-2013-smartphone pm

Hardware-­‐level  Power  Management  (5)

B.  Anand  et  al.,  “Adapave  display  power  management  for  mobile  games”,  MobiSys  2011.  

About  21%  reducaon  of  power  consumpaon    with  almost  same  UX  as  original  image

•  LCD  (and  OLED)  –  Reducing  brightness  level  without  UX-­‐loss  

Mobile  Embedded  System  Lab.,  Yonsei  University   10  

Page 11: 144 deview-2013-smartphone pm

Energy  Bugs/Hogs  (1)

   •  Some  running  instance  of  the  app  drain  the  baWery  significantly  faster  than  other  instance  of  the  same  app  

•  Cause  -­‐  Coding  error  -­‐  Rare  configuraaon  -­‐  Unusual  user  behavior  

•  Remedy  -­‐  Restart  the  energy  bug  app  -­‐  Kill  the  energy  bug  app

Energy  Bugs

   •  The  app  drains  the  baWery    significantly  faster  than  the  average  app  

•  Cause  -­‐  Coding  error  -­‐  Using  large  amounts  of        energy  to  serve  its  funcaon        (ex,  device  resources..)  

•  Remedy  -­‐  Kill  the  energy  hog  app

Energy  Hogs

A.  J.  Oliner,  A.  Iyer,  E.  Lagerspetz,  S.  Tarkoma  and    I.  Stoica,  “Collaboraave  Energy  Debugging  for  Mobile  Devices,”  in  Proc.  of  the  8th  USENIX  conference  on  Hot  Topics  in  System  Dependability,  Berkeley,  CA,  USA,  October  2012.  

Mobile  Embedded  System  Lab.,  Yonsei  University   11  

Page 12: 144 deview-2013-smartphone pm

Energy  Bugs/Hogs  (2)

•  Diverse  causes  of  Energy  Bugs  –  An  error  in  the  system,  either  applicaaon,  OS,  hardware,  firmware  or  external  that  

causes  an  unexpected  amount  of  high  energy  consumpaon  by  the  system  as  a  whole  

A.  Pathak,  Y.  C.  Hu  and  M.  Zhang,  “Bootstrapping  energy  debugging  on  smartphones:  a  first  look  at  energy  bugs  in  mobile  devices,”  in  Proc.  of  the  10th  ACM  Workshop  on  Hot  Topics  in  Networks,  Cambridge,  MA,  USA,  November  2012.  

Mobile  Embedded  System  Lab.,  Yonsei  University   12  

Page 13: 144 deview-2013-smartphone pm

Energy  Bugs/Hogs  (3)

•  Managing  Energy  Bugs/Hogs  –  Diagnose:  compare  normal  baWery  drain  and  abnormal  baWery  drain  –  Suggest  appropriate  repair  soluaons  based  on  the  diagnosis  results  

Informa8on  Collector

Resource  Usage  

User  Changes

Data  Analyzer Phase  

Idenaficaaon Per-­‐applicaaon  usage  paWerns

System  wide  usage  paWerns

Configuraaon  paWerns

Diagnosis  Engine Anomaly  Detecaon

Suspicious  Resource  Usage

Suspicious  Events

Repair  Advisor

Delete  Apps

Revert  Apps

Terminate  Apps

Revert  Configs

*  X.  Ma,  P.  Huang,  X.  Jin,  P.  Wang,  S.  Park,  D.  Shen,  Y.  Zhou,  L.  K.  Saul,  and  G.  M.  Voelker,  “eDoctor  :  Automaacally  Diagnosing  Abnormal  BaWery  Drain  Issues  on  Smartphones,”  in  Proc.  of  the  10th  USENIX  Symposium  on  NSDI’  13,  Berkeley,  CA,  USA,  April  2013.  

Mobile  Embedded  System  Lab.,  Yonsei  University   13  

Sampling  during  discharging

Compare  reference  and  subject

eDoctor*  :  Phase  Analysis

Carat  :  Comparison  Analysis

Page 14: 144 deview-2013-smartphone pm

Energy  Bugs/Hogs  (4)

•  Default  power  management  policy  for  mobile  device  (new  paradigm)    –  OS  uses  aggressive  sleeping  policies  –  Every  component,  including  the  CPU,  stays  off  or  in  an  idle  state,  unless  the  app  

explicitly  instructs  the  OS  to  keep  it  on!  

•  “No-­‐sleep”  Energy  Management  –  Aggressive  sleeping  may  severely  impacts  smartphone  apps  –  Power  encumbered  programming  :  Androids  “Wakelock”  API  

 New  Energy  Bug*  à  “No-­‐sleep”  bug  :  70%  (applica8on)  

*  Pathak,  Abhinav,  et  al,  “What  is  keeping  my  phone  awake?:  characterizing  and  detecang  no-­‐sleep  energy  bugs  in  smartphone  apps,”  in  Proc.  of  the  10th  internaRonal  conference  on  Mobile  systems,  applicaRons,  and  services  (MobiSys  2012),  ACM,  2012.  

Mobile  Embedded  System  Lab.,  Yonsei  University   14  

Page 15: 144 deview-2013-smartphone pm

Energy  Bugs/Hogs  (5)

Mobile  Embedded  System  Lab.,  Yonsei  University   15  

•  WakeScope  (mobed.yonsei.ac.kr/wakescope)  –  A  runame  WakeLock  anomaly  management  scheme  for  Android  plauorm

SCREEN FULL PARTIAL PARTIAL …

WakeLock  Anomaly

WakeLock  Anomaly  Detector

Process  Running  State

CPU  Usage

Applicaaon  &  Android  system  stop  state  checking

WakeLock  release  checking

WakeLock  Anomaly  checking

Screen  state Light  off  ame

SCREEN FULL PARTIAL

WakeScope  Applica8on

Handling  of  WakeLock  Anomaly

Kill  Applicaaon

Reboot    Smartphone

Applica8on Android  System

Linux  Power  Management

“PowerManagerService”  

PARTIAL “…..”  

PARTIAL …

Applica8on Android  System

WakeLock  behavior  tracking

PARTIAL SCREEN FULL Applicaaon Android  System

SCREEN FULL

WakeLock  behavior  tracking Android  System

PARTIAL

WakeLock  Behavior  Tracker

Binder

Android  Framework

PARTIAL SCREEN FULL

PowerManagerService

Android  Power  Management

Page 16: 144 deview-2013-smartphone pm

Energy-­‐aware  UX  (1)

•  Beder  energy-­‐related  understandings  à  energy-­‐efficient  behavior  

 

•  Task-­‐centered  Badery  Interface*  –  Support  users’  mental  models  on  fully  understanding  what  is  happening  on  

their  devices  *K.  N.  Truong,  et  al.  "The  Design  and  Evaluaaon  of  a  Task-­‐Centered  BaWery  Interface,“  UbiComp  2010.

Mobile  Embedded  System  Lab.,  Yonsei  University   16  

TCBI*  Android  BaWery  Informaaon  1.6  Donut   4.1.1  Jellybean  

Page 17: 144 deview-2013-smartphone pm

Energy-­‐aware  UX  (2)

•  HCI-­‐based  Display  Control  –  Reduce  display  power  by  dimming  the  parts  of  an  applicaaon  or  game  that  are  of  

low  interest

Wee,  Tan  Kiat,  et  al.  "DEMO  of  Focus:  A  Usable  &  Effecave  Approach  to  OLED  Display  Power  Management,“  HotMobile  2013.

Brighten  user-­‐interest  area  

Dim  less  important  area  

Mobile  Embedded  System  Lab.,  Yonsei  University   17  

Page 18: 144 deview-2013-smartphone pm

Energy-­‐aware  UX  (3)

•  Ac8ve  User  Involvement  –  User  is  a  main  actor  for  energy  management

M.  Marans  and  R.  Fonseca  "Applicaaon  Modes:  A  Narrow  Interface  for  End-­‐User  Power  Management  in  Mobile  Devices,“  HotMobile  2013.

Mobile  Embedded  System  Lab.,  Yonsei  University   18  

Page 19: 144 deview-2013-smartphone pm

Energy-­‐aware  UX  (4)

•  Badery  Virtualiza8on  –  Virtualizaaon  of  the  baWery  resource  across  applicaaon  classes

N.  Zhang  et  al.  “PowerVisor:  a  baWery  virtualizaaon  scheme  for  smartphones,“  MCS  2012.

Physical  Badery

Virtual  BaWery  1

Virtual  BaWery  2

Virtual  BaWery  3

App  Class  1

App  Class  2

App  Class  3

Mobile  Embedded  System  Lab.,  Yonsei  University   19  

Page 20: 144 deview-2013-smartphone pm

Badery  Saving

Energy-­‐aware  UX  (5)

•  Context-­‐based  Badery  Management:  BaderyGuru  (Qualcomm)  –  Extends  baWery  performance  and  improves  overall  user  experience  by  

intelligently  making  changes  that  opamize  device  funcaonality

Mobile  Embedded  System  Lab.,  Yonsei  University   20  

•  Manage  applicaaon’s  update  points  •  Control  WiFi  on/off

Preferred  Applicaaons Preferred/Available  WiFi  regions

Automaac  learning

Page 21: 144 deview-2013-smartphone pm

Es8ma8on  

Page 22: 144 deview-2013-smartphone pm

Power  Modeling  &  Energy  Es8ma8on  (1)

•  Why  applica8on/component  energy  informa8on  is  valuable?  

Applica8on/Hardware  Energy  Metering

App.  Developer

System  Developer

End  User Mobile  Embedded  System  Lab.,  Yonsei  University   22  

Page 23: 144 deview-2013-smartphone pm

Power  Modeling  &  Energy  Es8ma8on  (2)

Challenges:  how  to  estimate  application’s  energy  consumption?  

Mobile  Embedded  System  Lab.,  Yonsei  University   23  

CPU

GPS

Cell

WiFi

Display

GPU 𝑃↓𝐶𝑃𝑈 = 𝛽↓𝑓 ⋅𝑈↓𝐶𝑃𝑈 + 𝛽↓𝑖𝑑𝑙𝑒 ⋅(1− 𝑈↓𝐶𝑃𝑈 ) 𝑃↓𝑂𝐿𝐸𝐷 =𝑓(𝑅,𝐺,𝐵) ⋅

(𝛽↓𝑅 𝑅↓𝑖 + 𝛽↓𝐺 𝐺↓𝑖 + 𝛽↓𝐵 𝐵↓𝑖 ) 𝑃↓𝐺𝑃𝑈 = 𝛽↓𝑓 ⋅ 𝑈↓𝐺𝑃𝑈 + 𝛽↓𝑏𝑎𝑠𝑒  𝑃↓3𝐺 = 𝛽↓3𝐺 ,  3𝐺={𝑈𝑀𝑇𝑆,𝐻𝑆𝑈𝑃𝐴,𝐻𝑆𝑃𝐴𝑃}

𝑃↓𝐺2𝐷𝑋 = 𝛽↓𝐺2𝐷𝑋 ⋅ 𝑃𝑖𝑥𝑒𝑙𝑠↓𝐺2𝐷𝑋 + 𝛽↓𝑏𝑎𝑠𝑒  …

Acave  cores Frequency

Ualiza

aon

Colors/  Brightness

Display  occupancy  ame

3G/LTE

RRC  state

Connected  ame

High/low  Power  state

TRX  packets

Page 24: 144 deview-2013-smartphone pm

Device  Power  Modeling  (1)

Mobile  Embedded  System  Lab.,  Yonsei  University   24  

CPU

DISPLAY

GPU

𝑃↓𝑡↑𝑖 = 𝛽↓𝑖 ⋅ 𝑥↓𝑖↑𝑡 

Component behavior and usage

𝑃↓𝑡↑𝑡𝑜𝑡𝑎𝑙 = 𝑃↓𝑏𝑎𝑠𝑒 +∑𝑖=1↑𝑛▒𝑃↓𝑡↑𝑖  + 𝜖↓𝑡   

Total Power

Base Power

Error, Leakage

Component Power

Maximum power consumption of

component 𝑖

Page 25: 144 deview-2013-smartphone pm

Device  Power  Modeling  (2)

•  Issues  –  Component-­‐specific  ualizaaon  metric  

•  uame/same,  cores,  frequency,  color/brightness,  packet,  tail  state,  temp,  …  

–  Base  power  esamaaon  •  System  base  power,  component  base  power  

–  Isolated  control  of  hardware  component  •  Isolaang  CPU  influence  from  component  power  monitoring  

Mobile  Embedded  System  Lab.,  Yonsei  University   25  

Base power ?

How to fix the 𝑷↓𝒄𝒑𝒖  ?

 

Acave  cores Frequency

Ualiza

aon

TRX  packets

Colors/Brightness

Power  of  component  𝐶

Page 26: 144 deview-2013-smartphone pm

Device  Power  Model:  Example

Mobile  Embedded  System  Lab.,  Yonsei  University   26  

Page 27: 144 deview-2013-smartphone pm

Power  Analysis  

Page 28: 144 deview-2013-smartphone pm

Conven8onal  Power  Measurement

Mobile  Embedded  System  Lab.,  Yonsei  University   28  

External  Power  Monitor

Job  1  

Job  2  

Job  3  

triggering?

frequency?

acave  core? temperature?

base?

governor?

Job  1

Job  2

Job  3

Page 29: 144 deview-2013-smartphone pm

Nonintrusive  Power  Measurement  (1)

Fuel-gauge IC

DevScope

Component  Controller

TimingController

Fuel-­‐gauge  IC  Event  

Monitor

Power  Model  

Generator

H/W  Components

…CPU Display Wi-­‐Fi Cellular GPS

Battery

Component Power Model •  Power  modeling  process  –  Component-­‐specific  training  set  

generaaon  •  Workload,  Control  scenario  

–  Probe  OS,  H/W  component  –  Monitor  fuel-­‐gauge  IC  

•  Concepts  –  Use  built-­‐in  fuel-­‐gauge  IC  –  Assume  specific  H/W  power  

model  –  Online  and  non-­‐intrusive  power  

modeling  

Mobile  Embedded  System  Lab.,  Yonsei  University   29  

Page 30: 144 deview-2013-smartphone pm

Nonintrusive  Power  Measurement  (2)

•  Badery  Monitoring  Unit  (BMU,  BMIC,  Fuel-­‐gauge  IC,  SBS,  …)  –  Internal  measurement  device  for  supply  voltage,  baWery  capacity,  discharge  

current,  temperature,  ...  

•  BMIC  types  

•  Example:  Maxim  DS2784  (HTC  Nexus  One)  –  Measuring  voltage,  current,  and  temperature      –  Current  sensing  

•  Resoluaon:  104uA  •  Sensing  range:  -­‐3430mA  ~  3430mA  (±1%)  •  Sampling  rate:  18.6KHz  /  Update  rate:  0.28Hz  

BaWery  Monitoring  Unit  (Maxim  DS2784)

Type Current + voltage Voltage only

IC Maxim DS2760, Maxim DS278X, TI UCC3926, …

Ti BQ27X00, WM97XX, …

Model Sony-Ericsson Xperia Series, HTC NexusOne/Desire Series, Samsung Galaxy S3/S4(?)

Samsung Galaxy Series, LG Optimus Series(?), …

Mobile  Embedded  System  Lab.,  Yonsei  University   30  

Page 31: 144 deview-2013-smartphone pm

Nonintrusive  Power  Measurement  (3)

 Hardware

 Android

 DevScope

System  Configura8on

-­‐  CPU  frequencies  -­‐  BMU  types  -­‐  Hardware  component  types  -­‐  Network  se|ngs

Android  API

-­‐  CPU  control  -­‐  3G/LTE/WiFi  networking  -­‐  Display  control  -­‐  GPS  control

Component  Power  Models

-­‐  CPU:  𝑝= 𝛽↓𝑓𝑟𝑒𝑞 ×𝑢  

-­‐  WiFi:  𝑝= 𝛽↓𝑇𝑋 ×𝑝𝑝𝑠+ 𝛽↓𝑖𝑑𝑙𝑒   -­‐  3G/GPS:  𝑝= 𝛽↓𝑝𝑜𝑤𝑒𝑟_𝑠𝑡𝑎𝑡𝑒   -­‐  LCD:  𝑝= 𝛽↓𝑏𝑟𝑖𝑔ℎ𝑡𝑛𝑒𝑠𝑠   

BMU  Report

Measurement  Data

Ini8aliza8on

Workload  Genera8on

BMU  Ac8vity

Reporang  Rate

Workload  Tuning  

&  Probing Power  behavior  analysis

Coefficient Values CPU LCD WiFi 3G GPS

245 368 238 268 0

998 854 247 519 354

Hardware  Components CPU LCD WiFi Cellular GPS

BMU

Mobile  Embedded  System  Lab.,  Yonsei  University   31  

Page 32: 144 deview-2013-smartphone pm

U8liza8on  

Page 33: 144 deview-2013-smartphone pm

Hardware  component  usage  

Applica8on  Energy  Es8ma8on  (1)

𝐸↑𝐴𝑝𝑝 =∑𝑖=0↑#𝑜𝑓𝐶𝑜𝑚𝑝▒(𝛽↓𝑖 × 𝑥↓𝑖↑𝐴𝑝𝑝 )× 𝑑↓𝑖↑𝐴𝑝𝑝  

𝑥↓𝑖↑𝐴𝑝𝑝 

𝑑↓𝑖↑𝐴𝑝𝑝 

𝛽↓𝑖↑  Power  coefficient  value

Utilization

Activated  duration Limitations  Accuracy/Granularity/Real-­‐time  

•  Conven8onal  methods  –  HPC  (hardware  performance  counter)  –  Linux  “procfs/sysfs”  –  Android  “BaYeryStats”  –  Basically  “polling”  

•  Problems  –  Dependency  on  processor  –  Update  rate  problem  –  Granularity  problem  (per-­‐process  info)  

Mobile  Embedded  System  Lab.,  Yonsei  University   33  

Challenges:  how  to  estimate  application’s  energy  consumption?  

Page 34: 144 deview-2013-smartphone pm

Applica8on  Energy  Es8ma8on  (2)

•  How  to  detect  hardware  component  opera8on?  –  Event-­‐driven  kernel  acavity  monitoring  

t

Event  of  component  opera8on

Dura8on/U8liza8on  of  opera8on

Mobile  Embedded  System  Lab.,  Yonsei  University   34  

Page 35: 144 deview-2013-smartphone pm

Applica8on  Energy  Es8ma8on  (3)

Estimation Result

Event DetectorApplication KernelAndroidprocess 1

process 2

process n

...

binder

c/c++ libraries

H/W drivers

binderdriver

Android API call

Binder IPC data

Request to use H/W by system call

Kernel Activity Monitoring

binder_ioctl(), ioctl(), socket(), read(), write(), ...

1

Hardware Component Usage Analyzer

2Application Energy Estimator

3

Energy Consumption

…CPU Display Wi-Fi Cellular GPS

Component Power Models

Fuel-gaugeIC

External Devices

Device    power  model  

𝑖  

Mobile  Embedded  System  Lab.,  Yonsei  University   35  

Page 36: 144 deview-2013-smartphone pm

Event  detector  

•  binder_ioctl()  •  binder_transacRon()  •  cpufreq_cpu_put()  •  sched_switch()  •  dev_queue_xmit()  •  neRf_rx()  •  …  

Kernel  path

 Hooking  Point

Probe  Handler

0x81808c144  

End

Instrumentaaon  rouane

Return  to    original  path����������� ������������������  

Hardware  Component    Usage  Analyzer  

•  CPU  frequency/ualizaaon  •  WiFi  transmission  packet  r

ate  •  LCD  display  duraaon  •  GPS  acavated  duraaon  •  3G  network  connecaon  ty

pe  •  …  

•  System  calls  •  Kernel  funcaons  •  Binder  calls  

Component  Usage  Monitoring  (1)

Mobile  Embedded  System  Lab.,  Yonsei  University   36  

“Kprobes”

INT03:Break����������� ������������������  

Page 37: 144 deview-2013-smartphone pm

Component  Usage  Monitoring  (2)

Pac

ket

trans

mitt

ing

dev_queue_xmit()/netif_rx()

Time(s)

Time (tick)

Event Detector Kernel function calls

cpufreq_cpu_put()

245.0 MHz614.4 MHz806.4 MHz998.4 MHz

sched_switch()

Freq

uenc

ych

angi

ng

Pro

cess

switc

hing

Time (tick)Timing synchronization

Utilization (%)

AppScopeKernel

Process 1

Process 2

Process 3

H/W ComponentUsage Analyzer

Mobile  Embedded  System  Lab.,  Yonsei  University   37  

Page 38: 144 deview-2013-smartphone pm

Component  Usage  Monitoring  (3)

•  Display  (OLED)  –  (R,  G,  B)  and  brightness  

–  Accurate  OLED  energy  esamaaon  by  Framebuffer  Analysis  

–  Event-­‐based  acavity  transiaon  monitoring  •  Applicaaon-­‐specific  

display  power  esamaaon  

𝑃=𝐵𝑟×𝑓(𝑅,𝐺,𝐵)                                ×(𝛽↓𝑅 𝑅↓𝑖 + 𝛽↓𝐺 

𝐺↓𝑖 + 𝛽↓𝐵 𝐵↓𝑖 )

Mobile  Embedded  System  Lab.,  Yonsei  University   38  

Page 39: 144 deview-2013-smartphone pm

Applica8on  Energy  Es8ma8on:  Overall  Framework

Device  Power  Modeling  (Training)

Energy  Es8ma8on System  Evalua8on    

Mobile  Embedded  System  Lab.,  Yonsei  University   39  

Kernel  source Behavior  analysis Power  Analysis Formulaaon

Error  Analysis External  Power  Monitor

Page 40: 144 deview-2013-smartphone pm

AppScope  

Page 41: 144 deview-2013-smartphone pm

The  AppScope  Project  (1)

Power  Models  (DevScope/Vendor)

AppScopeViewer

App.  Developer System  Sooware  Developer

Energy  Bug  Report  /  Energy  Consump8on  Sta8s8cs

End  User

AppScopeViewer  I/F

AppScope

CPU   Display   Wi-­‐Fi Cell   GPS

Simple  On/Off    States  

Component  X

Applica8ons

AppScope  Library Single  Core   LCD   OLED USPA   LTE Mul8  Core   …

C.  Yoon,  D.  Kim,  W.  Jung,  C.  Kang,  H.  Cha,  "'AppScope:  Applicaaon  Energy  Metering  Framework  for  Android  Smartphone  using  Kernel  Acavity  Monitoring,"  USENIX  Annual  Technical  Conference  (USENIX  ATC'12),  2012

W.  Jung,  C.  Kang,  C.  Yoon,  D.  Kim,  H.  Cha,  "DevScope:  A  Nonintrusive  and  Online  Power  Analysis  Tool  for  Smartphone  Hardware  Components,"  InternaRonal  Conference  on  Hardware/So_ware  Codesign  and  System  Synthesis  (CODES+ISSS'12),  2012

Mobile  Embedded  System  Lab.,  Yonsei  University   41  

Page 42: 144 deview-2013-smartphone pm

Demo  (AppScope/AppScopeViewer)

Mobile  Embedded  System  Lab.,  Yonsei  University   42  

hdp://mobed.yonsei.ac.kr/appscope

Page 43: 144 deview-2013-smartphone pm

Current  Status  of  AppScope

Mobile  Embedded  System  Lab.,  Yonsei  University   43  

Snapdragon  QSD8250(1GHz)

Exynos-­‐5410  

Media  processor(MFC) SGX  544  GPU  1.6GHz  Octa.  big.LITTLE  

Media  processor

Snapdragon  600  

1.9GHz  Quad.  

Adreno  320  GPU 1.4GHz  Quad.  

2D  graphics

Mali-­‐400  GPU

Exynos-­‐4412  3G  

SKT  HSDPA

WiFi

GPS

3G  HSPA+

Tail  Power 4G  LTE

Camera

Galaxy  S3  

Galaxy  S4  Nexus  One  

VEGA  IRON  

AMOLED  Display LCD  Display

Page 44: 144 deview-2013-smartphone pm

AppScope  Remaining  Challenges

Mobile  Embedded  System  Lab.,  Yonsei  University   44  

Autonomous  power  modeling

Thermal  power  modeling More  components

Signal-­‐strength-­‐aware  modeling

Sensors Touch screen Bluetooth NFC …

WiFi

4G  LTE

3G  HSPA+

Page 45: 144 deview-2013-smartphone pm

AppScope  Capabili8es  &  Poten8als

Energy  Bugs/Hogs  Detec8on

•  User  behavior  monitoring  •  Anomaly  detecaon  •  Debugging  frameworks  

Energy  Mgmt.

•  Energy  management  API  •  BaWery  virtualizaaon  •  Remain  capacity  predicaon  

•  Workload  characterizaaon  •  Load  monitoring  •  Detecang  workload  unbalance  

Program  bugs  Wakelock  Handover  

Signal  strength  

•  CPU  power  governor  •  DEVFREQ  (OPP)  •  Mula-­‐core  task  scheduling  

Power  Mgmt.

big.LITTLE

GPU

MFC

Multicore

Task scheduling

100%

30%

30%

40%

•  Interacave  UX  •  Lifeame  predicaon  •  App.  running  state  analysis  

Energy-­‐aware  UX

Workload  Analysis

Mobile  Embedded  System  Lab.,  Yonsei  University   45  

Page 46: 144 deview-2013-smartphone pm

Our  Researches  

Page 47: 144 deview-2013-smartphone pm

Work  @  Yonsei

•  Energy  usage  profiling  •  Energy  habit  monitoring  •  Energy  bugs/hogs  detecaon  •  EMSOFT2013,  …

•  Component  usage  monitoring  •  Applicaaon  energy  esamaaon  •  System  energy  esamaaon  •  USENIX  ATC’12  

•  Component  power  modeling  •  Mula-­‐core  CPU,  GPU,  OLED,  …  •  Online  power  modeling  •  CODES+ISSS2012,  DATE2013

AppScope

Network  Env.

User  Interac8on

Network  Serv.

Badery  State

Calling  Serv.

UserScope  WakeScope …

CPU Display Wi-Fi Cellular GPS

Power  Management

•  Mula-­‐core  CPU  governor  •  DEVFREQ  frameworks  •  Personalized  energy  mgnt.  •  Adapave  duty  cycling  •  SenSys’11,    ...  Fuel-gauge IC

H/W  Components

…CPU Display Wi-­‐Fi Cellular GPS

BatteryDevScope  

Base

p

3R 4R

Hidden State1Active State

Hidden State2

HiddenState 1

Active State

Hidden State 2

Mobile  Embedded  System  Lab.,  Yonsei  University   47  

Page 48: 144 deview-2013-smartphone pm

FIN  

hWp://mobed.yonsei.ac.kr/