2 * arch-tag: Header for simple Rhythmbox debugging interface
4 * Copyright (C) 2002 Jorn Baayen
5 * Copyright (C) 2003 Colin Walters <walters@verbum.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
31 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
32 #define rb_debug(...) rb_debug_real (__func__, __FILE__, __LINE__, TRUE, __VA_ARGS__)
33 #elif defined(__GNUC__) && __GNUC__ >= 3
34 #define rb_debug(...) rb_debug_real (__FUNCTION__, __FILE__, __LINE__, TRUE, __VA_ARGS__)
39 void rb_debug_init (gboolean debug
);
40 void rb_debug_init_match (const char *match
);
42 void rb_debug_real (const char *func
,
46 const char *format
, ...) G_GNUC_PRINTF (5, 6);
48 void rb_debug_stop_in_debugger (void);
50 typedef struct RBProfiler RBProfiler
;
52 RBProfiler
*rb_profiler_new (const char *name
);
53 void rb_profiler_dump (RBProfiler
*profiler
);
54 void rb_profiler_reset (RBProfiler
*profiler
);
55 void rb_profiler_free (RBProfiler
*profiler
);
57 void _rb_profile_log (const char *func
,
63 #define ENABLE_PROFILING 1
64 #ifdef ENABLE_PROFILING
65 #define RB_PROFILE_INDENTATION 4
66 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
67 #define rb_profile_start(msg) _rb_profile_log (__func__, __FILE__, __LINE__, RB_PROFILE_INDENTATION, "START", msg)
68 #define rb_profile_end(msg) _rb_profile_log (__func__, __FILE__, __LINE__, -RB_PROFILE_INDENTATION, "END", msg)
69 #elif defined(__GNUC__) && __GNUC__ >= 3
70 #define rb_profile_start(msg) _rb_profile_log (__FUNCTION__, __FILE__, __LINE__, RB_PROFILE_INDENTATION, "START", msg)
71 #define rb_profile_end(msg) _rb_profile_log (__FUNCTION__, __FILE__, __LINE__, -RB_PROFILE_INDENTATION, "END", msg)
73 #define rb_profile_start(msg)
74 #define rb_profile_end(msg)
77 #define rb_profile_start(msg)
78 #define rb_profile_end(msg)
83 #endif /* __RB_DEBUG_H */