AppScope: Application Energy Metering Framework for Android Smartphones using Kernel Activity Monitoring



Similar documents
AppScope: Application Energy Metering Framework for Android Smartphones using Kernel Activity Monitoring

Architecture (SOSP 2011) 11/11/2011 Minsung Jang

Empowering Developers to Estimate App Energy Consumption. Radhika Mittal, UC Berkeley Aman Kansal & Ranveer Chandra, Microsoft Research

CELLS A Virtual Mobile Smartphone Architecture

Android Operating System

Trepn plug-in for Eclipse FAQ

A Look through the Android Stack

Android Architecture. Alexandra Harrison & Jake Saxton

Performance Measuring in Smartphones Using MOSES Algorithm

Disruption Tolerant Networks and its relevance to IOT/M2M. Extensible NMS Support for DTN Mesh Networks + Applications

Reminders. Lab opens from today. Many students want to use the extra I/O pins on

Lecture 17: Mobile Computing Platforms: Android. Mythili Vutukuru CS 653 Spring 2014 March 24, Monday

ANDROID OPERATING SYSTEM

Visualizing gem5 via ARM DS-5 Streamline. Dam Sunwoo ARM R&D December 2012

ELEC 377. Operating Systems. Week 1 Class 3

Development of Integrated Management System based on Mobile and Cloud Service for Preventing Various Hazards

FT-1000/GPS-N. System of remote monitoring and control of physical

Intel Media Server Studio - Metrics Monitor (v1.1.0) Reference Manual

VEHICLE TRACKING SYSTEM USING GPS. 1 Student, ME (IT) Pursuing, SCOE, Vadgaon, Pune. 2 Asst. Professor, SCOE, Vadgaon, Pune

Testing & Assuring Mobile End User Experience Before Production. Neotys

Evaluating Impact of Cross-platform Frameworks in Energy Consumption of Mobile Applications

A Taxonomy and Survey of Energy-Efficient Data Centers and Cloud Computing Systems

Example of Standard API

Introduction to Operating Systems. Perspective of the Computer. System Software. Indiana University Chen Yu

CSE 237A Final Project Final Report

Development of Integrated Management System based on Mobile and Cloud service for preventing various dangerous situations

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Mobile Phones Operating Systems

WiLink 8 Solutions. Coexistence Solution Highlights. Oct 2013

Next Generation Operating Systems

SNAPPIN.IO. FWR is a Hardware & Software Factory, which designs and develops digital platforms.

Understand and Build Android Programming Environment. Presented by: Che-Wei Chang

Berlin Institute of Technology FG Security in Telecommunications

Android Operating System:

Android Architecture For Beginners

Achieving Nanosecond Latency Between Applications with IPC Shared Memory Messaging

Mobile App Testing Guide. Basics of Mobile App Testing

SMARTPHONE INNOVATION

Evolution of Smartphones And Android Operating System

Mobile Operating Systems. Week I

Mobile Devices - An Introduction to the Android Operating Environment. Design, Architecture, and Performance Implications

Optimizing Background Sync on Smartphones

Performance of Host Identity Protocol on Nokia Internet Tablet

Understanding Android s Security Framework

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Android Basics. Xin Yang

How To Create An Ad Hoc Cloud On A Cell Phone

Android Commercial Spyware Disease and Medication

Red Hat Network Satellite Management and automation of your Red Hat Enterprise Linux environment

Red Hat Satellite Management and automation of your Red Hat Enterprise Linux environment

A Survey on Mobile Forensic for Android Smartphones

Study of SAP ERP Connection System Driven in Smartphone

EWeb: Highly Scalable Client Transparent Fault Tolerant System for Cloud based Web Applications

Empowering Developers to Estimate App Energy Consumption

A Transport Protocol for Multimedia Wireless Sensor Networks

RTOS based Home Automation System using Android

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

QUIRE: : Lightweight Provenance for Smart Phone Operating Systems

Real time vehicle tracking and driver behaviour monitoring using cellular handset based accelerometer and GPS data

The Case for Device Namespaces

Comparison of Battery Life Performance of VoLTE Capable Devices

Operating System Organization. Purpose of an OS

Application of Android OS as Real-time Control Platform**

Questions from The New SensorTag - IoT Made Easy Webinar

Wave Relay System and General Project Details

Android Programming and Security

