Elsevier

Journal of Systems Architecture

Volume 71, November 2016, Pages 88-101
Journal of Systems Architecture

Provisioning of power event APIs as a mobile OS facility

https://doi.org/10.1016/j.sysarc.2016.10.001Get rights and content

Abstract

Monitoring various hardware and software events for energy consumption is essential for energy management in mobile devices. However, current mobile operating systems (OS) lack monitoring functionality and do not provide sufficient information of this kind. In this paper, we propose PEMOS (Power Events Monitor for Mobile Operating Systems), a framework for power event APIs for mobile devices, that provides a wide spectrum of energy-related information, enabling in-depth analysis of energy problems. PEMOS provides a set of well-defined APIs as a mobile OS facility, defining various energy-related system events as power events. These are classified into system events and application events, encompassing extensive and fine-grained power-related events. Benefits of PEMOS include extensive coverage of power events, high portability across various platforms, and efficient API implementation. The framework structure is portable across multiple devices, and the standard ioctl-based API implementation enables the same operations on different devices without system modification. We implemented PEMOS on the Android platform to evaluate its efficacy and usefulness. The experimental results and case studies confirm that PEMOS is effective and useful for a range of energy management systems, with minimal overhead.

Introduction

The performance of mobile devices has increased significantly with the advent of powerful hardware and sophisticated platform software. Modern mobile devices consume a large amount of power, but the slow increase in battery capacity is a common source of dissatisfaction for mobile users [1]. Many factors, such as inefficient software operations [2], [3], [4], [5], [6] or users’ energy behavior [7], [8], [9], may lead to significant energy consumption. To optimize energy use in mobile devices, extensive research has investigated diverse areas that include device power modeling and application energy prediction, operating system (OS)-level power management, and application-level energy analysis. Such research aims to predict energy consumption for hardware components, applications, or processes, with a view to minimizing energy consumption or preserving battery lifetime. Energy management schemes, in practice, require diverse kernel-level information such as hardware usage, process information, OS operation status, or user inputs. For example, to estimate energy consumption of mobile device, hardware usage should be collected accurately. Detailed information such as foreground application or hardware usage of each process is required to disaggregate energy to individual application. Collecting such information is indeed challenging for commercial mobile platforms.

Conventional mobile OS provide profiling tools [10] for performance analysis and resource utilization, but OS functionality for collecting energy-related information is limited. For example, commercial OS may provide battery usage information [11], but the granularity of this information remains insufficient for accurate power profiling and energy management. The OS merely provides device-level battery consumption or accumulated energy consumption for each application, leading to difficulties in analyzing the root-cause of energy consumption. Regarding the energy consumption activities of diverse hardware components in the device, a limited set of information is provided from kernel to user space. Even where kernel monitoring acquires such information, it may be insufficient for energy accounting and analysis because of the architectural characteristics of mobile platforms. For instance, operations on some hardware components (i.e., 3 G/LTE and GPS) have limited kernel exposure because a rich application framework manages workflows and hardware resources. In the case of GPS, applications acquire location by calling the API of LocationServiceManager which is a system service, not a kernel service, in the Android platform. Another difficulty is that energy management systems usually require high-level information about user interaction or the framework's inner behavior. For efficient and accurate power management, application-level information should therefore be combined with power estimation results—for example, detailed information about user interactions with an application is useful in assessing the cause of energy inefficiency [2], [3], [4], [5], [8], [9]. Such high-level information of this kind is, however, not generally available at OS level. A further difficulty for effective energy management concerns portability. Limited monitoring functionality means that cumbersome low-level implementation such as modification of kernel and hardware drivers is required for accurate power estimation. Previous approaches to hardware component-level power estimation, such as AppScope [12], Fepma [13], and [22], required device-specific modification of the kernel source, requiring developers to perform a number of tasks to estimate power consumption for a new device, implementing a power profiling system, and interpreting data for each device model. This means that developers must build a power profiling system from scratch for every device model. In summary, the lack of monitoring functionality in current mobile platforms is problematic for energy management, both of applications and the device itself.

