Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Energy profiler for android emulator

Energy profiler for android emulator

Diego Ramos Ruggeri

May 16, 2017
Tweet

More Decks by Diego Ramos Ruggeri

Other Decks in Technology

Transcript

  1. Project Proposal Energy-Aware Computing 2 Project Outline Energy Profiler for

    Android Emulator • Project Summary • Android Emulator • Energy Model Archtecture • Code • Demo
  2. 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
  3. 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
  4. 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
  5. 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.