• Status Closed
  • Percent Complete
  • Task Type Bugs
  • Category
  • Assigned To No-one
  • Operating System All players
  • Severity Medium
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by ohrn - 2006-03-14

FS#4834 - Plugin profiling broken.

plugin_start() must be declared with NO_PROF_ATTR to prevent it from being instrumented. Right now a plugin will die immediatley with a NULL pointer dereference becasue __cyg_profile_func_enter() gets called before the plugin has a chance to call profile_init().

Closed by  lostlogic
2006-03-16 17:05
Reason for closing:  Accepted
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407


Hmm, praps the profiling functions should be smart enough to not blow up if they are called before prof_start is called instead?

Any interest in looking into that?


ohrn commented on 2006-03-15 23:22

This can be done by adding "if (!rb_local) return;" to the __cyg_profile_func_enter/exit functions.
Also a new end function is needed:

void profile_end ()

  local_rb = NULL;


and plugin_start is required to call it before exiting. This is to make sure we don't get a mismatch where profile_func_enter() is skipped when entering plugin_start() but profile_func_exit() gets called when plugin_start() exits becasue local_rb is still initialized.

The end result is the same as in my suggested patch, profiling is skipped for plugin_start(), this solution is just more roundabout.

Also, profiling codecs have the exact same problem as plugins.

Will apply, thanks.


Available keyboard shortcuts


Task Details

Task Editing