Android 1 2 2 4 3 3 AndroidOS 2 An Enegy Profiling for Android Application Syuhei Hiya, 1 Kenji Hisazumi, 1 Toru Ishihara, 1 Takeshi Kamiyama, 4 Tsuneo Nakanishi 1 and Fukuda Akirra 1 This paper proposes a method for profiling power consumption of applications that run on an Android OS. Many power analysis techniques require running actual system and/or large computational load to analyze the power consumption. Furthermore these approaches cannot figure out bottlenecks at the level of classes and methods since they can only analyze the system-wide power consumption. Our method has features that can calculate the power consumption based on lightweight linear model from resource consumption logs, and can analyze the power consumption more fine grain. This paper describes two ways to obtain the logs that are different types of invasive techniques, and clarifies trade-offs between accuracy and invasive about method for logging. 1. WEB 1) 2)3) 4) 5) Android Android OS Eclipse 2 6) 2 1 Dept. of EE and CS, School of Eng.,Kyushu Univ. 2 LSI System LSI Research Center, Kyushu Univ. 3 Graduate School of Information Science and Electrical Engineering, Kyushu Univ. 4 NTT Research Laboratories, NTT Docomo 1 c 2011 Information Processing Society of Japan
A (4.5mW) self (0.5mW) B(3mW) C(1mw) B1(1mW) B2(2mW) C1(1mw) 3 2 4 5 6 2. 2.1 PowerScope 4) SystemMoniter EnergyMonitor EnergyAnalyzer 46 Android 2.2 6) CPU OS CPU CPU 6% P estimate = C 0 + n C i P i (1) i=1 P estimate P i C i C 0 CPU CPU CPU WiFi C i 3. 15 10 5 0 1 4 7 10 13 CAMERA 3.1 FLASH WIFI GPS ログ取得機能 消費電力解析機能 消費電力表示機能 1 Fig. 1 Profiler Image 対象デバイス用の消費電力モデル式 1 3.2 (1) P i 1 2 c 2011 Information Processing Society of Japan
3.3 2 3 GPS 4 CPU WIFI CAMERA 2 Fig. 2 TopView GPS FLASH 8 7 6 ] 5 [ w 4 力電 3 2 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 時刻 [sec] 時刻 3 Fig. 3 Time Line CAMERA FLASH WIFI GPS CPU A (4.5mW) self (0.5mW) B(3mW) C(1mw) 3.4 B1(1mW) B2(2mW) C1(1mw) 4 Fig. 4 Call Tree CPU [mw] Wi-Fi [mw] 0.5 0 0 0.5 0.5 0 2 0 0 0.9 0.1 0 Flash [mw] 4 OS 4. Android Android 4.1 Android Eclipse 6) Nokia N810 Sony Ericsson Xperia Android 4.3 4.4 3 c 2011 Information Processing Society of Japan
CPU Wi-Fi Flash GPS 5 Wi-Fi Flash GPS 4.2 3.4 CPU Android hprof hprof gettimeofday() android.os.debug 2 /proc API 1 Linux /proc 4.3 OS 2 API 4.4 Android Logcat Logcat android.util Log Android SDK ADB(Android Debug Bridge) Android PC 4.3 /proc OS OS /proc /proc Linux Wi-Fi /proc/net/dev Flash /proc/diskstats OS OS 1 API OS s A(s A) A A = time(a) x s time(x) (2) OS time( ) 4.4 API gettimeofday API 4.3 OS 5 OS OS IP OS 4 c 2011 Information Processing Society of Japan
160000 140000 ] 120000 e t y b100000 [ 量信受線無 80000 60000 40000 20000 5. 0 0 5000 10000 15000 20000 25000 30000 35000 40000 時刻 [msec] 5.1 5 Fig. 5 amount of radio reception OS リソースログ メソッドリソースログ /proc gettimeofday API API API IO adb logcat /proc API API /proc /proc 2 1 /proc API 1 2 API /proc API X X /proc 1 2 1 /proc /proc 3000msec 5 www.google.com /proc /proc 500msec 5% 2 /proc /proc /proc /proc /proc 1 /proc Table 1 /proc acquisition interval and the Total Error [ms] 1[ ] 2[ ] 500 3.51 3.66 1000 3.66 2.25 2000 0.65 1.53 3000 0.69 0.43 5.2 5.2.1 /proc 2 /proc Table 2 /proc acquisition interval and the Allocation Error [ms] 500 2099537 1000 2322013 2000 3530099 3000 3948501 /proc /proc /proc 1000ms 500ms 400ms 300ms 200ms 100ms 6 100ms 1000ms 2.5 200[ms] 5 c 2011 Information Processing Society of Japan
3 API Table 3 The effect of API hooks on the application execution time [ms] [ms] 386 13581 ] s [ m 間 時行実 25000 23000 21000 19000 17000 15000 13000 11000 9000 7000 5000 0 200 400 600 800 1000 1200 /proc 取得周期 [ms] 6 /proc Fig. 6 /proc acquisition interval and application execution time API /proc 6. Android /proc API 2 /proc /proc API /proc /proc API /proc 5.2.2 API API 5.2.2 API 5 java.net HttpURLConnection http://www.google.co.jp API 35 /proc API API 616 13188[ms] API 21.4[ms] 5.3 /proc 1) Ye, W., Vijaykrishnan, N., Kandemir, M. and M.J.Irwin: The Design and Use of SimplePower: A Cycle-Accurate Enegy Estimation Tool, Proc. Design Automation Conference, pp.340 345 (2000). 2) L., T., Komarov, K. and Ellis: Energy estimation tools for the Palm, Modeling, Analysis and Simulation of Wireless and Mobile Systems (Boston, MA) (2000). 3) Sinha, A.: Jouletrack: A web based tool for soft - ware energy profiling, Design Automation Conf, pp.220 225 (2001). 4) Flinn, J. and Satyanarayanan: PowerScope: a tool for profiling the energy usage of mobile applications, Proceedings of the Second IEEE Workshop on Mobile Computing Systems and Applications, pp.2 10 (1999). 5) Joseph, R. and Martonosi, M.: Run-time Power Estimation in High-Performance Microprocessors, ISLPED, pp.135 140 (2001). 6) OS,.EMB,, pp.5-30 (2009). 6 c 2011 Information Processing Society of Japan