Top |
#define | rb_debug() |
void | rb_debug_init () |
void | rb_debug_init_match () |
gboolean | rb_debug_matches () |
char ** | rb_debug_get_args () |
void | rb_debug_stop_in_debugger () |
RBProfiler * | rb_profiler_new () |
void | rb_profiler_dump () |
void | rb_profiler_reset () |
void | rb_profiler_free () |
#define | rb_profile_start() |
#define | rb_profile_end() |
In addition to a simple debug output system, we have two distinct profiling mechanisms for timing sections of code.
#define rb_debug(...) rb_debug_realf (__func__, __FILE__, __LINE__, TRUE, __VA_ARGS__)
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.
void
rb_debug_init (gboolean debug
);
Sets up debug output, with either all debug enabled or none.
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.
gboolean rb_debug_matches (const char *func
,const char *file
);
Checks if file
or func
matches 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.
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.
[skip]
void
rb_profiler_dump (RBProfiler *profiler
);
Produces debug output for the profiler instance, showing the elapsed time.
[skip]
void
rb_profiler_reset (RBProfiler *profiler
);
Resets the elapsed time for the profiler
[skip]
void
rb_profiler_free (RBProfiler *profiler
);
Frees the memory associated with a profiler instance.
[skip]
#define rb_profile_start(msg) _rb_profile_log (__func__, __FILE__, __LINE__, RB_PROFILE_INDENTATION, "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.