Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Mobilesoft 2017 Keynote

11,906 views

Published on

Keynote given on Future of Mobile Software, Energy and Performance.

Published in: Education
  • Be the first to comment

Mobilesoft 2017 Keynote

  1. 1. Future of Mobile Software Energy and Performance Abhik Roychoudhury abhik@comp.nus.edu.sg http://www.comp.nus.edu.sg/~abhik 1Mobilesoft 2017 Keynote Keynote Talk Joint work with Abhijeet Banerjee
  2. 2. Devices • Many, but concretely … Mobilesoft 2017 Keynote 2
  3. 3. Processor & Application • Developments in mobile processor level for energy and performance • What about apps? o How much can apps help? o Are energy and performance synonymous? Mobilesoft 2017 Keynote 3 ARM big.LITTLE
  4. 4. Energy vs. performance • Impact of CPU frequency scaling on energy and performance. do{ scrape_puzzle(); // I-O intensive process_puzzle(); // CPU intensive } while (more puzzles to scrape and process); Observe time and energy for different frequencies. Mobilesoft 2017 Keynote 4
  5. 5. Energy vs. Performance Mobilesoft 2017 Keynote 5 Energy consumption and performance do not rise and fall together.
  6. 6. Energy vs. Performance Mobilesoft 2017 Keynote 6 Source: “Energy consumption in mobile phones: A measurement study and implications for network applications”, N. Balasubramanian et al, SIGCOMM 2009. Speed GSM < 3G < Wifi 3G consumes more energy than GSM. Wifi consumes less energy than 3G, GSM.
  7. 7. So far • Energy and Performance are not synonymous. Mobilesoft 2017 Keynote 7
  8. 8. Detecting Energy-Inefficiency - 8 Energy Consumption (High Utilization*) Energy Consumption (Low Utilization*) > * Of device’s components => E/U ratio is a suitable measure of energy- inefficiency of an application Mobilesoft 2017 Keynote
  9. 9. Measuring Mobilesoft 2017 Keynote 9 • PowerTutor: Tracks components and their power states, and uses inbuilt power model • Dumpsys: Uses power profile (XML file) shipped with devices
  10. 10. Measurements • Testing, Debugging, Re-factoring … • Power measurements to guide Mobile SE activities Mobilesoft 2017 Keynote 10
  11. 11. So far • Energy and Performance are not synonymous. • The need for energy measurements. Mobilesoft 2017 Keynote 11
  12. 12. Energy-Inefficiencies: Energy Bugs Prevents device from becoming idle even after app has completed execution and there is no user activity. 12 PRE EXC REC POST E/URatioE/URatio No Bug/Hotspot With Bug Find dissimilarity between PRE and POST stages Mobilesoft 2017 Keynote
  13. 13. Energy-Inefficiencies: Energy Hotspot 13 Causes device to consume abnormally high amount of battery power even though the utilization of hardware resources is low PRE EXC REC POST E/URatioE/URatio No Bug/Hotspot With Hotspot Anomaly Detection Techniques: Jmotif "HOT SAX: Efficiently Finding the Most Unusual Time Series Subsequence" E. Keogh, J. Lin and A. Fu (2005). D1 D2 Mobilesoft 2017 Keynote
  14. 14. Energy Bugs & Hotspots 14 Category Energy Bug Energy Hotspot Hardware Resources Resource Leak Suboptimal Resource Binding Sleep-state transition heuristics Wakelock Bug Tail-Energy Hotspot Background Services Vacuous Background Services Expensive Background Services Defective Functionality Immortality Bug Loop-Energy Hotspot App Starts Resource Acquired Resource Used Energy Wasted App Stops Service Started Service not stopped Energy Wasted App Starts Buggy App Starts Reset Using Task Manager / Restart Buggy App Re-starts Mobilesoft 2017 Keynote
  15. 15. Hotspot / Bug Detection Component Guidance Component Power Meter Hotspot/Bug Detection EFG Extraction Guidance Module Database Event Trace Generation Smartphone Energy Consumption Trace Utilization Trace Hotspot / Bugs Event Flow Graph Event Trace Application Detection 15Test SuiteMobilesoft 2017 Keynote
  16. 16. Example: Energy Bug 16 E/U Trace before fix has been applied E/U Trace after fix has been applied Aripuca Records tracks and Waypoints Energy Bug Vacuous Background Services public void onPause() { unregisterReceiver(compassBroadcastReceiver); unregisterReceiver(locationBroadcastReceiver); //FIX serviceConnection.getService().stopLocationUpdates(); serviceConnection.getService().stopSensorUpdates(); serviceConnection.unbindAppService(); } public void onPause() { unregisterReceiver(compassBroadcastReceiver); unregisterReceiver(locationBroadcastReceiver); // // // serviceConnection.unbindAppService(); } Bug-revealing event-traces: Event_1_1 --> Event_1_2 --> Event_2_1 --> Event_2_2 Event_1_1 --> Event_1_2 --> Event_2_1 --> Event_3_1 Fix: Remove location updates before exiting Mobilesoft 2017 Keynote
  17. 17. Example: Energy Hotspot E/U Trace before fix has been applied E/U Trace after fix has been applied Montreal Transit Fetches Transit Related Info High E/U ratio for a short period (~ 5 seconds) after EXC stage High E/U does not persist, therefore hotspot and not a bug Energy Hotspot Expensive Background Services, Suboptimal Resource Binding Main Functionality + Get Location Load Ads + Get Location User Navigates Away loading ads Stop GPS released User Starts App Energy Wasted Main Thread Main Functionality + Get Location Load Ads Share Location User Navigates Away + GPS Released loading ads StopUser Starts App Main Thread Async Thread 17
  18. 18. So far • Energy and Performance are not synonymous. • The need for energy measurements. • What are energy bugs and hotspots? Mobilesoft 2017 Keynote 18
  19. 19. Re-factoring 19 Resources such as I/O Components and power management utilities have the biggest impact on energy-consumption, hence their usage must be reduced as much as possible without affecting the functionality of the app. PowerConsumption (mW) Mobilesoft 2017 Keynote
  20. 20. Re-factoring 20 Design Extraction Guideline- based Refactoring Code Generation App Source Refactored App Source Design Expression Refactored Design Expression Design Extraction Mobilesoft 2017 Keynote
  21. 21. Extracting Design Expression 21 Ap p Explore UI Analyze Bytecode Event Flow Graph Convert to DFA Deterministic Finite Automata DFA to RE Design Express ion xr is acquire yr is release Change to ab*cxrurdyr Mobilesoft 2017 Keynote
  22. 22. So far • Energy and Performance are not synonymous. • The need for energy measurements. • What are energy bugs and hotspots? • Re-factoring Mobilesoft 2017 Keynote 22
  23. 23. Field Failures 23 Omnidroi d Issue 98 Battery Drain Concerns … I know it was omnidroid because I looked at the battery use graph and omnidroid was using 8 times more battery than the next highest app Field Failure A defect that is observed by the user, after the software has been shipped Defect Report A report describing the observed defect. Often provided by the user. May or may not be sufficient to recreate and/or fix the defect. Energy Inefficiency A key concern in battery constrained mobile devices Mobilesoft 2017 Keynote
  24. 24. Field Failures 24 App App User Reviews/ Bug Reports App Development Challenges on the User Side Challenges on the Developer Side Replicate Defect Localize Defect Visualize Defect Patch Defect Record Sufficient Information to Recreate Defect Convey Observed Defect Information Succinctly Mobilesoft 2017 Keynote
  25. 25. Going beyond Mobilesoft 2017 Keynote 25 How can we utilize user comments related to energy consumption to drive present and future mobile SE?
  26. 26. Reviews Mobilesoft 2017 Keynote 26 Why do users downvote apps? Crash Advertisement Performance Energy Other functionality Gathered reviews of 170,000 Android apps in Google Play Store.
  27. 27. Uninstall ratio - plot Mobilesoft 2017 Keynote 27Uninstallcategory Reviewscategory Highest uninstall ratio observed for energy related issues.
  28. 28. Possibility Mobilesoft 2017 Keynote 28 User Review Temporal Logic formula App EventFlo w Graph Model Test Generator Tests Event Keywords: Open, Click, Tap, Drag, … Temporal Keywords: Then, Until, Finally, … HW State Keywords: GPS is on, … UI State Keywords: <different UI states of the app>
  29. 29. Mobilesoft 2017 Keynote 29
  30. 30. Example Mobilesoft 2017 Keynote 30 I 'm having a similar problem I have a Dell Streak running dj_steve 's custom Android rom When I open Bitcoin-Android the circular thinking/downloading thing in the top right corner keeps on spinning forever When I close that window the app is still draining my cpu at over 90 % I tried sending 0.01 BTC to it and it never showed up in the app but is confirmed on my pc client I was wondering if this has something to do with me running a custom rom even though every other app seems to work fine G(user_open  (downloading U (user_close  F battery_drain)) G(user_open  (downloading U (user_close  F (user_BCsnd  GBC_rcv )) Test generation, not Model checking
  31. 31. Example Mobilesoft 2017 Keynote 31 Had this issue as well turns out the block chain just takes a LONG time to download Once the chain is downloaded took me about 5 hours over 3G my transfers showed up new transfers showed up instantly and the app does n't seem to be draining the battery at all Only dues it when I open it and it needs a few seconds to a minute to download the new blockchain piece G(user_open  (downloading U (downloaded G(battery_ok  (user_BCsnd  F BC_rcv)) Compare with G(user_open  (downloading U (user_close  F battery_drain)) G(user_open  (downloading U (user_close  F (user_BCsnd  GBC_rcv ))
  32. 32. Mobilesoft 2017 Keynote 32 Tests App Execution Logs Fault Localization Fault Visualization Patch Suggestion Possible Workflow
  33. 33. So far • Energy and Performance are not synonymous. • The need for energy measurements. • What are energy bugs and hotspots? • Re-factoring • Mobile SE based on field failures and reviews Mobilesoft 2017 Keynote 33
  34. 34. Looking forward Mobilesoft 2017 Keynote 34 Rise of drones - operations in risky tasks - Disaster Management - Stealth Monitoring Distributed Energy Management - Distributed among tasks - Caters for many operational scenarios
  35. 35. Futuristic Disaster Management Mobilesoft 2017 Keynote 35 Tasks Camera Sensors GPS Propulsion Processor Radio Priority Obstacle Avoidance X X X 3 Navigation X X 2 Data gathering + processing X X 1 Rcv cmd, send telemetry X X 2 Price per unit … … … … … …
  36. 36. Price Theory Mobilesoft 2017 Keynote 36 Virtual Market- place Tasks Resources 1. Obstacle Avoidance 2. Navigation 3. Telemetry 4. Data gathering/processing 1. Camera 2. Sensors 3. Propulsion 4. Processor 5. Radio Demand Supply
  37. 37. Virtual Market-place Mobilesoft 2017 Keynote 37 Battery Agent Task Agents Resource Agents Acquisition Resource Usage
  38. 38. Bidding, Price Mobilesoft 2017 Keynote 38 Bn,t,r = min(( Alloct,n + Savet,n), (Bn-1,t,r + (Dt,r - St,r) * Pr) • n is the round number • t is the task • r is the resource Pr = (t Bt,r / Sr) Supply of resource r is increased by transitioning to high energy mode. This is done when Pr becomes too high. Alloct,n captures the decision of the battery agent to allocate battery power so that a maximum battery discharge rate is not crossed.
  39. 39. Resource Allocation • How Res. are purchased using Virtual Credits? o Task agents bid for Resources 39 D = 100 S = 50 T1 T2 D = 150 S = 50 S = 100 C1 • Price – Price per Res • $0.02 per Res • Resources allocated based on bids – T1 and T2 get 50 Res 50 50 Mobilesoft 2017 Keynote $1 $1 Price = ($1+$1)/100 = $0.02
  40. 40. Resource Allocation • How Res are purchased using Virtual Credits? o Task agents bids more due to supply-demand mismatch 40 D = 100 S = 50 T1 T2 D = 150 S = 50 S = 100 C1 • Price – $0.035 per Res – Increased • T1 gets $1.5/0.035 = 43 units, T2 gets 57 units. • Inflation Scenario $1.5 $2.0 Inflation: Supply < Demand Resources Transition to High Energy Mode Mobilesoft 2017 Keynote
  41. 41. Resource Allocation • How Res are purchased using Virtual Credits? o Task agents bids more due to supply-demand mismatch 41 D = 100 S = 50 T1 T2 D = 150 S = 50 S = 300 C1 • Price per Res – $0.012 per Res – Decreased • T1 gets. $1.5/$0.012 = 125 units, T2 gets. $2/0.012 = 166 units ! $1.5 $2.0 Deflation: Supply > Demand Resources Transition to Low Energy Mode Can even shut down some of the units? Mobilesoft 2017 Keynote
  42. 42. Resource Allocation • How PUs are purchased using Virtual Money? o Task agents bids more due to supply-demand mismatch 42 D = 100 S = 100 T1 T2 D = 150 S = 150 S = 250 C1 • Supply meets Demand – No change – Price is constant 100 PUs 150 PUs Stable: Supply = Demand Energy Mode not changed Mobilesoft 2017 Keynote
  43. 43. Resource Allocation • Summary o Task bids • More – Under-Supplied • Less – Over-Supplied • Constant – Supply meets Demand o Prevent Inflation/Deflation in prices • By transitioning the resources between energy modes • Maintain a maximum cutoff battery discharge rate • Maintain expected battery life, while maximizing functionality • Energy management of mobile devices in many operational scenarios. 43 Detailed example of distributed energy management in drones can be seen from the accompanying paper. Mobilesoft 2017 Keynote
  44. 44. In this talk • Energy and Performance are not synonymous. • The need for energy measurements. • What are energy bugs and hotspots? • Re-factoring • Mobile SE based on field failures and reviews • Energy management in other mobile devices. Mobilesoft 2017 Keynote 44
  45. 45. Outlook Mobilesoft 2017 Keynote 45 Exploiting user reviews in apps Energy management in drones

×