We assert that monitoring systems should be designed at OS and platform level by considering energy-related information based on both OS kernel and user behavior, and that a well-formed facility for monitoring such information should be a key feature of any mobile OS. By adequately classifying energy-related information for efficient collection in both kernel and user layers, all relevant data—including low-level power estimation results and high-level information such as user interaction—can be integrated to assist developers to analyze various aspects of energy behavior. As most Linux-based mobile OS consist of the kernel itself and a user-level platform such as Android, a well-designed monitoring system can minimize the porting effort for diverse devices. For example, for accurate power estimation, kernel-level monitoring is required for hardware usage data; as the kernel is based on the same Linux kernel, such monitoring is easily ported onto the device. In the case of high-level information, framework-level monitoring is required to deal with user interactions. Again, the core part of framework is the same, regardless of device model and underlying kernel, and framework-level monitoring can be easily migrated.

In this paper we describe a framework called the Power Events Monitor for Mobile Operating Systems (PEMOS), which supports various energy management schemes by providing power event application programming interfaces (APIs) for mobile OS. Here, power events (PEs) are defined as information to be monitored for energy management of both application and device. PEs include low-level information such as hardware usage, and also high-level one such as user interactions. By providing PEs in an easy and uniform method, PEMOS minimizes efforts to implement power profiling or energy management schemes. Using PEMOS, developers are able to focus on designing key policies rather than data parsing or monitoring. PEMOS uses an event-driven method to trace PEs and provides energy-related APIs as a mobile OS facility. The proposed APIs support fine-grained profiling of PEs and provide energy debugging mechanisms for application developers. The goal of PEMOS is to empower developers to implement device-independent energy-related tools without system modification. Developers would then easily implement monitoring functionalities such as power profiling and workload tracing. To achieve this, the scheme must provide an efficient means of profiling activity, support for the same operations on different devices, and support for energy-aware APIs for the user. On that basis, the framework design has addressed the following issues. First, PEMOS traces diverse energy-related behavior accurately and efficiently. Second, to maximize software portability, event abstractions are designed to allow PEMOS to adapt to various devices and platforms for PE monitoring. Finally, PEMOS provides a standard interface and APIs for mobile applications enabling developers to easily implement a wide spectrum of energy-aware mobile applications. The development of these concepts and their experimental validation are the key contributions of our work.

Section snippets

The concept of power events

Analysis of the energy efficiency of mobile devices requires information about the power behavior of hardware components, processes, or applications. However, the granularity of such information remains insufficient for accurate energy management. Multiple operations are required for energy management because occurrence points are spread widely over both kernel and user space, making it complicated to profile the necessary information. A PE is defined as an event that should be monitored when

Power event APIs

The complex nature of mobile device makes it difficult to conduct energy-related analysis and management. To monitor power consumption, developers need rich knowledge about the operations and power characteristics of each hardware component. This makes fine-grained power profiling without system software modification almost impossible, and implementation depends on the underlying device. In particular, finding the cause of energy inefficiency requires analysis of applications’ power

PEMOS

To provide the aforementioned power event APIs, we designed the mobile OS facility PEMOS, which profiles PEs effectively and provides a range of energy-aware APIs. This section describes the design and architecture of PEMOS, as well as its energy management services.

Evaluation

The PEMOS framework was implemented on the Google Nexus 4 running Android 5.1.1, with Android API 22 (Lollipop). The kernel source was modified to add a System Event Abstraction Layer to collect and manage both hardware events and kernel events. In addition, the ioctl driver was customized to exchange events with the user space (i.e., Android framework). In this framework, system components such as LocationManager and Activity Manager were modified to collect application events. A custom

Use cases

To validate the usefulness of PEMOS, we applied the PEMOS framework to develop a number of energy-related tools. The case studies include (1) real-time power monitoring, (2) example analyses of routine-level energy efficiency, and (3) user-interaction-based application profiling. Each study utilizes the functionality and information provided by PEMOS to explain the utilization of PEMOS data and interfaces to develop energy-related tools without modifying system software.

Discussion

Although PEMOS monitors PEs and estimates energy consumption of application accurately, there are some limitations in the current implementation. First, PEMOS adopts an event-driven method for hardware usage collection to minimize overhead and to maximize accuracy. Since hardware usage is traced by monitoring the operations of Linux kernel, PEMOS should be re-implemented when the kernel changes significantly. Also, PEMOS is currently not applicable to closed platforms, such as iOS, because of

