Slide 1

Slide 1 text

Energy Profiler for Android Emulator Diego Ruggeri [email protected]

Slide 2

Slide 2 text

Project Proposal Energy-Aware Computing 2 Project Outline Energy Profiler for Android Emulator • Project Summary • Android Emulator • Energy Model Archtecture • Code • Demo

Slide 3

Slide 3 text

Project Proposal Energy-Aware Computing 3 Project Summary • Add instrumentation to Android Emulator to capture hardware events, duty cycle, clock frequency, etc. • Use existing power models to predict consumption in real devices • Empowering Developers to Estimate App Energy Consumption • Modem state machine

Slide 4

Slide 4 text

Project Proposal Energy-Aware Computing 4 Android Emulator • Two versions of android emulator • The first is a fork of qemu, incompatible with the mainline (repo qemu) It emulates a hardware called goldfish, which has an specific android kernel for it. • The newer one was started by linaro to support arm v8 64 bits using qemu 2.0 source code and is now default (repo qemu-android) The emulated hardware is called ranchu It is periodically rebased on top of latest qemu • Tracetool generates tracing glue code for multiple backends A file trace-events specify events end formats

Slide 5

Slide 5 text

Project Proposal Energy-Aware Computing 5 Android Emulator • To build you need to use repo tool to download multiple gits • Total was about 8 GB of code, 11 GB after building • I used the studio-dev branch • Then switched to the most up-to-date is emu-master-dev • qemu, android-qemu • dependencies, libs • sdk, ndk • cross-compilers: gcc (linux), clang (mac), mingw (windows) • 32 and 64 bits • kernel

Slide 6

Slide 6 text

Project Proposal Energy-Aware Computing 6 Android Emulator https://github.com/android-energy/platform_external_qemu/blob/emu- master-dev/docs/ANDROID-EMULATION-LIBRARY.TXT

Slide 7

Slide 7 text

Project Proposal Energy-Aware Computing 7 Energy Model Archtecture - Modem - GPS - Screen - Wifi - CPU

Slide 8

Slide 8 text

Project Proposal Energy-Aware Computing 8 Energy Model Archtecture • Python Implementation • Invoke an modified emulator which print logs on stderr • Each component can register to be notified if some tag appear on the log • Each component run on its own thread and compute its power according to the models • The device model sums the power of its components • The only compoent implemented was the modem • Each time the driver sends a message, the modem goes to active mode (DCH), and after some time will transition to intermediate states until it goes to sleep again or goes back to DCH.

Slide 9

Slide 9 text

Project Proposal Energy-Aware Computing 9 Code: Modem States

Slide 10

Slide 10 text

Project Proposal Energy-Aware Computing 10 Code: State Transition

Slide 11

Slide 11 text

Project Proposal Energy-Aware Computing 11 Code: Device Model

Slide 12

Slide 12 text

Project Proposal Energy-Aware Computing 12 Demo