Energy Consumption Measurement of C/C++ Programs Using Clang Tooling

While in the previous century computer manufacturers and software developers primary and single goal was to produce very fast computers and software systems, in this century this has changed: the widespread use of nonwired but powerful computer devices is making battery consumption/lifetime the bottleneck for both manufacturers and software developers. Unfortunately there is no software engineering discipline providing techniques and tools to help software developers to analyze, understand and optimize the energy consumption of their software! As a consequence, if a developer notices that his/her software is responsible for a large battery drain, he/she gets no support from the language/compiler he/she is using. The hardware manufacturers have already realized this concern and much work in terms of optimizing energy consumption by optimizing the hardware has been done. Unfortunately, the programming language and software engineering communities have not yet completely realize that bottleneck, and as consequence, there is little support for software developers to reason about energy consumption of their software. Although is the hardware that consumes energy, the software can greatly influence such consumption [Bener et al. 2014], very much like a driver that operates a car influences its fuel consumption. In this paper we introduce an automated instrumentation-based method to measure the process level energy consumption for C/C++ programs. The source code is compiled by our Clang tooling based compiler to produce an instrumented code. The generated executable will measure the energy con-

[1]  Shin Nakajima,et al.  Model-based Power Consumption Analysis of Smartphone Applications , 2013, ACES-MB@MoDELS.

[2]  Michael Cohen,et al.  Energy types , 2012, OOPSLA '12.

[3]  Lori L. Pollock,et al.  How do code refactorings affect energy usage? , 2014, ESEM '14.

[4]  Raihan Ur Rasool,et al.  Software level green computing for large scale systems , 2011, Journal of Cloud Computing: Advances, Systems and Applications.

[5]  Hermann Härtig,et al.  Measuring energy consumption for short code paths using RAPL , 2012, PERV.

[6]  Alexander Bakker,et al.  Comparing Energy Profilers for Android , 2014 .

[7]  Jácome Cunha,et al.  Detecting Anomalous Energy Consumption in Android Applications , 2014, SBLP.

[8]  Maurizio Morisio,et al.  Green Software , 2014, IEEE Softw..

[9]  Shirley Moore,et al.  Measuring Energy and Power with PAPI , 2012, 2012 41st International Conference on Parallel Processing Workshops.

[10]  Shivakant Mishra,et al.  Optimizing power consumption in multicore smartphones , 2016, J. Parallel Distributed Comput..

[11]  Norbert Pataki,et al.  Clang matchers for verified usage of the C++ Standard Template Library , 2015 .

[12]  João Saraiva,et al.  Defining Energy Consumption Plans for Data Querying Processes , 2014, 2014 IEEE Fourth International Conference on Big Data and Cloud Computing.

[13]  William G. J. Halfond,et al.  How Does Code Obfuscation Impact Energy Usage? , 2014, 2014 IEEE International Conference on Software Maintenance and Evolution.

[14]  Ding Li,et al.  Integrated energy-directed test suite optimization , 2014, ISSTA 2014.

[15]  Donatella Sciuto,et al.  The Impact of Source Code Transformations on Software Power and Energy Consumption , 2002, J. Circuits Syst. Comput..

[16]  Gustavo Pinto,et al.  Mining questions about software energy consumption , 2014, MSR 2014.

[17]  Gustavo Pinto,et al.  A Comprehensive Study on the Energy Efficiency of Java’s Thread-Safe Collections , 2016, 2016 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[18]  Michael Frank,et al.  JetsonLeap: A Framework to Measure Energy-Aware Code Optimizations in Embedded and Heterogeneous Systems , 2016, SBLP.

[19]  Jácome Cunha,et al.  The Influence of the Java Collection Framework on Overall Energy Consumption , 2016, International Workshop on Green and Sustainable Software.

[20]  Xingming Sun,et al.  Achieving Efficient Cloud Search Services: Multi-Keyword Ranked Search over Encrypted Cloud Data Supporting Parallel Computing , 2015, IEICE Trans. Commun..

[21]  João Paulo Fernandes,et al.  Haskell in Green Land: Analyzing the Energy Behavior of a Purely Functional Language , 2016, 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER).

[22]  William J. Kaiser,et al.  Energy-Efficient Sensing with the Low Power, Energy Aware Processing (LEAP) Architecture , 2012, TECS.

[23]  Gustavo Pinto,et al.  Data-Oriented Characterization of Application-Level Energy Optimization , 2015, FASE.

[24]  Beng Chin Ooi,et al.  The Claremont report on database research , 2008, SGMD.