Profiling on Mobile Devices

English version:

Master project

A profiler is a component that outputs internal resource information of a piece of code given as input, e.g., the amount of memory allocated or the number of bytecodes executed by a given piece of code.

We have implemented such a profiler in a completely dynamic way in KVM (Java VM for mobile devices) that can output memory, CPU (bytecodes), energy and time values for any piece of code.

We want now to experiment with profilers that are (1) doing offline analysis of the code, i.e., take bytecodes as input, analyze the code (finding basic blocks which behaviors will not change at runtime), annotate the code and finally compute profiling results thanks to the annotations created; and (2) doing code analysis during the first couple of profiling passes and then compute the profiling results with the annotations created during the first couple of executions.

The aim of the project is to modify the KVM to implement both these types of profilers, optimize them to improve performance and provide comparative measurements.

Rough comparison between profiler types (expectations):

Dynamic Profiler Static Profiler Hybrid Profiler
Runtime cost Predictable, relatively high Predictable, relatively low Non-predictable, high in the beginning, low after some iterations
Offline cost None High None, or possibly a little (low)
Bytecode modification None Annotation in the bytecodes Annotation in data structure (runtime), built at runtime

The result of the project would then be implementations of the two profilers (static & hybrid) and a report containing comparative results of the three implementations.

Languages: Java & C

Responsible: Maxime Monod

This project is taken by Nicolas Vallée



Version française:

Projet de Master

Un profiler est un composant qui produit des informations sur les ressources internes utilisées par un bout de code, par exemple, la quantité de mémoire allouée ou le nombre de bytecodes exécutés par un programme (ou une partie d'un programme).

Nous avons implémenté un profiler totalement dynamique dans KVM (Machine virtuelle Java pour systèmes embarqués) qui produit des information sur la mémoire, CPU (bytecodes), quantité d'énergie et temps consommés par un bout de code.

Nous aimerions maintenant comparer la méthode dynamique implémentée avec du profiling (1) qui aurait lieu avant la phase d'exécution (offline) en analysant les bytecodes donnés en entrée, identifiant des basic blocks (partie de code qui ne change pas au runtime, par exemple une suite d'opérations arithmétiques et/ou accès mémoire), annoter le code source et produire les résultats du profiling à l'aide de ces annotations; et (2) en faisant cette analyse statique pendant les premières exécutions du profiler en annotant le code pendant l'exécution, puis après quelques itérations en produisant les résultats du profiling grâce à ces seules annotations.

Le but du projet est de modifier la KVM en implémentant ces types de profilers, de les optimiser dans un environnement embarqué et d'exposer des mesures comparatives.

Comparaisons des types de profiling (attentes):

Profiler dynamique Profiler statique Profiler hybride
Coût au runtime Predictible, relativement élevé Predictible, relativement bas Non-predictible, élevé au début, puis bas après quelques itérations
Coût offline Nul Elevé Nul, ou bas
Modification des bytecodes Aucune Annotations dans les bytecodes Annotations dans des structures de données (runtime), créées dynamiquement

Le résultat du projet est d'avoir deux implémentations des profilers (statique & hybride) et de fournir un rapport contenant des résultats comparatifs des trois implémentations.

Langages: Java & C

Responsable: Maxime Monod

Ce projet est pris par Nicolas Vallée