---+!! Profiling Rockbox _(from docs/TECH)_ Rockbox contains a profiling system which can be used to monitor call count and time in function for a specific set of functions on a single thread. This can be used to optimize frequently-called functions or code blocks. To use this functionality: <ol> <li>Configure a developer build with profiling support (../tools/configure, then select "(A)dvanced" and "(P)rofiling").</li> <li>Make sure that the functions of interest will be compiled with the PROFILE_OPTS added to their CFLAGS (e.g. hardcoding "-finstrument-functions" to CFLAGS)</li> <li>On the same thread as these functions will be run, surround the relevent running time with calls to profile_thread and profstop. (For codecs, this can be done in the codec.c file for example. In this case call ci->profile_thread() at the beginning of codec_run() and ci->profstop() right before returning from codec_run()).</li> <li>Compile and run the code on the target, after the section to be profiled exits (when profstop is called) a profile.out file will be written to the player's root. The test_codec program is a good way to do this (remark: test_codec is compoiled in when ../tools/configure "(A)dvanced" and "(T)est plugins" is selected).</li> <li>Use the tools/profile_reader/profile_reader.pl script to convert the profile.out into a human readable format. This script requires the relevant map files, the objdump version to use, and object (or elf or library) files created in the build. (ex: /tools/profile_reader/profile_reader.pl profile.out arm-elf-eabi-objdump wma.map wma.elf 1)</li> </ol> There is also a profile_comparator.pl script which can compare two profile runs as output by the above script to show percent change from optimization profile_reader.pl requires a recent binutils that can automatically handle target object files, or objdump in path to be the target-objdump. profile_reader.pl works on ARM and Coldfire, and may work on other targets.
r4 - 04 Oct 2012 - 06:49:40 -
Copyright © by the contributing authors.