• 沒有找到結果。

Correlating Energy with System Activities

3. Design and Implementation of Energy Profiling Tool

3.5 Correlating Energy with System Activities

Energy analyzer module is responsible to correlate power samples with system activities.

Energy consumption analyzer module analyzes system activities files to detect the Process ID, Function ID, and Block ID values that were collected during the test. Later on PID values are charged with energy values for both CPU and WNIC activities. As one of profiling tool’s limitation, Function ID and Block ID values are charged only with the energy values of CPU activities. The process’s total energy consumption can be represented as formula (5) in

Chapter 4

Experiment Overview

In this thesis, we propose a measurement base energy profiling tool which can provide process-level, function-level, and code block-level energy consumption report. We design several experiments to demonstrate the capabilities and correctness of our tool. The first experiment measures power consumption of functions with different instruction classes and compares the results with previous researches. The second experiment measures power consumption before and after turning on device’s LEDs. The results of these two experiments can show the correctness of our profiling tool in function-level and block-level. The third experiment demonstrates the capability to measure the energy consumption of USB Wi-Fi interface. We also measure the energy consumption of FTP client by sending files with different size to FTP server.

4.1. Experiment Environment

The experiment environment is shown in Figure 10. The measurement equipment contains a current probe and a data acquisition (DAQ) card. The current clamp uses Ampere's law to measure current flow of target I/O device, and the data acquisition card collects measured current value by current clamp. The experimental platform is beagleboard xM using TI Cortex A8 with 1 GHZ (DM3730). The Wi-Fi 802.11 BG USB adaptor is connected to the target board as the I/O component and connected to D-Link DIR-600 AP Router via air. The programs execute on the experimental platform running the Linux kernel 2.6.37 with Android framework version 2.3.4.

Table 2 Specification of experiment equipments

Name Model

Measurement Equipment

DAQ NI cDAQ-9174

Current clamp Fluke I30S

Target

Experimental platform BeagleBoard xM Rev C USB WLAN adaptor D-Link DWL-G122

Wi-Fi Router D-Link DIR-600

4.2. Cases study and results

The first experiment measures power consumption of functions with different instruction classes. The functions are

add instruction is duplicated 10000 times using .rept directive experiment result shows that

and nop instructions. Previous researches and ARM926EJ-S- core respectively.

Figure 11 Power consumption of

Figure 10 Measurement Equipments

Cases study and results

The first experiment measures power consumption of functions with different instruction implemented using inline assembler as depicted

instruction is duplicated 10000 times using .rept directive in addinst() function. The experiment result shows that power consumption of multiply instruction

Previous researches [16][17] also represent the same result for ARM7TDI core respectively.

Figure 11 Power consumption of different instruction

The first experiment measures power consumption of functions with different instruction implemented using inline assembler as depicted in Figure 11. The in addinst() function. The multiply instruction is higher than add, sub,

me result for ARM7TDI

types

The second experiment measure device. The instruction numbers

shows consistent results for different functions

Figure 12 Power consumption of turning on/off LED

The next experiment represents the

supported in Linux kernel. We observe the energy consumption of find that energy consumes by idle process is high.

CPU IDLE feature can save 13.5% total system energy and save 250 mW average

Figure 13 Energy consumption of enabling/disabling CPU IDLE feature

1.54

The second experiment measures power consumption before and after turning

The instruction numbers are varied from 10000 to 160000 for different functions for different functions before and after turning on LED in Figure 12.

Figure 12 Power consumption of turning on/off LED

resents the total energy saving when we turn on the CPU IDLE

Linux kernel. We observe the energy consumption of the measurement result and find that energy consumes by idle process is high. The measurement result shows that turn on

IDLE feature can save 13.5% total system energy and save 250 mW average

Figure 13 Energy consumption of enabling/disabling CPU IDLE feature

10000 20000 40000 80000

Instruction Numbers

Turn ON Leds Turn OFF Leds

before and after turning on LED in target for different functions. It rning on LED in Figure 12.

Figure 12 Power consumption of turning on/off LED

total energy saving when we turn on the CPU IDLE feature the measurement result and The measurement result shows that turn on IDLE feature can save 13.5% total system energy and save 250 mW average Power.

Figure 13 Energy consumption of enabling/disabling CPU IDLE feature

160000 Turn ON Leds Turn OFF Leds

Most mobile devices support Wi Wi-Fi component contributes

modified wpa_supplicant daemon for

address. We measure the total energy of device before dongle. The total energy increases 22.93 Joule energy increases, (E2-E1)/E1

daemon to establish Wi-Fi connection is 18.29 Joule (53.8% total energy increases we execute dhcpcd daemon

less energy than CPU because dhcp

acquirement flow. The total energy increases is unremarkable when executing dhcpcd daemon Disable Wi-Fi component can improve the energy consumption significantly.

Figure 14 Energy consumption of

The next experiment measures energy consumption of FTP client sending size to FTP server. The Wi

depicted in Figure 15 and Table 3 size.

Most mobile devices support Wi-Fi interface. In this experiment, we would like to know how Fi component contributes total energy consumption of mobile device.

daemon for Wi-Fi support and uses dhcpcd daemon We measure the total energy of device before (E1) and after (E2)

increases 22.93 Joule after inserting USB Wi E1)/E1). After inserting USB Wi-Fi dongle, we execute

