• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category Plugins
  • Assigned To No-one
  • Operating System
  • Severity Low
  • Priority Very Low
  • Reported Version Unstable (example)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by patr3ck - 2005-03-05
Last edited by jdgordon - 2007-08-01

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

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

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.

Closed by  jdgordon
2007-08-01 13:40
Reason for closing:  Out of Date


Available keyboard shortcuts


Task Details

Task Editing