Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Software Energy Analysis Method using Executable UML for Smartphones Kenji Hisazumi System LSI Research Center Kyushu University.

Similar presentations


Presentation on theme: "A Software Energy Analysis Method using Executable UML for Smartphones Kenji Hisazumi System LSI Research Center Kyushu University."— Presentation transcript:

1 A Software Energy Analysis Method using Executable UML for Smartphones Kenji Hisazumi System LSI Research Center Kyushu University

2 Background Increasing power consumption of mobile phone →Low battery life 2 Calling mail Calling mail Web Browsing Music, Video Game Etc… Traditional mobile phone Smart phone Software

3 Background For reducing power consumption of application 3 ⑤ Modifying source code ① Running app with test cases ② Measuring power consumption Profiling result is important. Adjust parameter Optimize Bug fix Developer ③ Analyzing data ④ Making improvement plan

4 Related work : Estimation of power consumption using device usage Power model based on usage which obtains from OS [1] 4 P estimat e : estimated power V m : usage of smart phone’s parts C m : coefficient M : a set of the factors related to power consumption Power model Android CPU usage Wi-Fi GPS time LCD time Estimated power [1]Kaneda, Y., Okuhira, T., Ishihara, T., Hisazumi, K., Kamiyama T. and Katagiri, M.: A Run-Time Power Analysis Method using OS-Observable Parameters for Mobile Terminals, 2010 International Conference on Embedded Systems and Intelligent Technology (ICESIT 2010), Vol.1, pp.39--44 (2010).

5 Power Consumption Profiling Method based on Actual Android Application Usages 5

6 Background Existing energy profiling method: Unable to take into account all possible usage patterns

7 Proposed method : Data Collection of Actual Android Application Usages Collecting many user’s actual usage 7 developer users Server ① Collecting data (Embedding logging code in application) e.g. : CPU usage Wi-Fi traffic etc. ② Gathering data ⑤ Modifying source code ③ Profiling data ④ Making improvement plan

8 Proposed method : Selective usage collection 8 Usage collection each screen Requirements Estimating use tendency Logging as few count as possible Android application screen ② function : B screen ③ function : C screen ④ function : D screen ① function : A

9 Android application log ① log ④ log ③ log ② Proposed method: Selective usage collection 9 screen ② function : B screen ③ function : C screen ④ function : D screen ① function : A Usage collection each screen Requirements Estimating use tendency Logging as few count as possible

10 Proposed method: Selective usage collection 10 public aspect Logger { after():call(void Activity.onResume()) { //log output logging(“resource consumption is...”); } AspectJ : Extended language of Java –Embedding Java bytecode into program Description example AspectJ-specific object Pointcut: condition of code embedding point Advice: Embedded code

11 Logger Aspect before:onResume { logging(); } after:onPause { logging(); } Proposed method: Selective usage collection 11 Activity Collecting usage log of Activity Class

12 Logger Aspect before:onResume { logging(); } after:onPause { logging(); } Proposed method: Selective usage collection 12 Activity1Activity2 Activity3Activity4 Collecting usage log of all Activity classes in an application

13 Evaluation : Profiling of Android Application Experiment environment Application : Crowdroid ( open-source Twitter client ) Subjects : 13 Device : Galaxy Nexus (only via Wi-Fi) Total usage time : 51 hours Measured resource usage for power model Active time of the Activity classes CPU time of … Wi-Fi communication time to Twitter server of … Downloading tweet number of … (Crowdroid-specific) 13

14 14 Evaluation : Power consumption of the Activity classes

15 15 Displays timeline Login (Choices one of accounts) Composes a tweet Evaluation : Power consumption of the Activity classes

16 16 Displays timeline Login (choices one of accounts) Composes a tweet Focus on Activity 2 Evaluation : Power consumption of the Activity classes

17 17 Evaluation : Detailed analysis Investigating improvement plan of factors in decreasing order by power consumption 1 2 3

18 18 Evaluation : Detailed analysis Display, etc. Control the use time by developer is difficult. CPU I found that CPU is efficiently used. Wi-Fi 1 2 3 Investigating improvement plan of factors in decreasing order by power consumption Next page

19 Evaluation : Detailed analysis The mean and variance of the number of displayed tweets of Activity2 for each subject 19 Downloading Tweet-number of a download operation : 21 (fixed) Downloading Tweet-number of a download operation : 21 (fixed) Reduction of communication time by optimizing the downloading count Improvement plan Investigating improvement plan of factors in decreasing order by power consumption

20 Evaluation : Simulation of optimizing effect of twitter downloading count 20 Our proposed method contains simulation as a preceding process of implementation.  Because of prevention of changing improvement plan after implementation. Assuming that the number of tweets a user's desired be obtained at a time, I verified power-saving effect.

21 21 Optimized power consumption of communication P optW : The optimized power consumption P WLAN : The power consumption calculated from the log T : the communication time in the log T opt : the optimized communication time Evaluation : Simulation of optimizing effect of twitter downloading count

22 The time of downloading x tweets from the Twitter server T opt = 45.507x+938.87[ms] 22 Modifying number of downloads in source code

23 A comparison P WLAN and P optW of Activity2 23 Reduce by approx. 20% (2% of the overall) Reduce by approx. 20% (2% of the overall) Evaluation : Simulation of optimizing effect of twitter downloading count

24 Evaluation : Power consumption of the Activity and the Service classes Experiment environment Application : Crowdroid ( open-source Twitter client ) Subjects : 2 Device : Galaxy Nexus (only via Wi-Fi) Period: a month Measured resource usage for power model Active time of the Activity and the Service classes CPU time of … Communication time of … Downloading tweet number of … (Crowdroid-specific) 24

25 Evaluation : Power consumption of the Activity and the Service classes 25 Activity 2 in previous evaluation

26 Evaluation : Detailed analysis Service A, C and F provides notification function. Subjects don’t use notification function. The user can disable the notification function by changing the settings, but Crowdroid had executed regardless of the settings (version 3.3.0). 26

27 27 Evaluation : Power consumption of the Activity and the Service classes Changing that notification function is started according to the settings

28 Conclusion Feature work Verification of the validity of the simulation 28 Propose the power consumption profiling technique to support the power-saving tuning for Android applications Propose the procedure to analyze power consumption with usage log. Find that Activity and Service class that performs consumes a huge amount of power Verify power-saving effect with simulation and power estimation

29 GUI-Component Energy Profiler for Android Applications 29

30 Proposed method: Research goal The goal is to estimate the energy consumption of each GUI component automatically. 30 Which component consumes most energy? GUI-Component energy profiler can answer this question.

31 Proposed method : estimation of GUI-component energy consumption Codes of GUI component can be divided to three subcomponent: Display, Event-handling and Data-handling subcomponent. 31 Display subcomponent : Displaying data GUI component Event-handling subcomponent : Processing of Event listener a developer implemented Data-handling subcomponent : Obtaining some data from external input and processing them

32 Proposed method : estimation of GUI-component energy consumption 32 Main Thread Sub Thread Displaying method Data Generation Data Processing Event handler processing GUI Updating request Processing of an app The estimation method is as follows: 1)Dividing codes to subcomponents. 2)Inserting logging codes before and after each subcomponent. 3)Running the app and getting logs. 4)Calculating energies.

