summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2011-11-18 17:44:42 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2011-11-18 17:44:42 +0000
commit8a4dc3c011fb3dfe8157dfc228fedd72a81c3c12 (patch)
treecf2e2dea9c880e3ca7be6ff89c1b9355a15caedf
parent92585be4d805a1cb0b60df92a0b235fd1a2824be (diff)
downloadclutter-8a4dc3c011fb3dfe8157dfc228fedd72a81c3c12.tar.gz
debug: Clean up profile/debug symbols
Since we have a _clutter_debug_message() function compiled in unconditionally we have no further need for the equivalent conditional version defined in clutter-profile.[ch]: we can simply do the work in one function.
-rw-r--r--clutter/clutter-debug.h26
-rw-r--r--clutter/clutter-main.c5
-rw-r--r--clutter/clutter-profile.c13
-rw-r--r--clutter/clutter-profile.h18
4 files changed, 25 insertions, 37 deletions
diff --git a/clutter/clutter-debug.h b/clutter/clutter-debug.h
index 8faaf4899..7cf7f4a50 100644
--- a/clutter/clutter-debug.h
+++ b/clutter/clutter-debug.h
@@ -3,7 +3,6 @@
#include <glib.h>
#include "clutter-main.h"
-#include "clutter-profile.h"
G_BEGIN_DECLS
@@ -50,25 +49,24 @@ typedef enum {
#ifdef __GNUC__
/* Try the GCC extension for valists in macros */
-#define CLUTTER_NOTE(type,x,a...) G_STMT_START { \
- if (G_UNLIKELY (CLUTTER_HAS_DEBUG (type))) \
- { _clutter_profile_trace_message ("[" #type "]:" \
- G_STRLOC ": " x, ##a); } \
- } G_STMT_END
+#define CLUTTER_NOTE(type,x,a...) G_STMT_START { \
+ if (G_UNLIKELY (CLUTTER_HAS_DEBUG (type))) { \
+ _clutter_debug_message ("[" #type "]:" \
+ G_STRLOC ": " x, ##a); \
+ } } G_STMT_END
#else /* !__GNUC__ */
/* Try the C99 version; unfortunately, this does not allow us to pass
* empty arguments to the macro, which means we have to
* do an intemediate printf.
*/
-#define CLUTTER_NOTE(type,...) G_STMT_START { \
- if (G_UNLIKELY (CLUTTER_HAS_DEBUG (type))) \
- { \
- gchar * _fmt = g_strdup_printf (__VA_ARGS__); \
- _clutter_profile_trace_message ("[" #type "]:" \
- G_STRLOC ": %s",_fmt); \
- g_free (_fmt); \
- } } G_STMT_END
+#define CLUTTER_NOTE(type,...) G_STMT_START { \
+ if (G_UNLIKELY (CLUTTER_HAS_DEBUG (type))) { \
+ gchar * _fmt = g_strdup_printf (__VA_ARGS__); \
+ _clutter_debug_message ("[" #type "]:" \
+ G_STRLOC ": %s", _fmt); \
+ g_free (_fmt); \
+ } } G_STMT_END
#endif
#else /* !CLUTTER_ENABLE_DEBUG */
diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c
index 90ec41444..49a31c3ff 100644
--- a/clutter/clutter-main.c
+++ b/clutter/clutter-main.c
@@ -3735,6 +3735,11 @@ _clutter_debug_messagev (const char *format,
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, fmt, var_args);
+#ifdef CLUTTER_ENABLE_PROFILE
+ if (_clutter_uprof_context != NULL)
+ uprof_context_vtrace_message (_clutter_uprof_context, format, args);
+#endif
+
g_free (fmt);
}
diff --git a/clutter/clutter-profile.c b/clutter/clutter-profile.c
index 4b5ceb9ee..b8e0d6430 100644
--- a/clutter/clutter-profile.c
+++ b/clutter/clutter-profile.c
@@ -280,17 +280,4 @@ _clutter_profile_resume (void)
/* NB: The Cogl context is linked to this so it will also be resumed... */
uprof_context_resume (_clutter_uprof_context);
}
-
-void
-_clutter_profile_trace_message (const char *format, ...)
-{
- va_list ap;
-
- va_start (ap, format);
- _clutter_debug_messagev (format, ap);
- va_end (ap);
-
- if (_clutter_uprof_context != NULL)
- uprof_context_vtrace_message (_clutter_uprof_context, format, ap);
-}
#endif
diff --git a/clutter/clutter-profile.h b/clutter/clutter-profile.h
index 66d42aeca..73925145c 100644
--- a/clutter/clutter-profile.h
+++ b/clutter/clutter-profile.h
@@ -48,21 +48,19 @@ extern guint clutter_profile_flags;
void _clutter_uprof_init (void);
void _clutter_profile_suspend (void);
void _clutter_profile_resume (void);
-void _clutter_profile_trace_message (const char *format, ...);
#else /* CLUTTER_ENABLE_PROFILE */
#define CLUTTER_STATIC_TIMER(A,B,C,D,E) extern void _clutter_dummy_decl (void)
#define CLUTTER_STATIC_COUNTER(A,B,C,D) extern void _clutter_dummy_decl (void)
-#define CLUTTER_COUNTER_INC(A,B) G_STMT_START{ (void)0; }G_STMT_END
-#define CLUTTER_COUNTER_DEC(A,B) G_STMT_START{ (void)0; }G_STMT_END
-#define CLUTTER_TIMER_START(A,B) G_STMT_START{ (void)0; }G_STMT_END
-#define CLUTTER_TIMER_STOP(A,B) G_STMT_START{ (void)0; }G_STMT_END
-
-#define _clutter_profile_suspend() G_STMT_START {} G_STMT_END
-#define _clutter_profile_resume() G_STMT_START {} G_STMT_END
-
-#define _clutter_profile_trace_message _clutter_debug_message
+#define CLUTTER_COUNTER_INC(A,B) G_STMT_START { } G_STMT_END
+#define CLUTTER_COUNTER_DEC(A,B) G_STMT_START { } G_STMT_END
+#define CLUTTER_TIMER_START(A,B) G_STMT_START { } G_STMT_END
+#define CLUTTER_TIMER_STOP(A,B) G_STMT_START { } G_STMT_END
+
+#define _clutter_uprof_init G_STMT_START { } G_STMT_END
+#define _clutter_profile_suspend G_STMT_START { } G_STMT_END
+#define _clutter_profile_resume G_STMT_START { } G_STMT_END
#endif /* CLUTTER_ENABLE_PROFILE */