Harmonizing policy management with Murphy in GENIVI, AGL and TIZEN IVI

Workshop on Android and Applications Development

WIND RIVER SECURE ANDROID CAPABILITY

Ways to Use USB in Embedded Systems

Android Virtualization from Sierraware. Simply Secure

Remote Desktop Access through Android Mobiles and Android Mobiles Access through Web Browser

Power Management in the Linux Kernel

DOCUMENT REFERENCE: SQ EN. SAMKNOWS SMARTPHONE-BASED TESTING SamKnows App for Android White Paper. May 2015

Chapter 3 Operating-System Structures

Specialized Android APP Development Program with Java (SAADPJ) Duration 2 months

Experience with the integration of distribution middleware into partitioned systems

Remote Desktop on Mobile

MAJORS: Computer Engineering, Computer Science, Electrical Engineering

MOVEIRO BT-200 Technical Information for Application Developer

ANDROID PROGRAMMING - INTRODUCTION. Roberto Beraldi

find model parameters, to validate models, and to develop inputs for models. c 1994 Raj Jain 7.1

Introduction to Android

Agenda. Context. System Power Management Issues. Power Capping Overview. Power capping participants. Recommendations

An OSGi based HMI for networked vehicles. Telefónica I+D Miguel García Longarón

A Review of Different Comparative Studies on Mobile Operating System

Transcription:

AppScope: Application Energy Metering Framework for Android Smartphones using Kernel Activity Monitoring Chanmin Yoon*, Dongwon Kim, Wonwoo Jung, Chulkoo Kang, Hojung Cha Dept. of Computer Science Yonsei University, Korea USENIX ATC 12 2012.06.15

Motivation Q) I find it is 100mW when I just run my app, and it is 20mW when I do nothing. I think 80mW is consumed by my app. But it is 200mW I run another app B and my app also run, and it is 160mW when I just run app B, so my app also consume 40mW? Which one is correct?.., So I want to know how to estimate power consumption correctly? A) only use the radios when necessary. People want to know power consumption of their apps Mobile Embedded System Lab., Yonsei University 2

Motivation Why application/component energy information is valuable? App. Developer System Software Developer Application/Component Power Metering End User Mobile Embedded System Lab., Yonsei University 3

Challenge How can we estimate Application Energy? Power Models Linear regression models a. MANTIS b. Lasso regression c. Others Non-linear regression models a. Exponential b. SVM c. Others Finite-state machine models System call-based Utilization-based Model #ofcomp E App = β i x i App d i App β i x i App d i App i=0 Power coefficient value Utilization Activated duration Hardware Component Usage Mobile Embedded System Lab., Yonsei University 4

Challenge How can we estimate Application Energy? Conventional methods to get Hardware component usage Reading hardware performance counter a. Very accurate b. Dependency on processor architecture Reading /proc, /sys file system a. Update rate problem e.g., CPU utilizations/frequencies b. GPS, display, cellular? Using BatteryStat class a. Update rate problem b. Information granularity problem c. It s a Java class Limitations Accuracy Granularity Real-time Mobile Embedded System Lab., Yonsei University 5

Objectives Online and autonomous estimation in real-time No external measurement device Fine-grained energy consumption information Process & hardware component-level granularity System portability No modification in system software Mobile Embedded System Lab., Yonsei University 6

The AppScope Framework Application process 1 process 2... process n Android API call Android binder c/c++ libraries 1 i Event Detector Binder IPC data Request to use H/W by system call Kernel Activity Monitoring Kernel binder driver H/W drivers Energy Consumption x i, d i 2 binder_ioctl(), ioctl(), socket(), read(), write(),... Hardware Component Usage Analyzer 3 Application Energy Estimator Component Power Models Estimation Result CPU Display Wi-Fi Cellular GPS Fuel-gauge IC β i External Devices AppScope employs the DevScope s power model Mobile Embedded System Lab., Yonsei University 7

DevScope (CODES+ISSS 2012) H/W Components CPU Display Wi-Fi Cellular GPS Fuel-gauge IC Battery Online modeling Android application Assume built-in fuel-gauge IC Component Controller Timing Controller DevScope Fuel-gauge IC Event Monitor Component Power Model Power Model Generator Non-intrusive power modeling Probe OS, H/W component Monitor fuel-gauge IC Component-specific Training set generation - Workload - Control scenario Mobile Embedded System Lab., Yonsei University 8

