Rockbox

Tasklist

FS#2458 - simple manual profiling for iriver codec libraries / plugins

Attached to Project: Rockbox
Opened by Patr3ck (patr3ck) - Saturday, 05 March 2005, 11:54 GMT
Last edited by Jonathan Gordon (jdgordon) - Wednesday, 01 August 2007, 13:40 GMT
Task Type Patches
Category Plugins
Status Closed
Assigned To No-one
Operating System
Severity Low
Priority Normal
Reported Version Unstable (example)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

It consists of a 1ms profile_tick for time measurement
and a few simple functions to collect and write the
profile information to a file.

The profile functions are added to xxx2wav.h /
xxx2wav.c so that they are accessible to the codec
plugins and the codec libraries. This is not ideal
especially for the codec libraries because they need to
include xxx2wav.h to use the profiling functions, but I
found no cleaner way to do it for now.

PROFILE_INIT() initializes the data structure.
PROFILING_WRITE(filename) saves the collected data to a
file. To measure a function add
PROFILING_START(symbol_name) at the beginning and
PROFILING_STOP(symbol_name) before returning. The
PROFILING definition is used to separate a profiling
build from a non profiling build. An example how to use
profiling can be seen in mpa2wav.c after applying the
patch.

The information gathered consists of a call count and a
sum of ticks used. A percent value of used time is also
calculated and saved to the file. The information is
stored tab separated so it can be imported to a
spreadsheet to for example sort the entries by the
percent value.

This is my first contribution to rockbox so don't judge
to hard if I did something stupid / wrong.
This task depends upon

Closed by  Jonathan Gordon (jdgordon)
Wednesday, 01 August 2007, 13:40 GMT
Reason for closing:  Out of Date

Loading...