![]() |
![]() |
![]() |
Rhythmbox Development Reference Manual | ![]() |
---|---|---|---|---|
#define rb_debug (...) void rb_debug_init (gboolean debug); void rb_debug_init_match (const char *match); gboolean rb_debug_matches (const char *func, const char *file); char** rb_debug_get_args (void); void rb_debug_stop_in_debugger (void); typedef RBProfiler; RBProfiler* rb_profiler_new (const char *name); void rb_profiler_dump (RBProfiler *profiler); void rb_profiler_reset (RBProfiler *profiler); void rb_profiler_free (RBProfiler *profiler); #define rb_profile_start (msg) #define rb_profile_end (msg)
In addition to a simple debug output system, we have two distinct profiling mechanisms for timing sections of code.
#define rb_debug(...)
If the call site function or file name matches the current debug output settings, the message will be formatted and printed to standard error, including a timestamp, the thread ID, the file and function names, and the line number. A newline will be appended, so the format string shouldn't include one.
|
printf-style format string followed by any substitution values |
void rb_debug_init (gboolean debug);
Sets up debug output, with either all debug enabled or none.
|
if TRUE, enable all debug output |
void rb_debug_init_match (const char *match);
Sets up debug output, enabling debug output from file and function names that contain the specified match string.
Also sets up a GLib log handler that will trigger a debugger break for critical or warning level output if any debug output at all is enabled.
|
string to match functions and filenames against |
gboolean rb_debug_matches (const char *func, const char *file);
|
function to check |
|
filename to check |
Returns : |
TRUE if func or file match the current
debug output settings.
|
char** rb_debug_get_args (void);
Constructs arguments to pass to another process using this debug output code that will produce the same debug output settings.
Returns : |
debug output arguments, must be freed with #g_strfreev()
|
void rb_debug_stop_in_debugger (void);
Raises a SIGINT signal to get the attention of the debugger. When not running under the debugger, we don't want to stop, so we ignore the signal for just the moment that we raise it.
RBProfiler* rb_profiler_new (const char *name);
Creates a new profiler instance. This can be used to time certain sections of code.
|
profiler name |
Returns : |
profiler instance |
void rb_profiler_dump (RBProfiler *profiler);
Produces debug output for the profiler instance, showing the elapsed time.
|
profiler instance |
void rb_profiler_reset (RBProfiler *profiler);
Resets the elapsed time for the profiler
|
profiler instance |
void rb_profiler_free (RBProfiler *profiler);
Frees the memory associated with a profiler instance.
|
profiler instance to destroy |
#define rb_profile_start(msg)
Records a start point for profiling. This profile mechanism operates by issuing file access requests with filenames indicating the profile points. Use 'strace -e access' to gather this information.
|
profile point message |