Kernel Activity Monitoring How to detect hardware component operation? Event-driven approach Event of component operation Duration/Utilization of operation t Mobile Embedded System Lab., Yonsei University 9

AppScope Implementation with Kprobes System calls Kernel functions Binder calls Hooking Point Kernel path 0x81808c144 INT03 Break Instrumentation routine Probe Handler Parameters IPC data Event detector binder_ioctl() binder_transaction() cpufreq_cpu_put() sched_switch() dev_queue_xmit() netif_rx() Return to original path End Hardware Component Usage Analyzer CPU frequency/utilization WiFi transmission packet rate LCD display duration GPS activated duration 3G network connection type Mobile Embedded System Lab., Yonsei University 10

Hardware Component Usage Analyzer Linux Kernel Event H/W Component Usage Analyzer Governor Interface Network Interface Binder Driver CPU Wi-Fi Cellular Display GPS Utilization/ Frequency Transfered Packet Rates Power States Transition Foreground Duration Activation Duration Analyze kernel functions Analyze binder IPC data Mobile Embedded System Lab., Yonsei University 11

Why analyzing the Binder IPC? User space 3G Radio connection type Not available in kernel Binder driver Binder driver works in kernel Can probe IPC data Hooking by Kprobes Analyze RPC data to obtain radio connection type Mobile Embedded System Lab., Yonsei University 12

Inspecting Binder IPC data 1. Hook binder_transaction() 2. Extract RPC code/data 3. Check RPC Code 4. Read RPC Data Hardware Operation Binder IPC Data handle RPC Data RPC Code Protocol Service Server Service foo( ) { } Binder IPC Command Binder Driver (/dev/binder) Mobile Embedded System Lab., Yonsei University 13

Hardware Component Usage Analysis (1) Process switching AppScope Event Detector Frequency changing Packet transmitting H/W Component Usage Analyzer Kernel function calls dev_queue_xmit()/netif_rx() Process 1 Process 2 Process 3 Kernel WiFi DAI layer cpufreq_cpu_put() 998.4 MHz 806.4 MHz 614.4 MHz Time(s) 245.0 MHz CPU DFVS governor sched_switch() Timing synchronization Time (tick) Utilization (%) Time (tick) Mobile Embedded System Lab., Yonsei University 14

Location request GPS on/off event Foreground Activity changing Network connection type Hardware Component Usage Analysis (2) Android AppScope Event Detector Binder RPC precedure Kernel Process 1 3G Network connection type RRC state transition Process 2 Process 3 3G usage H/W Component Usage Analyzer FACH RIL: RRC state transition DCH FACH IDLE Time (s) ActivityManager: Foreground activity changing Display Activity Manager IPC data Display usage GPS usage LocationManager: loc_api() GPS_OFF GPS_ON Number of location requests Time (s) GPS_OFF Time (s) GPS loc_api() LocationManager IPC data Time (s) Mobile Embedded System Lab., Yonsei University 15

Evaluation (1) Component Usage Monitoring Energy Metering Validation Overhead Analysis Real Application Energy Metering Hardware event detection Hardware usage statistics Granularity of information Accuracy of power metering CPU overhead Power overhead Case Study Error analysis 6 test apps Pre-defined workload Workload scheduling DevScope power model Per UID Per Component Vs. Monsoon Loaded case Unloaded case Angry Birds Skype (WiFi) Browser (WiFi) Browser (3G) Google Maps Mobile Embedded System Lab., Yonsei University 16

Evaluation (2) Development environments Linux kernel 2.6.35.7 SystemTap 1.3 (also uses Kprobes) Android platform 2.3 Device HTC Google Nexus One Qualcomm QSD 8250 Snapdragon 1GHz 3.7-inch Super LCD display MAXIM DS2784 Fuel-gauge-IC External measurement device The Monsoon Power Monitor Mobile Embedded System Lab., Yonsei University 17

Test Scenario 1 Master and 5 Slave applications Master Slave 2 Slave 4 Slave 1 Slave 3 Slave 5 WiFi LCD CPU 3G GPS 0 20 40 60 80 100 120 140 160 180 200 220 t Mobile Embedded System Lab., Yonsei University 18