Related work

Active research has been undertaken to clarify the energy behavior of mobile devices by monitoring the operations of their hardware components. PowerScope [19] was the first work to provide an energy-related API for mapping energy consumption to program structure for mobile applications. The tool combines hardware instrumentation with software to measure power consumption, using post-processing software to map sampling results to program structures. Our approach differs in two ways; PEMOS is a

Conclusion

In this paper, we have defined power events in mobile devices as events that occur when system power activity changes. We have shown that the PEMOS framework provides power event APIs that can facilitate the implementation of diverse energy-related tools, enabling effective profiling of various energy-related events in both user and kernel areas. These power event APIs are designed to enable developers to optimize power consumption according to their energy management targets. Implementation of

Acknowledgements

This work was supported by a grant from the National Research Foundation of Korea (NRF), funded by the Korean government, Ministry of Education, Science and Technology under Grant (NRF-2014R1A2A1A11049979).

Chanmin Yoon received his M.S. and Ph.D. in the computer science department at Yonsei University, Korea, in 2009 and 2015, respectively. Dr. Yoon is currently a research engineer at SK Telecom, Korea. His research interests include wireless and mobile computing, context-aware systems and sensor network systems.

References (31)

  • K. Kim et al.

    Wakescope: Runtime wakelock anomaly management scheme for Android platform

  • R. Rao et al.

    Battery modeling for energy aware system design

    Computer

    (2003)
  • A. Jindal et al.

    Hypnos: Understanding and treating sleep conflicts in smartphones

  • MaX. et al.

    edoctor: Automatically diagnosing abnormal battery drain issues on smartphones

    NSDI

    (2013)
  • A.J. Oliner et al.

    Carat: Collaborative energy diagnosis for mobile devices

  • A. Pathak et al.

    Bootstrapping energy debugging on smartphones: A first look at energy bugs in mobile devices

  • H. Falaki et al.

    Systemsens: A tool for monitoring usage in smartphone research deployments

  • LeeS. et al.

    User interaction-based profiling system for Android application tuning

  • A. Shye et al.

    Into the wild: Studying real user activity patterns to guide power optimizations for mobile architectures

  • Oprofile

    A statistical profiler for Linux system (2015)

  • Android

    (2015). Monitoring the battery level and charging state

  • YoonC. et al.

    Appscope: application energy metering framework for Android smartphone using kernel activity monitoring

  • KimK. et al.

    Fepma: fine-grained event-driven power meter for android smartphones based on device driver layer event monitoring

  • DingN. et al.

    Characterizing and modeling the impact of wireless signal strength on smartphone battery drain

  • ZhangL. et al.

    Accurate online power estimation and automatic battery behavior based power model generation for smartphones

  • Cited by (2)

    Chanmin Yoon received his M.S. and Ph.D. in the computer science department at Yonsei University, Korea, in 2009 and 2015, respectively. Dr. Yoon is currently a research engineer at SK Telecom, Korea. His research interests include wireless and mobile computing, context-aware systems and sensor network systems.

    Seokjun Lee is currently a Ph.D. student in the computer science department at Yonsei University, Korea. His research interests include wireless and mobile computing, context-aware systems, and power-aware mobile operating system.

    Rhan Ha received the B.Sc. and M.Sc. degrees in computer engineering from Seoul National University, Seoul, Korea, in 1987 and 1989, respectively, and the Ph.D. degree in computer science from the University of Illinois at Urbana–Champaign, Urbana, in 1995. She is currently an Associate Professor of Computer Engineering at Hong-Ik University, Seoul, Korea. Her research interests are in the areas of real-time embedded systems, distributed systems, communication protocols, and wireless sensor network systems.

    Hojung Cha is currently a professor in computer science at Yonsei University, Seoul, Korea. His research interests include wireless and mobile systems, embedded operating systems, and resource optimization. He received his B.S. and M.S. in computer engineering from Seoul National University, Korea, in 1985 and 1987, respectively. He received his Ph.D. in computer science from the University of Manchester, England, in 1991.

    View full text