06-10-2016, 02:12 PM
1458038267-couto2015.pdf (Size: 207.4 KB / Downloads: 4)
Abstract—
This paper presents GreenDroid, a tool for monitoring and
analyzing power consumption for the Android ecosystem. This
tool instruments the source code of a giving Android application
and is able to estimate the power consumed when running it.
Moreover, it uses advanced classification algorithms to detect
abnormal power consumption and to relate them to fragments in
the source code. A set of graphical results are produced that help
software developers to identify abnormal power consumption in
their source code.
I. INTRODUCTION
While in the previous century computer manufacturers,
software engineers and software developers were mainly looking
for fast computer devices/software, this has drastically
changed with the recent advent and wide use of mobile devices,
like laptops, tablets and smartphones. In our mobile-device
age execution time is not the only concern. In fact, nowadays
one of the main computing bottlenecks is power consumption.
Indeed, mobile-device manufacturers and their users are as
concerned with the performance of their device as they are
with battery consumption/lifetime.
This growing awareness on energy efficiency is also changing
the way programmers develop their software. As shown
by recent empirical studies [1], software developers are more
and more concerned on developing energy efficient software.
Unfortunately, developing energy-aware software is still a
difficult task. While the programming language community
has developed advanced and widely-used software tools, such
us debuggers and fault localization tools [2], memory profiler
tools [3], [4], testing tools [5], [6], [7], benchmark and runtime
monitoring frameworks [8], compiler optimizations [9], etc
there are no equivalent tools/frameworks to profile/optimize
power consumption.
This paper presents a software tool, named GreenDroid1,
for monitoring and analyzing power consumption for the
Android ecosystem, one of the largest software ecosystems for
mobile devices. This tool uses a power consumption model to estimate the power consumed by an Android application.
Moreover, GreenDroid also relates the power consumed by
the application to fragments of the applications’ source code.
Thus, it can give software developers an indication by pointing
to the source code, where their applications may be causing
an abnormal power consumption.
To do this, GreenDroid combines several software engineering
techniques: it uses a traditional compiler front-end that
parses Android/Java programs and builds an Abstract Syntax
Tree (AST).
Then, it uses generalized tree traversal in the AST in order
to instrument a given application’s source code and test cases
with calls to the power model.
After that, the Android testing framework is used to execute
the instrumented test cases with the instrumented version of
the application, so that it collects information about power
consumed at runtime. Then, our tool uses source code classi-
fication algorithms, proposed in [10], in order to relate power
consumption to source code fragments.
Finally, the tool produces different graphical results relating
execution time and power consumption (bar diagrams), source
code methods/classes/packages and power consumption (sunburst
diagrams), hardware devices and power consumption (pie
chart).
It is important to say that this is only a tool demo.
Here, we demonstrate how to combine several technologies
to build a tool that is capable of analyzing power consumption
of Android applications. The classification methodology, the
results obtained from analyzing concrete applications and the
discussion about them are presented in [10].
In the next sections we will explain how the tool was
developed, what technologies were used and how does the
tool works. We start by briefly presenting the Power Tutor
Model: a power consumption model for Android devices, and
the extension we performed so that it can be used as an API
by other applications. In Section III we describe GreenDroid’s
instrumentation front-end. Section IV presents the techniques
used to execute the instrumented application and to analyze
the collected power-related data. It also presents the different
graphical results produced by our tool when analyzing a real Android application. After that, we present related work
(Section V) and our conclusions (Section VI).
II. ENERGY CONSUMPTION MODELS FOR ANDROID
APPLICATIONS
In a computer device, the hardware is what consumes
power. However, the software that operates the hardware can
have a significant impact on the power consumed, very much
like the driver that operates a car. Thus, in order to measure the
power consumed by a software system, we have to measure the
power consumed by the hardware executing it. There are two
main approaches to monitor power consumption: Firstly, by
using an external data acquisition (DAC) device that monitors
the power consumed by other electronic device. Secondly,
by using power consumption models that estimate power
consumption. The GreenDroid tool uses this second approach.
There are several power consumption models for the Android
ecosystem [11], [12], [13], [14], [15] that consider the
hardware components of Android devices (like for example,
CPU, Display, GPS, WiFi, etc), their characteristics (number
of cores), and possible states to provide a power model.
GreenDroid uses the power tutor model [15]: a state-of-the-art
power consumption model for smartphones [11].
This power consumption model associates to each hardware
component a list of different state variables. These variables
influence the operating mode that a particular component can
have, and, thus, the power consumed by it. Table I shows
an example of a power consumption model instance for a
particular smartphone.