Fi connection and measure total energy (E3). The total energy 53.8% total energy increases, (E3-E1)/E1). After establishing Wi

daemon to obtain IP address from dhcp server. Wi-Fi component consumes because dhcp protocol takes only four packets

The total energy increases is unremarkable when executing dhcpcd daemon onent can improve the energy consumption significantly.

Figure 14 Energy consumption of target device with various

The next experiment measures energy consumption of FTP client sending Wi-Fi component contributes more energy consumption

and Table 3. The total energy consumption is proportional to transfer file Fi interface. In this experiment, we would like to know how energy consumption of mobile device. Android uses a daemon to obtain the IP (E2) inserting USB Wi-Fi ter inserting USB Wi-Fi dongle (30% total Fi dongle, we execute wpa_supplicant The total energy increases After establishing Wi-Fi connection, Fi component consumes packets to complete IP The total energy increases is unremarkable when executing dhcpcd daemon.

onent can improve the energy consumption significantly.

target device with various scenarios

The next experiment measures energy consumption of FTP client sending files with different consumption than CPU as The total energy consumption is proportional to transfer file

Figure 15 Energy consumption of FTP Client with different file size

Table 3

0 1 2 3 4 5 6 7 8 9

8M

Energy Consumption (J)

Total Energy(J)

Figure 15 Energy consumption of FTP Client with different file size

Table 3 Energy consumption of FTP Client

4M 2M 1M 512K 256K

File Size (bytes)

Total Energy(J) WiFi Energy(J) CPU Energy(J)

Figure 15 Energy consumption of FTP Client with different file size

128K

We have demonstrated the capabilities of our profiling tool in previous experiments. The next experiment wants to evaluate the performance overhead of dynamic source instrument. We chose Lmbench [38] performance analysis tool as our benchmark program. The average running time is measured in three cases, instrument all functions, instrument all instructions within main() function, and without instrument in benchmark program. The measurement results are represented in Figure 16. Per-function instrument overhead is 0.021 milliseconds and is less than per-instruction instrument overhead which is 0.149 milliseconds. The instruction numbers within main( ) function is too small and may lead to higher overhead.

Figure 16 Dynamic source instrument overhead

Chapter 5

Conclusion

In this thesis, we have developed an energy profiling tool which can provide GUI front-end and profiles native part of Android system. Using the dynamic source instrument technique, we have improved our profiling tool and provide more flexible way to record system activities.

Using line of codes and instruction address mapping makes it possible to coupling source code to energy consumption. We verify the correctness of profiling tool by several experiments. The result shows that the profiling tool can measure power consumption in process-level, function-level and code block-level with low overhead. Furthermore, the asynchronize I/O issue is addressed. We instrument the kernel code to map energy consumes by Wi-Fi component with correct process and demonstrate the ability of the profiling tool on asynchronize I/O issue using ftp client application. The well formatted performance and energy profiling reports in process-level, function-level, and code block-level make software designers to focus on the energy consumption hot spot and optimize their software in a better way.

Chapter 6

References

[1] J. Flinn and M. Satyanarayanan, “Powerscope: A Tool for Profiling the Energy Usage of Mobile Applications”, in Proceedings of Second IEEE Workshop Mobile Computer Systems and Applications, 1999.

[2] Changjiu Xian, Le Cai, and Yung-Hsiang Lu, “Power Measurement of Software Programs on Computers With Multiple I/O Components”, IEEE Transactions on Instrumentation and Measurement, Vol. 56, pp. 2079-2086, 2007.

[3] Kutty S Banerjee, Emmanuel Agu., “PowerSpy: Fine-Grained Software Power Profiling for Mobile Devices”, in Proceedings of IEEE WirelessCom, 2005.

[4] Rong Ge, Xizhou Feng, Shuaiwen Song, Hung-Ching Chang, Dong Li , and K.W. Cameron.,

“Powerpack: Energy profiling and analysis of high-performance systems and applications”, IEEE Transactions on Parallel and Distributed Systems, 2010.

[5] IAR Systems, http://www.iar.com/en/Products/IAR-Embedded-Workbench/Power-debuggi ng.

[6] A. Kansal and F. Zhao, “Fine-grained energy profiling for power-aware application design”, in Proceedings of the Workshop on Measurement and Modeling of Computer Systems, 2008.

[7] T. Do, S. Rawshdeh, and W. Shi, “pTop: A Process-level Power Profiling Tool”, in Proceedings of the Workshop on Power Aware Computing and Systems, October 2009.

[8] Changjiu Xian, Yung-Hsiang Lu, Zhiyuan Li, “A Programming Environment with Runtime Energy Characterization for Energy-Aware Applications”, ISLPED'07, August 27-29, 2007.

[9] Kanishka Lahiri, Anand Raghunathan, Sujit Dey, “Efficient Power Profiling for Battery-Driven Embedded System Design”, IEEE Transactions on Computer-aided Design of Integrated Circuits and Systems, Vol. 23, No. 6, June. 2004.

[10] Y.-H. Lu, L. Benini and G. Michelli, “Power-Aware Operating Systems for Interactive Systems”, IEEE Transactions on VLSI Systems, Vol. 10, No. 2, Apr. 2002.

[11] Yunsi Fei , Srivaths Ravi , Anand Raghunathan , Niraj K. Jha, “Energy-optimizing source code transformations for operating system-driven embedded software”, ACM Transactions on Embedded Computing Systems (TECS), Vol. 7, No 1, December 2007.

[12] Tajana Šimunić , Luca Benini , Giovanni De Micheli , Mat Hans, “Source code optimization and profiling of energy consumption in embedded systems”, in Proceedings of the 13th international symposium on System synthesis, September 20-22, 2000.

[13] V. Tiwari, S. Malik, and A. Wolfe, “Power analysis of embedded software: A first step toward software power minimization”, IEEE Transactions on VLSI System, Vol. 2, 1994.

[14] V. Tiwari, S. Malik, A. Wolfe, M. Lee, “Instruction Level Power Analysis”, Journal of

VLSI Signal Processing Systems, No 1, pp.223–2383, 1996.

[15] T. Simunic, L. Benini, G. De Micheli,“Cycle-Accurate Simulation of Energy Consumption in Embedded Systems”, DAC, 1999.

[16] N. Chang, K. Kim, and H. G. Lee, “Cycle-accurate energy consumption measurement and analysis: Case study of ARM7TDMI”, in Proceedings of Int. Symp. Low Power Electron.

Design, pp.185 - 190, 2000.

[17] Blume, H., Becker, D., Rotenberg, L., Botteck, M., Brakensiek, J., Noll, T.G. ”Hybrid functional- and instruction-level power modeling for embedded and heterogeneous processor architectures”, Journal of Systems Architecture, 53 (10), pp. 689-702, 2007.

[18] SystemTap, http://sourceware.org/ systemtap/

[19] J. Levon, “Oprofile - a system profiler for linux”, http://oprofile.sourceforge.net/doc/

index.html.

[20] Tracing Wiki, http://lttng.org/tracingwiki/index.php/Tracepoints_and_Markers.

[21] Ptrace, http://en.wikipedia.org/wiki/Ptrace.

[22] A. Mavinakayanahalli, P. Panchamukhi, J. Keniston, A. Keshavamurthy, and M.

Hiramatsu, “probing the guts of kprobes”, in Ottawa Linux Symposium, pp. 101–115, 2006.

[23] Yao Guo, Ziwen Chen, Xiangqun Chen, “A Lightweight Dynamic Performance Monitoring Framework for Embedded Systems”, Embedded Software and Systems, ICESS '09. 25-27 May 2009.

[24] Alexey G., Sergey G., Jaehoon J., “Dynamic Binary Instrumentation Framework for CE Devices”, in Proceedings of the Linux Symposium, July 13th–16th, 2010.

[25] Jim K., Ananth M., Prasanna P., Vara P., “Ptrace, Utrace, Uprobes: Lightweight, Dynamic Tracing of User Apps”, in Proceedings of the Linux Symposium, Volume One, June 27th–30th, 2007.

[26] LessWatts. http://www.lesswatts.org

[27] uprobes patch, http://thread.gmane.org/gmane.linux.kernel/390558

[28] Kprobes Support for MIPS, Lubna, Vikas, Madhvesh, Sony India Software Centre.

http://elinux.org/images/4/44/Kprobes-MIPS-overview.pdf

Chiao Tung Univ., Hsinchu, Taiwan, 2010.

[31] Ilter Suat and Shiao-Li Tsao, “Energy Consumption Profiling Tool for Mobile Devices in an Emulated Wireless Environment”, A Thesis for master degree of Dept. of Comput. Sci. &

Inf. Eng., Nat. Chiao Tung Univ., Hsinchu, Taiwan, 2010.

[32] Xiang Zhou, Bing Guo, Yan Shen and Qi Li, “Design and implementation of an improved C source-code level program energy model”, Embedded Software and Systems,

2009.

[33] Pollari, M. and Kanstren, T., “A Probe Framework for Monitoring Embedded Real-time Systems”, Internet Monitoring and Protection, 2009.

[34] J. Levon, “Oprofile - a system profiler for linux”, http://oprofile.sourceforge.net/doc/

index.html.

[35] Beagle board xM Platform, http://beagleboard.org/

[36] NI PCI-6115 DAQ Card, http://sine.ni.com/nips/cds/view/p/lang/en/nid/11886 [37] D-Link DWL-G122 USB Wireless NIC - FW Version 3.0, http://www.dlink.com/

products/?pid=334

[38] Lmbench – Tools for Performance Analysis, http://www.bitmover.com/lmbench/

相關文件