Component Usage Monitoring (1) WiFi LCD CPU 3G GPS 0 20 40 60 80 100 120 140 160 180 200 220 t Medium frequency (766/576 Mhz) due to OnDemand policy Mobile Embedded System Lab., Yonsei University 19

Component Usage Monitoring (2) WiFi LCD CPU 3G GPS 0 20 40 60 80 100 120 140 160 180 200 220 t Packet rate is 100 pps for 20 secs System uses GPS for 2 ~ 4.5 sec Mobile Embedded System Lab., Yonsei University 20

Component Usage Monitoring (3) WiFi LCD CPU 3G GPS 0 20 40 60 80 100 120 140 160 180 200 220 t Turned on System transmits some data Activity change occurs in ActivityManager Mobile Embedded System Lab., Yonsei University 21

Power Model for Google Nexus One (N1) Component-specific DevScope Power Models Mobile Embedded System Lab., Yonsei University 22

Energy Metering Validation (1) Monsoon System automatically activated the 3G interface after WiFi off. But, AppScope cannot detect this. Limitation of CPU power model in AppScope(cache memory, I/O operation,,?) system processes Mobile Embedded System Lab., Yonsei University 23

Overhead Analysis 8.4J energy overhead for 240 seconds About 2.1% CPU overhead on average Mobile Embedded System Lab., Yonsei University 24

Real Application Energy Metering (1) Google Maps Skype + WiFi Error is caused by timer bug in SystemTap Browser + WiFi Browser + 3G Mobile Embedded System Lab., Yonsei University 25

Real Application Energy Metering (2) GPU error Angry Birds GPU mismodeling StabilityTest for GPU Mobile Embedded System Lab., Yonsei University 26

Limitations Processor power modeling No consideration on GPU Do not cope with multi-core processor architecture No consideration on memory component CPU-bound job vs. Memory-bound job Tail-state energy estimation Limitation of linear power model (c.f. FSM power model) Hardware components OLED display Sensors: INS, MIC, Camera, Mobile Embedded System Lab., Yonsei University 27

Related Tools Tool Android Built-in Battery Info Description This does not provide fine-grained power profile PowerTop This is not available for smartphones Trepn Profiler [Qualcomm] Energy Profiler [Nokia] Hardware sensor-based power profiler This is only available on Snapdragon MDP Device power consumption External APIs for testing a application Developer s solution PowerTutor State of the ART Mobile Embedded System Lab., Yonsei University 28

AppScope Vs. PowerTutor PowerTutor An Android application Polling using Android BatteryStat AppScope Linux kernel module (+ External power profilers) Event-driven using Linux Kprobes Application(UID) level Process level Reading /proc and /sys, Using Android API, Using modified Android framework Monitoring kernel function call CPU, LCD/OLED, WIFI, 3G data, GPS, AUDIO CPU, LCD, WIFI, 3G data + voice call, GPS Mobile Embedded System Lab., Yonsei University 29

The AppScope Project App Developer System Software Developer End User Energy Bug Report / Energy Consumption Statistics Applications AppScope AppScope Library Single Core Multi Core LCD OLED USPA LTE AppScopeViewer I/F CPU Display Wi-Fi Cell GPS Simple On/Off States Component X Power Model DB (DevScope/Vendor) AppScopeViewer Mobile Embedded System Lab., Yonsei University 30

AppScope Suite AppScopeViewer: Real-time Android power profiler An Java application providing device s power profile graphically Interacts with AppScope in target device Easy to use without any external measurement device Visit our project homepage http://mobed.yonsei.ac.kr/~appscope Our release includes binaries of AppScope, kernel image, and AppScopeViewer. Currently, AppScope supports Google Nexus One CPU, 3G, WiFi, LCD, GPS. Mobile Embedded System Lab., Yonsei University 31

Demo Mobile Embedded System Lab., Yonsei University 32

Conclusion Contributions Provide energy consumption of Android application, being customized to the underlying system software and hardware components in device Accurately estimates in real-time (with AppScopeViewer) Implemented using module programming to improve portability Future work (in progress) Supporting diverse hardware components: OLED display, various sensors, Supporting multi-core processor architecture GPU power modeling Mobile Embedded System Lab., Yonsei University 33

Thank You http://mobed.yonsei.ac.kr/~appscope Mobile Embedded System Lab., Yonsei University 34