33 Proposed method : estimation of GUI-component energy consumption 33 Main Thread Sub Thread Displaying method Data Generation Data Processing Event handler processing GUI Updating request Processing of an app The estimation method is as follows: 1)Dividing codes to subcomponents. 2)Inserting logging codes before and after each subcomponent. 3)Running the app and getting logs. 4)Calculating energies. Display subcomponent Event-handling subcomponent Data-handling subcomponent

34 Proposed method : estimation of GUI-component energy consumption 34 Main Thread Sub Thread Displaying method Data Generation Data Processing Event handler processing GUI Updating request Processing of an app The estimation method is as follows: 1)Dividing codes to subcomponents. 2)Inserting logging codes before and after each subcomponent. 3)Running the app and getting logs. 4)Calculating energies from the logs. Logging codes

35 Proposed method : estimation of GUI-component energy consumption 35 Main Thread Sub Thread Displaying method Data Generation Data Processing Event handler processing GUI Updating request Processing of an app The estimation method is as follows: 1)Dividing codes to subcomponents. 2)Inserting logging codes before and after each subcomponent. 3)Running the app and getting logs. 4)Calculating energies. Energy estimation model Estimated energy OS- resource logs

36 Proposed method : Estimation model of energy consumption The energies is estimated by following energy-estimation model. 36 C CPU, C WiFi : CPU and WiFi coefficient E CPU, E WiFi : The estimated energy of CPU and WiFi T user, T sys : CPU usage time of user and system mode T CPU : CPU usage time (including all modes) V : Voltage of smartphone

37 Proposed method : Automatic prober It is not realistic to embed logging codes in a application manually. 37 Too many codes Logging code Dirtying original code Subcomponent SOURCE Where? Probing location depends on apps Automatic prober, which can automatically search probing location and embed logging codes, is needed. especially data-handling subcomponent

38 Proposed method : Automatic prober AspectJ : Extended language of Java Embedding Java bytecode into an application without dirtying original codes 38 public aspect Logger { after():call(void Activity.onResume()) { //log output logging(“resource consumption is...”);} } Example Logging codes is automatically embedded before/after particular method of apps. Probing location of display and event-handling subcomponents can be decided because they consist of particular methods.

39 Proposed method : Automatic prober To decide probing location for data-handling subcomponent, Automatic prober performs data-flow analysis. 39 2. Deciding probing location from the data flow 3. Adding logging codes using AspectJ Data flow 1. performing data-flow analysis

40 Evaluation : estimation of GUI-component energy consumption Experiment environment - Comparison between Multi and Single component app - Device : Xperia Z Ultra - GUI : Button, TextView, ListView, Ad. banner 40 Multi-component app Single-component app Comparison

41 Evaluation : estimation of GUI-component energy consumption 41 39.4% 16.5% 1.1% 8.3% NOT including data connectionIncluding data connection

42 Evaluation : estimation of GUI-component energy consumption 42 39.4% 16.5% 1.1% 8.3% NOT including data connectionIncluding data connection 0.00000009 [J] 1.13 [J] <<

43 Conclusions and future work Energy consumption profiler is useful for developers of smartphone. Our proposed method realize GUI-component energy consumption profiler. Two experiment show the feasibility of proposed method. More various GUI components and ways to obtain data Applying proposed method to real applications Improving our profiler to fully-automated 43 Conclusion Future work


Download ppt "A Software Energy Analysis Method using Executable UML for Smartphones Kenji Hisazumi System LSI Research Center Kyushu University."

Similar presentations


Ads by Google