ABSTRACT
Despite their immense popularity in recent years, smartphones are and will remain severely limited by their battery life. Preserving this critical resource has driven smartphone OSes to undergo a paradigm shift in power management: by default every component, including the CPU, stays off or in an idle state, unless the app explicitly instructs the OS to keep it on! Such a policy encumbers app developers to explicitly juggle power control APIs exported by the OS to keep the components on, during their active use by the app and off otherwise. The resulting power-encumbered programming unavoidably gives rise to a new class of software energy bugs on smartphones called no-sleep bugs, which arise from mis-handling power control APIs by apps or the framework and result in significant and unexpected battery drainage.
This paper makes the first advances towards understanding and automatically detecting software energy bugs on smartphones. It makes the following three contributions: (1) we present the first comprehensive study of real world no-sleep energy bug characteristics; (2) we propose the first automatic solution to detect these bugs based on the classic reaching definitions dataflow analysis algorithm; (3) we provide experimental data showing that our tool accurately detected all 17 known instances of no-sleep bugs and found 34 new bugs in the 73 apps examined.
- "Smartphone sales overtake pcs for the first time." URL: http://mashable.com/2012/02/03/smartphone-sales-overtake-pcs/Google Scholar
- H. Zeng, C. S. Ellis, A. R. Lebeck, and A. Vahdat, "Ecosystem: Managing energy as a first class operating system resource," in Proc. of ASPLOS, 2002. Google ScholarDigital Library
- "Android powermanager class." URL: http://developer.android.com/reference/android/os/PowerManager.htmlGoogle Scholar
- A. Pathak, Y. C. Hu, and M. Zhang, "Bootstrapping energy debugging for smartphones: A first look at energy bugs in mobile devices," in Proc. of Hotnets, 2011. Google ScholarDigital Library
- S. Lu, S. Park, E. Seo, and Y. Zhou, "Learning from mistakes - a comprehensive study on real world concurrency bug characteristics," in ASPLOS, 2008. Google ScholarDigital Library
- A. Aho, M. Lam, R. Sethi, and J. Ullman, Compilers: principles, techniques, and tools. Pearson/Addison Wesley.Google Scholar
- S. Lu, S. Park, C. Hu, X. Ma, W. Jiang, Z. Li, R. Popa, and Y. Zhou, "Muvi: automatically inferring multi-variable access correlations and detecting related semantic and concurrency bugs," in SOSP, 2007. Google ScholarDigital Library
- "Android sensorevent class." URL: http://developer.android.com/reference/android/hardware/SensorEvent.htmlGoogle Scholar
- "Class powermanager.wakelock: Reference count." URL: http://developer.android.com/reference/android/os/PowerManager.WakeLock.html#setReferenceCounted(boolean)Google Scholar
- "Class powermanager.wakelock: Timer based." URL: http://developer.android.com/reference/android/os/PowerManager.WakeLock.html#acquire(long)Google Scholar
- A. Pathak, Y. C. Hu, M. Zhang, P. Bahl, and Y.-M. Wang, "Fine-grained power modeling for smartphones using system-call tracing," in Proc. of EuroSys, 2011. Google ScholarDigital Library
- L. Zhang, B. Tiwana, Z. Qian, Z. Wang, R. Dick, Z. Mao, and L. Yang, "Accurate Online Power Estimation and Automatic Battery Behavior Based Power Model Generation for Smartphones," in Proc. of CODES+ISSS, 2010. Google ScholarDigital Library
- A. Shye, B. Scholbrock, and G. Memik, "Into the wild: studying real user activity patterns to guide power optimizations for mobile architectures," in MICRO, 2009. Google ScholarDigital Library
- "Dialer app." URL: http://www.java2s.com/Open-Source/Android/android-platform-apps/Phone/com/android/phone/PhoneApp.java.htmGoogle Scholar
- "Android proguard." URL: http://developer.android.com/guide/developing/tools/proguard.htmlGoogle Scholar
- "Decompiling apps." URL: http://siis.cse.psu.edu/ded/Google Scholar
- "Android - an open handset alliance project." URL: http://code.google.com/p/android/issues/listGoogle Scholar
- "Maemo community." URL: http://maemo.org/intro/Google Scholar
- "Sipservice: release wake lock for cancelled tasks." URL: https://github.com/android/platform_frameworks_base/commit/0c01e6e060d079b0a25a44c1159db63944afce17Google Scholar
- "Github: Social coding." URL: https://www.github.com/Google Scholar
- "Agenda." URL: http://www.androidagendawidget.comGoogle Scholar
- "Facebook 1.3 not releasing partial wake lock." URL: http://geekfor.me/news/facebook-1-3-wakelock/Google Scholar
- "K9mail: Simplifying wakelock." URL: http://code.google.com/p/k9mail/source/detail?r=1696Google Scholar
- "Checkinmap: Disable location updates when checkinmap is paused." URL: https://github.com/jmschanck/Ushahidi_Android/commit/337b48f5f2725f3e84796fab12947ffbec3c0357Google Scholar
- "My tracks android app." URL: http://mytracks.appspot.comGoogle Scholar
- "Babblesink: Move line inside try in case of npe before release of wake lock." URL: https://github.com/hatstand/babblesink/commit/9fbc6f01ce81ef4625a6bd62a3b4b787e6080e36Google Scholar
- "Ensuring that the wakelock is released during exception." URL: https://github.com/commonsguy/cwac-wakeful/commit/c7d440f1150887bb9a1a3c44015c7579d7ab1970Google Scholar
- "frameworks/base/telephony: Release wakelock on ril request send error." URL: https://gist.github.com/CyanogenMod/android_frameworks_base/commit/133d22d577aa86a8e4095e3af29851d1bd7f7b1bGoogle Scholar
- "Ensure wake lock is released when an ioexception is thrown during a sync." URL: https://github.com/mtuton/android_apps_email/commit/85fec873c4413ef86d40972cc3dbe925ee23e733Google Scholar
- "Android issue#9307 fixed - partial wake lock released." URL: https://github.com/CyanogenMod/android_packages_apps_Email/commit/f53bf8f178380ed882a0fa34e10c41f9e8242b93Google Scholar
- "Wakelock issue for driver stop." URL: https://github.com/buglabs/android-buglabs-frameworks-base/commit/3bf504df9fc1971078fdde7eed418a0dd8f601e2#wifiGoogle Scholar
- "Fix wakelock leak in powermanagerservice.sendnotificationlocked()." URL: http://gitorious.org/rowboat/frameworks-base/commit/93597ed1839de164c81f83832d4c2373ea32ac8fGoogle Scholar
- "Using a locationlistener is generally unsafe for leaving a permanent partial_wake_lock." URL: http://code.google.com/p/android/issues/detail?id=4333Google Scholar
- "Locationmanagerservice: Fix race when removing locationlistener." URL: https://gist.github.com/CyanogenMod/android_frameworks_base/commit/0528b9b26a9d64ba43acd0e334638303d514b8eb#location/java/android/location/ILocationProvider.aidlGoogle Scholar
- "Email application partial wake lock." URL: http://code.google.com/p/android/issues/detail?id=9307Google Scholar
- "E-mail app has a bug which causes a partial wake lock to be held until manually interrupted." URL: http://code.google.com/p/android/issues/detail?id=6811Google Scholar
- "Android backup service." URL: http://code.google.com/android/backup/index.htmlGoogle Scholar
- "Googlebackuptransport holds backup wake lock so long which leads to high current." URL: http://www.google.bg/support/forum/p/Google+Mobile/thread?tid=481ff31338a19536Google Scholar
- "Fix threading problem that resulted in the wakelock being held too long." URL: https://github.com/CyanogenMod/android_hardware_qcom_gps/commit/a162c4351926285892214b0726aaf07f0631dc72Google Scholar
- "Googlemaps holding wakelock for long." URL: http://www.google.com/support/forum/p/maps/thread?tid=016d2cec36d7410bGoogle Scholar
- "java.lang.exception class." URL: http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Exception.htmlGoogle Scholar
- "Email 2.3 app keeps awake when no data connection is available." URL: http://www.google.com/support/forum/p/Google+Mobile/thread?tid=53bfe134321358e8Google Scholar
- J. B. Kam and J. D. Ullman, "Global data flow analysis and iterative algorithms," J. ACM, vol. 23, 1976. Google ScholarDigital Library
- E. M. Myers, "A precise inter-procedural data flow algorithm," in POPL. ACM, 1981. Google ScholarDigital Library
- "java.lang class runtimeexception." URL: http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/RuntimeException.htmlGoogle Scholar
- F. Qian, L. Hendren, and C. Verbrugge, "A comprehensive approach to array bounds check elimination for java," in Compiler Construction, 2002. Google ScholarDigital Library
- R. Bodik, R. Gupta, and V. Sarkar, "Abcd: Eliminating array bounds checks on demand," in PLDI, 2000. Google ScholarDigital Library
- M. Bravenboer and Y. Smaragdakis, "Exception analysis and points-to analysis: better together," in International symposium on Software testing and analysis, 2009, pp. 1--12. Google ScholarDigital Library
- J. Lee, D. Padua, and S. Midkiff, "Basic compiler algorithms for parallel programs," in ACM SIGPLAN Notices, 1999. Google ScholarDigital Library
- D. Grunwald and H. Srinivasan, "Data flow equations for explicitly parallel programs," in PPoPP, 1993. Google ScholarDigital Library
- ".dex: Dalvik executable format." URL: http://source.android.com/tech/dalvik/dex-format.htmlGoogle Scholar
- "Android activity." URL: http://developer.android.com/reference/android/app/Activity.htmlGoogle Scholar
- S. Agarwal, R. Mahajan, A. Zheng, and V. Bahl, "There's an app for that, but it doesn.t work. diagnosing mobile applications in the wild," in Hotnets, 2010. Google ScholarDigital Library
- Z. Yin, X. Ma, J. Zheng, Y. Zhou, B. Lakshmi, and S. Pasupathy, "An empirical study on configuration errors in commercial and open source systems," in SOSP, 2011. Google ScholarDigital Library
- D. Engler and K. Ashcraft, "Racerx: Effective, static detection of race conditions and deadlocks," SOSP, 2003. Google ScholarDigital Library
Index Terms
- What is keeping my phone awake?: characterizing and detecting no-sleep energy bugs in smartphone apps
Recommendations
Where is the energy spent inside my app?: fine grained energy accounting on smartphones with Eprof
EuroSys '12: Proceedings of the 7th ACM european conference on Computer SystemsWhere is the energy spent inside my app? Despite the immense popularity of smartphones and the fact that energy is the most crucial aspect in smartphone programming, the answer to the above question remains elusive. This paper first presents eprof, the ...
Hypnos: understanding and treating sleep conflicts in smartphones
EuroSys '13: Proceedings of the 8th ACM European Conference on Computer SystemsTo maximally conserve the critical resource of battery energy, smartphone OSes implement an aggressive system suspend policy that suspends the whole system after a brief period of user inactivity. This burdens developers with the responsibility of ...
WakeScope: runtime WakeLock anomaly management scheme for Android platform
EMSOFT '13: Proceedings of the Eleventh ACM International Conference on Embedded SoftwareAndroid provides a WakeLock mechanism for application developers to ensure the proper execution of applications without having to enter the sleep state of a device. When using the WakeLock mechanism, application developers should bear the responsibility ...
Comments