[clutter] Drop the UProf dependency



commit 253292802cef191cf8c06ee8b337104f7e73279f
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Mar 3 17:37:02 2015 +0000

    Drop the UProf dependency
    
    Nobody has been compiling Clutter with profiling enabled in a long time.
    
    UProf itself hasn't been updated in 5 years, and it still depends on
    deprecated components like dbus-glib, with no port to GDBus in sight.
    
    The profiling code was moderately useful in the past, but these days
    it's probably better to profile Cogl than Clutter itself; timing
    information can be extracted by the timestamp on each diagnostic message
    that is now available by default in the CLUTTER_NOTE macro, and we can
    add ad hoc counters where needed.

 README.in                              |   12 --
 README.md                              |    4 -
 clutter/Makefile.am                    |    5 +-
 clutter/clutter-actor.c                |   15 --
 clutter/clutter-backend.c              |    1 -
 clutter/clutter-main.c                 |  135 ---------------
 clutter/clutter-master-clock-default.c |   31 ----
 clutter/clutter-profile.c              |  283 --------------------------------
 clutter/clutter-profile.h              |   74 ---------
 clutter/clutter-stage.c                |  119 -------------
 clutter/clutter-text.c                 |   28 ---
 clutter/cogl/clutter-stage-cogl.c      |   27 ---
 clutter/gdk/clutter-master-clock-gdk.c |   31 ----
 configure.ac                           |   45 +-----
 doc/reference/clutter/Makefile.am      |    1 -
 tests/conform/Makefile.am              |    3 +-
 16 files changed, 4 insertions(+), 810 deletions(-)
---
diff --git a/README.in b/README.in
index afb97ad..f3ee945 100644
--- a/README.in
+++ b/README.in
@@ -60,14 +60,6 @@ GObject-Introspection is available from:
 
   git://git.gnome.org/gobject-introspection
 
-If you want support for profiling Clutter you will also need:
-
-  • UProf ≥ @UPROF_REQ_VERSION@
-
-UProf is available from:
-
-  git://github.com/rib/UProf.git
-
 RESOURCES
 -------------------------------------------------------------------------------
 
@@ -162,10 +154,6 @@ Clutter has additional command line options for the configure script:
         Build Clutter with coverage report support, provided by gcov. This
         feature only works with the GNU Compiler Suite and gcov installed.
 
- --enable-profile=[no/yes]
-        Build Clutter with profiling instrumentation. Requires the GNU
-        C Compiler and the UProf library.
-
  --disable-tests
         Disable building the Clutter tests suite.
 
diff --git a/README.md b/README.md
index 0fbf83d..c02ddad 100644
--- a/README.md
+++ b/README.md
@@ -40,10 +40,6 @@ If you are building the Introspection data you will also need:
 
 * [GObject-Introspection](http://git.gnome.org/browse/gobject-introspection)
 
-If you want support for profiling Clutter you will also need:
-
-* [UProf](git://github.com/rib/UProf.git)
-
 Resources
 ---------
 
diff --git a/clutter/Makefile.am b/clutter/Makefile.am
index 7b5cf81..9eabb9f 100644
--- a/clutter/Makefile.am
+++ b/clutter/Makefile.am
@@ -30,7 +30,6 @@ AM_CPPFLAGS = \
        -I$(top_builddir)/clutter               \
        $(CLUTTER_DEPRECATED_CFLAGS)            \
        $(CLUTTER_DEBUG_CFLAGS)                 \
-       $(CLUTTER_PROFILE_CFLAGS)               \
        $(CLUTTER_HIDDEN_VISIBILITY_CFLAGS)     \
        $(NULL)
 
@@ -240,7 +239,6 @@ source_h_priv = \
        clutter-paint-node-private.h            \
        clutter-paint-volume-private.h          \
        clutter-private.h                       \
-       clutter-profile.h                       \
        clutter-script-private.h                \
        clutter-settings-private.h              \
        clutter-stage-manager-private.h         \
@@ -253,7 +251,6 @@ source_c_priv = \
        clutter-easing.c                \
        clutter-event-translator.c      \
        clutter-id-pool.c               \
-       clutter-profile.c               \
        $(NULL)
 
 # deprecated installed headers
@@ -844,7 +841,7 @@ clutter_deprecated_HEADERS = $(deprecated_h)
 
 lib_LTLIBRARIES += libclutter- CLUTTER_API_VERSION@.la
 
-libclutter_ CLUTTER_API_VERSION@_la_LIBADD = $(LIBM) $(CLUTTER_LIBS) $(CLUTTER_PROFILE_LIBS)
+libclutter_ CLUTTER_API_VERSION@_la_LIBADD = $(LIBM) $(CLUTTER_LIBS)
 libclutter_ CLUTTER_API_VERSION@_la_DEPENDENCIES = $(win32_resources)
 
 libclutter_ CLUTTER_API_VERSION@_la_SOURCES = \
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 2847a7d..0f4d292 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -627,7 +627,6 @@
 #include "clutter-paint-node-private.h"
 #include "clutter-paint-volume-private.h"
 #include "clutter-private.h"
-#include "clutter-profile.h"
 #include "clutter-property-transition.h"
 #include "clutter-scriptable.h"
 #include "clutter-script-private.h"
@@ -3676,16 +3675,6 @@ clutter_actor_paint (ClutterActor *self)
   gboolean shader_applied = FALSE;
   ClutterStage *stage;
 
-  CLUTTER_STATIC_COUNTER (actor_paint_counter,
-                          "Actor real-paint counter",
-                          "Increments each time any actor is painted",
-                          0 /* no application private data */);
-  CLUTTER_STATIC_COUNTER (actor_pick_counter,
-                          "Actor pick-paint counter",
-                          "Increments each time any actor is painted "
-                          "for picking",
-                          0 /* no application private data */);
-
   g_return_if_fail (CLUTTER_IS_ACTOR (self));
 
   if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
@@ -3796,16 +3785,12 @@ clutter_actor_paint (ClutterActor *self)
 
   if (pick_mode == CLUTTER_PICK_NONE)
     {
-      CLUTTER_COUNTER_INC (_clutter_uprof_context, actor_paint_counter);
-
       /* We check whether we need to add the flatten effect before
          each paint so that we can avoid having a mechanism for
          applications to notify when the value of the
          has_overlaps virtual changes. */
       add_or_remove_flatten_effect (self);
     }
-  else
-    CLUTTER_COUNTER_INC (_clutter_uprof_context, actor_pick_counter);
 
   /* We save the current paint volume so that the next time the
    * actor queues a redraw we can constrain the redraw to just
diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c
index ac00d27..eab3bce 100644
--- a/clutter/clutter-backend.c
+++ b/clutter/clutter-backend.c
@@ -49,7 +49,6 @@
 #include "clutter-event-private.h"
 #include "clutter-marshal.h"
 #include "clutter-private.h"
-#include "clutter-profile.h"
 #include "clutter-stage-manager-private.h"
 #include "clutter-stage-private.h"
 #include "clutter-stage-window.h"
diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c
index c3c91fa..7b1a615 100644
--- a/clutter/clutter-main.c
+++ b/clutter/clutter-main.c
@@ -65,7 +65,6 @@
 #include "clutter-main.h"
 #include "clutter-master-clock.h"
 #include "clutter-private.h"
-#include "clutter-profile.h"
 #include "clutter-settings-private.h"
 #include "clutter-stage-manager.h"
 #include "clutter-stage-private.h"
@@ -128,9 +127,6 @@ guint clutter_debug_flags       = 0;
 guint clutter_paint_debug_flags = 0;
 guint clutter_pick_debug_flags  = 0;
 
-/* profile flags */
-guint clutter_profile_flags     = 0;
-
 const guint clutter_major_version = CLUTTER_MAJOR_VERSION;
 const guint clutter_minor_version = CLUTTER_MINOR_VERSION;
 const guint clutter_micro_version = CLUTTER_MICRO_VERSION;
@@ -171,13 +167,6 @@ static const GDebugKey clutter_paint_debug_keys[] = {
   { "paint-deform-tiles", CLUTTER_DEBUG_PAINT_DEFORM_TILES },
 };
 
-#ifdef CLUTTER_ENABLE_PROFILE
-static const GDebugKey clutter_profile_keys[] = {
-  {"picking-only", CLUTTER_PROFILE_PICKING_ONLY },
-  {"disable-report", CLUTTER_PROFILE_DISABLE_REPORT }
-};
-#endif /* CLUTTER_ENABLE_DEBUG */
-
 static void
 clutter_threads_impl_lock (void)
 {
@@ -787,28 +776,6 @@ clutter_main_level (void)
   return clutter_main_loop_level;
 }
 
-#ifdef CLUTTER_ENABLE_PROFILE
-static gint (*prev_poll) (GPollFD *ufds, guint nfsd, gint timeout_) = NULL;
-
-static gint
-timed_poll (GPollFD *ufds,
-            guint nfsd,
-            gint timeout_)
-{
-  gint ret;
-  CLUTTER_STATIC_TIMER (poll_timer,
-                        "Mainloop", /* parent */
-                        "Mainloop Idle",
-                        "The time spent idle in poll()",
-                        0 /* no application private data */);
-
-  CLUTTER_TIMER_START (uprof_get_mainloop_context (), poll_timer);
-  ret = prev_poll (ufds, nfsd, timeout_);
-  CLUTTER_TIMER_STOP (uprof_get_mainloop_context (), poll_timer);
-  return ret;
-}
-#endif
-
 /**
  * clutter_main:
  *
@@ -826,14 +793,6 @@ clutter_main (void)
       return;
     }
 
-#ifdef CLUTTER_ENABLE_PROFILE
-  if (!prev_poll)
-    {
-      prev_poll = g_main_context_get_poll_func (NULL);
-      g_main_context_set_poll_func (NULL, timed_poll);
-    }
-#endif
-
   clutter_main_loop_level++;
 
   CLUTTER_NOTE (MISC, "Entering main loop level %d", clutter_main_loop_level);
@@ -1361,32 +1320,6 @@ clutter_arg_no_debug_cb (const char *key,
 }
 #endif /* CLUTTER_ENABLE_DEBUG */
 
-#ifdef CLUTTER_ENABLE_PROFILE
-static gboolean
-clutter_arg_profile_cb (const char *key,
-                        const char *value,
-                        gpointer    user_data)
-{
-  clutter_profile_flags |=
-    g_parse_debug_string (value,
-                          clutter_profile_keys,
-                          G_N_ELEMENTS (clutter_profile_keys));
-  return TRUE;
-}
-
-static gboolean
-clutter_arg_no_profile_cb (const char *key,
-                           const char *value,
-                           gpointer    user_data)
-{
-  clutter_profile_flags &=
-    ~g_parse_debug_string (value,
-                           clutter_profile_keys,
-                           G_N_ELEMENTS (clutter_profile_keys));
-  return TRUE;
-}
-#endif /* CLUTTER_ENABLE_PROFILE */
-
 GQuark
 clutter_init_error_quark (void)
 {
@@ -1399,14 +1332,6 @@ clutter_init_real (GError **error)
   ClutterMainContext *ctx;
   ClutterBackend *backend;
 
-#ifdef CLUTTER_ENABLE_PROFILE
-  CLUTTER_STATIC_TIMER (mainloop_timer,
-                        NULL, /* no parent */
-                        "Mainloop",
-                        "The time spent in the clutter mainloop",
-                        0 /* no application private data */);
-#endif
-
   /* Note, creates backend if not already existing, though parse args will
    * have likely created it
    */
@@ -1453,27 +1378,6 @@ clutter_init_real (GError **error)
   if (!_clutter_feature_init (error))
     return CLUTTER_INIT_ERROR_BACKEND;
 
-#ifdef CLUTTER_ENABLE_PROFILE
-  /* We need to be absolutely sure that uprof has been initialized
-   * before calling _clutter_uprof_init. uprof_init (NULL, NULL)
-   * will be a NOP if it has been initialized but it will also
-   * mean subsequent parsing of the UProf GOptionGroup will have no
-   * affect.
-   *
-   * Sadly GOptionGroup based library initialization is extremly
-   * fragile by design because GOptionGroups have no notion of
-   * dependencies and our post_parse_hook may be called before
-   * the cogl or uprof groups get parsed.
-   */
-  uprof_init (NULL, NULL);
-  _clutter_uprof_init ();
-
-  CLUTTER_TIMER_START (uprof_get_mainloop_context (), mainloop_timer);
-
-  if (clutter_profile_flags & CLUTTER_PROFILE_PICKING_ONLY)
-    _clutter_profile_suspend ();
-#endif
-
   clutter_text_direction = clutter_get_text_direction ();
 
   /* Initiate event collection */
@@ -1511,12 +1415,6 @@ static GOptionEntry clutter_args[] = {
   { "clutter-no-debug", 0, 0, G_OPTION_ARG_CALLBACK, clutter_arg_no_debug_cb,
     N_("Clutter debugging flags to unset"), "FLAGS" },
 #endif /* CLUTTER_ENABLE_DEBUG */
-#ifdef CLUTTER_ENABLE_PROFILE
-  { "clutter-profile", 0, 0, G_OPTION_ARG_CALLBACK, clutter_arg_profile_cb,
-    N_("Clutter profiling flags to set"), "FLAGS" },
-  { "clutter-no-profile", 0, 0, G_OPTION_ARG_CALLBACK, clutter_arg_no_profile_cb,
-    N_("Clutter profiling flags to unset"), "FLAGS" },
-#endif /* CLUTTER_ENABLE_PROFILE */
   { "clutter-enable-accessibility", 0, 0, G_OPTION_ARG_NONE, &clutter_enable_accessibility,
     N_("Enable accessibility"), NULL },
   { NULL, },
@@ -1566,18 +1464,6 @@ pre_parse_hook (GOptionContext  *context,
     }
 #endif /* CLUTTER_ENABLE_DEBUG */
 
-#ifdef CLUTTER_ENABLE_PROFILE
-  env_string = g_getenv ("CLUTTER_PROFILE");
-  if (env_string != NULL)
-    {
-      clutter_profile_flags =
-        g_parse_debug_string (env_string,
-                              clutter_profile_keys,
-                              G_N_ELEMENTS (clutter_profile_keys));
-      env_string = NULL;
-    }
-#endif /* CLUTTER_ENABLE_PROFILE */
-
   env_string = g_getenv ("CLUTTER_PICK");
   if (env_string != NULL)
     {
@@ -1831,14 +1717,6 @@ clutter_init_with_args (int            *argc,
       group = cogl_get_option_group ();
       g_option_context_add_group (context, group);
 
-      /* Note: That due to the implementation details of glib's goption
-       * parsing; cogl and uprof will not actually have there arguments
-       * parsed before the post_parse_hook is called! */
-#ifdef CLUTTER_ENABLE_PROFILE
-      group = uprof_get_option_group ();
-      g_option_context_add_group (context, group);
-#endif
-
       if (entries)
        g_option_context_add_main_entries (context, entries, translation_domain);
 
@@ -1872,9 +1750,6 @@ clutter_parse_args (int      *argc,
 {
   GOptionContext *option_context;
   GOptionGroup *clutter_group, *cogl_group;
-#ifdef CLUTTER_ENABLE_PROFILE
-  GOptionGroup *uprof_group;
-#endif
   GError *internal_error = NULL;
   gboolean ret = TRUE;
 
@@ -1892,11 +1767,6 @@ clutter_parse_args (int      *argc,
   cogl_group = cogl_get_option_group ();
   g_option_context_add_group (option_context, cogl_group);
 
-#ifdef CLUTTER_ENABLE_PROFILE
-  uprof_group = uprof_get_option_group ();
-  g_option_context_add_group (option_context, uprof_group);
-#endif
-
   if (!g_option_context_parse (option_context, argc, argv, &internal_error))
     {
       g_propagate_error (error, internal_error);
@@ -3850,11 +3720,6 @@ _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, var_args);
-#endif
-
   g_free (fmt);
 }
 
diff --git a/clutter/clutter-master-clock-default.c b/clutter/clutter-master-clock-default.c
index 361cfc9..752cc4b 100644
--- a/clutter/clutter-master-clock-default.c
+++ b/clutter/clutter-master-clock-default.c
@@ -37,7 +37,6 @@
 #include "clutter-master-clock-default.h"
 #include "clutter-debug.h"
 #include "clutter-private.h"
-#include "clutter-profile.h"
 #include "clutter-stage-manager-private.h"
 #include "clutter-stage-private.h"
 
@@ -354,20 +353,10 @@ master_clock_process_events (ClutterMasterClockDefault *master_clock,
   gint64 start = g_get_monotonic_time ();
 #endif
 
-  CLUTTER_STATIC_TIMER (master_event_process,
-                        "Master Clock",
-                        "Event Processing",
-                        "The time spent processing events on all stages",
-                        0);
-
-  CLUTTER_TIMER_START (_clutter_uprof_context, master_event_process);
-
   /* Process queued events */
   for (l = stages; l != NULL; l = l->next)
     _clutter_stage_process_queued_events (l->data);
 
-  CLUTTER_TIMER_STOP (_clutter_uprof_context, master_event_process);
-
 #ifdef CLUTTER_ENABLE_DEBUG
   if (_clutter_diagnostic_enabled ())
     clutter_warn_if_over_budget (master_clock, start, "Event processing");
@@ -392,12 +381,6 @@ master_clock_advance_timelines (ClutterMasterClockDefault *master_clock)
   gint64 start = g_get_monotonic_time ();
 #endif
 
-  CLUTTER_STATIC_TIMER (master_timeline_advance,
-                        "Master Clock",
-                        "Timelines Advancement",
-                        "The time spent advancing all timelines",
-                        0);
-
   /* we protect ourselves from timelines being removed during
    * the advancement by other timelines by copying the list of
    * timelines, taking a reference on them, iterating over the
@@ -421,13 +404,9 @@ master_clock_advance_timelines (ClutterMasterClockDefault *master_clock)
   timelines = g_slist_copy (master_clock->timelines);
   g_slist_foreach (timelines, (GFunc) g_object_ref, NULL);
 
-  CLUTTER_TIMER_START (_clutter_uprof_context, master_timeline_advance);
-
   for (l = timelines; l != NULL; l = l->next)
     _clutter_timeline_do_tick (l->data, master_clock->cur_tick / 1000);
 
-  CLUTTER_TIMER_STOP (_clutter_uprof_context, master_timeline_advance);
-
   g_slist_foreach (timelines, (GFunc) g_object_unref, NULL);
   g_slist_free (timelines);
 
@@ -548,14 +527,6 @@ clutter_clock_dispatch (GSource     *source,
   gboolean stages_updated = FALSE;
   GSList *stages;
 
-  CLUTTER_STATIC_TIMER (master_dispatch_timer,
-                        "Mainloop",
-                        "Master Clock",
-                        "Master clock dispatch",
-                        0);
-
-  CLUTTER_TIMER_START (_clutter_uprof_context, master_dispatch_timer);
-
   CLUTTER_NOTE (SCHEDULER, "Master clock [tick]");
 
   _clutter_threads_acquire_lock ();
@@ -603,8 +574,6 @@ clutter_clock_dispatch (GSource     *source,
 
   _clutter_threads_release_lock ();
 
-  CLUTTER_TIMER_STOP (_clutter_uprof_context, master_dispatch_timer);
-
   return TRUE;
 }
 
diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c
index c6be53d..9a6dfe1 100644
--- a/clutter/clutter-stage.c
+++ b/clutter/clutter-stage.c
@@ -71,7 +71,6 @@
 #include "clutter-master-clock.h"
 #include "clutter-paint-volume-private.h"
 #include "clutter-private.h"
-#include "clutter-profile.h"
 #include "clutter-stage-manager-private.h"
 #include "clutter-stage-private.h"
 #include "clutter-version.h"   /* For flavour */
@@ -705,56 +704,6 @@ clutter_stage_paint (ClutterActor *self)
     clutter_actor_paint (child);
 }
 
-#if 0
-/* the Stage is cleared in clutter_actor_paint_node() */
-static void
-clutter_stage_paint (ClutterActor *self)
-{
-  ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
-  CoglBufferBit clear_flags;
-  ClutterColor bg_color;
-  CoglColor stage_color;
-  ClutterActorIter iter;
-  ClutterActor *child;
-  guint8 real_alpha;
-
-  CLUTTER_STATIC_TIMER (stage_clear_timer,
-                        "Painting actors", /* parent */
-                        "Stage clear",
-                        "The time spent clearing the stage",
-                        0 /* no application private data */);
-
-  CLUTTER_NOTE (PAINT, "Initializing stage paint");
-
-  /* composite the opacity to the stage color */
-  clutter_actor_get_background_color (self, &bg_color);
-  real_alpha = clutter_actor_get_opacity (self)
-             * bg_color.alpha
-             / 255;
-
-  clear_flags = COGL_BUFFER_BIT_DEPTH;
-  if (!STAGE_NO_CLEAR_ON_PAINT (self))
-    clear_flags |= COGL_BUFFER_BIT_COLOR;
-
-  CLUTTER_TIMER_START (_clutter_uprof_context, stage_clear_timer);
-  /* we use the real alpha to clear the stage if :use-alpha is
-   * set; the effect depends entirely on the Clutter backend
-   */
-  cogl_color_init_from_4ub (&stage_color,
-                            bg_color.red,
-                            bg_color.green,
-                            bg_color.blue,
-                            priv->use_alpha ? real_alpha : 255);
-  cogl_color_premultiply (&stage_color);
-  cogl_clear (&stage_color, clear_flags);
-  CLUTTER_TIMER_STOP (_clutter_uprof_context, stage_clear_timer);
-
-  clutter_actor_iter_init (&iter, self);
-  while (clutter_actor_iter_next (&iter, &child))
-    clutter_actor_paint (child);
-}
-#endif
-
 static void
 clutter_stage_pick (ClutterActor       *self,
                    const ClutterColor *color)
@@ -1117,11 +1066,6 @@ _clutter_stage_maybe_relayout (ClutterActor *actor)
   ClutterStagePrivate *priv = stage->priv;
   gfloat natural_width, natural_height;
   ClutterActorBox box = { 0, };
-  CLUTTER_STATIC_TIMER (relayout_timer,
-                        "Mainloop", /* no parent */
-                        "Layouting",
-                        "The time spent reallocating the stage",
-                        0 /* no application private data */);
 
   if (!priv->relayout_pending)
     return;
@@ -1131,7 +1075,6 @@ _clutter_stage_maybe_relayout (ClutterActor *actor)
     {
       priv->relayout_pending = FALSE;
 
-      CLUTTER_TIMER_START (_clutter_uprof_context, relayout_timer);
       CLUTTER_NOTE (ACTOR, "Recomputing layout");
 
       CLUTTER_SET_PRIVATE_FLAGS (stage, CLUTTER_IN_RELAYOUT);
@@ -1154,7 +1097,6 @@ _clutter_stage_maybe_relayout (ClutterActor *actor)
                               &box, CLUTTER_ALLOCATION_NONE);
 
       CLUTTER_UNSET_PRIVATE_FLAGS (stage, CLUTTER_IN_RELAYOUT);
-      CLUTTER_TIMER_STOP (_clutter_uprof_context, relayout_timer);
     }
 }
 
@@ -1165,16 +1107,6 @@ clutter_stage_do_redraw (ClutterStage *stage)
   ClutterActor *actor = CLUTTER_ACTOR (stage);
   ClutterStagePrivate *priv = stage->priv;
 
-  CLUTTER_STATIC_COUNTER (redraw_counter,
-                          "clutter_stage_do_redraw counter",
-                          "Increments for each Stage redraw",
-                          0 /* no application private data */);
-  CLUTTER_STATIC_TIMER (redraw_timer,
-                        "Master Clock", /* parent */
-                        "Redrawing",
-                        "The time spent redrawing everything",
-                        0 /* no application private data */);
-
   if (CLUTTER_ACTOR_IN_DESTRUCTION (stage))
     return;
 
@@ -1195,13 +1127,8 @@ clutter_stage_do_redraw (ClutterStage *stage)
 
   _clutter_stage_maybe_setup_viewport (stage);
 
-  CLUTTER_COUNTER_INC (_clutter_uprof_context, redraw_counter);
-  CLUTTER_TIMER_START (_clutter_uprof_context, redraw_timer);
-
   _clutter_stage_window_redraw (priv->impl);
 
-  CLUTTER_TIMER_STOP (_clutter_uprof_context, redraw_timer);
-
   if (_clutter_context_get_show_fps ())
     {
       priv->timer_n_frames += 1;
@@ -1462,31 +1389,6 @@ _clutter_stage_do_pick (ClutterStage   *stage,
   float stage_width, stage_height;
   int window_scale;
 
-  CLUTTER_STATIC_COUNTER (do_pick_counter,
-                          "_clutter_stage_do_pick counter",
-                          "Increments for each full pick run",
-                          0 /* no application private data */);
-  CLUTTER_STATIC_TIMER (pick_timer,
-                        "Mainloop", /* parent */
-                        "Picking",
-                        "The time spent picking",
-                        0 /* no application private data */);
-  CLUTTER_STATIC_TIMER (pick_clear,
-                        "Picking", /* parent */
-                        "Stage clear (pick)",
-                        "The time spent clearing stage for picking",
-                        0 /* no application private data */);
-  CLUTTER_STATIC_TIMER (pick_paint,
-                        "Picking", /* parent */
-                        "Painting actors (pick mode)",
-                        "The time spent painting actors in pick mode",
-                        0 /* no application private data */);
-  CLUTTER_STATIC_TIMER (pick_read,
-                        "Picking", /* parent */
-                        "Read Pixels",
-                        "The time spent issuing a read pixels",
-                        0 /* no application private data */);
-
   priv = stage->priv;
 
   if (CLUTTER_ACTOR_IN_DESTRUCTION (stage))
@@ -1502,14 +1404,6 @@ _clutter_stage_do_pick (ClutterStage   *stage,
   if (x < 0 || x >= stage_width || y < 0 || y >= stage_height)
     return actor;
 
-#ifdef CLUTTER_ENABLE_PROFILE
-  if (clutter_profile_flags & CLUTTER_PROFILE_PICKING_ONLY)
-    _clutter_profile_resume ();
-#endif /* CLUTTER_ENABLE_PROFILE */
-
-  CLUTTER_COUNTER_INC (_clutter_uprof_context, do_pick_counter);
-  CLUTTER_TIMER_START (_clutter_uprof_context, pick_timer);
-
   context = _clutter_context_get_default ();
   clutter_stage_ensure_current (stage);
   window_scale = _clutter_stage_window_get_scale_factor (priv->impl);
@@ -1536,10 +1430,8 @@ _clutter_stage_do_pick (ClutterStage   *stage,
 
   CLUTTER_NOTE (PICK, "Performing pick at %i,%i", x, y);
 
-  CLUTTER_TIMER_START (_clutter_uprof_context, pick_clear);
   cogl_color_init_from_4ub (&stage_pick_id, 255, 255, 255, 255);
   cogl_clear (&stage_pick_id, COGL_BUFFER_BIT_COLOR | COGL_BUFFER_BIT_DEPTH);
-  CLUTTER_TIMER_STOP (_clutter_uprof_context, pick_clear);
 
   /* Disable dithering (if any) when doing the painting in pick mode */
   dither_enabled_save = cogl_framebuffer_get_dither_enabled (fb);
@@ -1548,11 +1440,9 @@ _clutter_stage_do_pick (ClutterStage   *stage,
   /* Render the entire scence in pick mode - just single colored silhouette's
    * are drawn offscreen (as we never swap buffers)
   */
-  CLUTTER_TIMER_START (_clutter_uprof_context, pick_paint);
   context->pick_mode = mode;
   _clutter_stage_do_paint (stage, NULL);
   context->pick_mode = CLUTTER_PICK_NONE;
-  CLUTTER_TIMER_STOP (_clutter_uprof_context, pick_paint);
 
   /* Read the color of the screen co-ords pixel. RGBA_8888_PRE is used
      even though we don't care about the alpha component because under
@@ -1561,12 +1451,10 @@ _clutter_stage_do_pick (ClutterStage   *stage,
      used. The format is requested as pre-multiplied because Cogl
      assumes that all pixels in the framebuffer are premultiplied so
      it avoids a conversion. */
-  CLUTTER_TIMER_START (_clutter_uprof_context, pick_read);
   cogl_read_pixels (read_x, read_y, 1, 1,
                     COGL_READ_PIXELS_COLOR_BUFFER,
                     COGL_PIXEL_FORMAT_RGBA_8888_PRE,
                     pixel);
-  CLUTTER_TIMER_STOP (_clutter_uprof_context, pick_read);
 
   if (G_UNLIKELY (clutter_pick_debug_flags & CLUTTER_DEBUG_DUMP_PICK_BUFFERS))
     {
@@ -1597,13 +1485,6 @@ _clutter_stage_do_pick (ClutterStage   *stage,
       retval = _clutter_stage_get_actor_by_pick_id (stage, id_);
     }
 
-  CLUTTER_TIMER_STOP (_clutter_uprof_context, pick_timer);
-
-#ifdef CLUTTER_ENABLE_PROFILE
-  if (clutter_profile_flags & CLUTTER_PROFILE_PICKING_ONLY)
-    _clutter_profile_suspend ();
-#endif
-
   return retval;
 }
 
diff --git a/clutter/clutter-text.c b/clutter/clutter-text.c
index dad50ed..a0d8b27 100644
--- a/clutter/clutter-text.c
+++ b/clutter/clutter-text.c
@@ -58,7 +58,6 @@
 #include "clutter-main.h"
 #include "clutter-marshal.h"
 #include "clutter-private.h"    /* includes <cogl-pango/cogl-pango.h> */
-#include "clutter-profile.h"
 #include "clutter-property-transition.h"
 #include "clutter-text-buffer.h"
 #include "clutter-units.h"
@@ -488,14 +487,6 @@ clutter_text_create_layout_no_cache (ClutterText       *text,
   gchar *contents;
   gsize contents_len;
 
-  CLUTTER_STATIC_TIMER (text_layout_timer,
-                        "Mainloop",
-                        "Text Layout",
-                        "Layout creation",
-                        0);
-
-  CLUTTER_TIMER_START (_clutter_uprof_context, text_layout_timer);
-
   layout = clutter_actor_create_pango_layout (CLUTTER_ACTOR (text), NULL);
   pango_layout_set_font_description (layout, priv->font_desc);
 
@@ -581,8 +572,6 @@ clutter_text_create_layout_no_cache (ClutterText       *text,
 
   g_free (contents);
 
-  CLUTTER_TIMER_STOP (_clutter_uprof_context, text_layout_timer);
-
   return layout;
 }
 
@@ -716,15 +705,6 @@ clutter_text_create_layout (ClutterText *text,
   PangoEllipsizeMode ellipsize = PANGO_ELLIPSIZE_NONE;
   int i;
 
-  CLUTTER_STATIC_COUNTER (text_cache_hit_counter,
-                          "Text layout cache hit counter",
-                          "Increments for each layout cache hit",
-                          0);
-  CLUTTER_STATIC_COUNTER (text_cache_miss_counter,
-                          "Text layout cache miss counter",
-                          "Increments for each layout cache miss",
-                          0);
-
   /* First determine the width, height, and ellipsize mode that
    * we need for the layout. The ellipsize mode depends on
    * allocation_width/allocation_size as follows:
@@ -819,9 +799,6 @@ clutter_text_create_layout (ClutterText *text,
                             allocation_width,
                             allocation_height);
 
-              CLUTTER_COUNTER_INC (_clutter_uprof_context,
-                                   text_cache_hit_counter);
-
               return priv->cached_layouts[i].layout;
            }
 
@@ -853,9 +830,6 @@ clutter_text_create_layout (ClutterText *text,
                                allocation_width,
                                allocation_height);
 
-                  CLUTTER_COUNTER_INC (_clutter_uprof_context,
-                                       text_cache_hit_counter);
-
                  return priv->cached_layouts[i].layout;
                }
            }
@@ -873,8 +847,6 @@ clutter_text_create_layout (ClutterText *text,
                 allocation_width,
                 allocation_height);
 
-  CLUTTER_COUNTER_INC (_clutter_uprof_context, text_cache_miss_counter);
-
   /* If we make it here then we didn't have a cached version so we
      need to recreate the layout */
   if (oldest_cache->layout)
diff --git a/clutter/cogl/clutter-stage-cogl.c b/clutter/cogl/clutter-stage-cogl.c
index 0b8f279..ee612d4 100644
--- a/clutter/cogl/clutter-stage-cogl.c
+++ b/clutter/cogl/clutter-stage-cogl.c
@@ -44,7 +44,6 @@
 #include "clutter-feature.h"
 #include "clutter-main.h"
 #include "clutter-private.h"
-#include "clutter-profile.h"
 #include "clutter-stage-private.h"
 
 static void clutter_stage_window_iface_init (ClutterStageWindowIface *iface);
@@ -409,29 +408,11 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
   gboolean force_swap;
   int window_scale;
 
-  CLUTTER_STATIC_TIMER (painting_timer,
-                        "Redrawing", /* parent */
-                        "Painting actors",
-                        "The time spent painting actors",
-                        0 /* no application private data */);
-  CLUTTER_STATIC_TIMER (swapbuffers_timer,
-                        "Redrawing", /* parent */
-                        "SwapBuffers",
-                        "The time spent blocked by SwapBuffers",
-                        0 /* no application private data */);
-  CLUTTER_STATIC_TIMER (blit_sub_buffer_timer,
-                        "Redrawing", /* parent */
-                        "blit_sub_buffer",
-                        "The time spent in blit_sub_buffer",
-                        0 /* no application private data */);
-
   wrapper = CLUTTER_ACTOR (stage_cogl->wrapper);
 
   if (!stage_cogl->onscreen)
     return;
 
-  CLUTTER_TIMER_START (_clutter_uprof_context, painting_timer);
-
   can_blit_sub_buffer =
     cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_REGION);
 
@@ -610,8 +591,6 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
       cogl_object_unref (prim);
     }
 
-  CLUTTER_TIMER_STOP (_clutter_uprof_context, painting_timer);
-
   /* push on the screen */
   if (use_clipped_redraw && !force_swap)
     {
@@ -640,11 +619,7 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
                     copy_area[0], copy_area[1], copy_area[2], copy_area[3]);
 
 
-      CLUTTER_TIMER_START (_clutter_uprof_context, blit_sub_buffer_timer);
-
       cogl_onscreen_swap_region (stage_cogl->onscreen, copy_area, 1);
-
-      CLUTTER_TIMER_STOP (_clutter_uprof_context, blit_sub_buffer_timer);
     }
   else
     {
@@ -657,9 +632,7 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
       if (clutter_feature_available (CLUTTER_FEATURE_SWAP_EVENTS))
         stage_cogl->pending_swaps++;
 
-      CLUTTER_TIMER_START (_clutter_uprof_context, swapbuffers_timer);
       cogl_onscreen_swap_buffers (stage_cogl->onscreen);
-      CLUTTER_TIMER_STOP (_clutter_uprof_context, swapbuffers_timer);
     }
 
   /* reset the redraw clipping for the next paint... */
diff --git a/clutter/gdk/clutter-master-clock-gdk.c b/clutter/gdk/clutter-master-clock-gdk.c
index ae3e8e8..49379ae 100644
--- a/clutter/gdk/clutter-master-clock-gdk.c
+++ b/clutter/gdk/clutter-master-clock-gdk.c
@@ -40,7 +40,6 @@
 #include "clutter-stage-gdk.h"
 #include "clutter-debug.h"
 #include "clutter-private.h"
-#include "clutter-profile.h"
 #include "clutter-stage-manager-private.h"
 #include "clutter-stage-private.h"
 
@@ -139,19 +138,9 @@ master_clock_process_stage_events (ClutterMasterClockGdk *master_clock,
   gint64 start = g_get_monotonic_time ();
 #endif
 
-  CLUTTER_STATIC_TIMER (master_event_process,
-                        "Master Clock",
-                        "Event Processing",
-                        "The time spent processing events on all stages",
-                        0);
-
-  CLUTTER_TIMER_START (_clutter_uprof_context, master_event_process);
-
   /* Process queued events */
   _clutter_stage_process_queued_events (stage);
 
-  CLUTTER_TIMER_STOP (_clutter_uprof_context, master_event_process);
-
 #ifdef CLUTTER_ENABLE_DEBUG
   if (_clutter_diagnostic_enabled ())
     clutter_warn_if_over_budget (master_clock, start, "Event processing");
@@ -176,12 +165,6 @@ master_clock_advance_timelines (ClutterMasterClockGdk *master_clock)
   gint64 start = g_get_monotonic_time ();
 #endif
 
-  CLUTTER_STATIC_TIMER (master_timeline_advance,
-                        "Master Clock",
-                        "Timelines Advancement",
-                        "The time spent advancing all timelines",
-                        0);
-
   /* we protect ourselves from timelines being removed during
    * the advancement by other timelines by copying the list of
    * timelines, taking a reference on them, iterating over the
@@ -205,13 +188,9 @@ master_clock_advance_timelines (ClutterMasterClockGdk *master_clock)
   timelines = g_slist_copy (master_clock->timelines);
   g_slist_foreach (timelines, (GFunc) g_object_ref, NULL);
 
-  CLUTTER_TIMER_START (_clutter_uprof_context, master_timeline_advance);
-
   for (l = timelines; l != NULL; l = l->next)
     _clutter_timeline_do_tick (l->data, master_clock->cur_tick / 1000);
 
-  CLUTTER_TIMER_STOP (_clutter_uprof_context, master_timeline_advance);
-
   g_slist_foreach (timelines, (GFunc) g_object_unref, NULL);
   g_slist_free (timelines);
 
@@ -257,14 +236,6 @@ clutter_master_clock_gdk_update (GdkFrameClock         *frame_clock,
 {
   ClutterStage *stage;
 
-  CLUTTER_STATIC_TIMER (master_dispatch_timer,
-                        "Mainloop",
-                        "Master Clock",
-                        "Master clock dispatch",
-                        0);
-
-  CLUTTER_TIMER_START (_clutter_uprof_context, master_dispatch_timer);
-
   CLUTTER_NOTE (SCHEDULER, "Master clock [tick]");
 
   _clutter_threads_acquire_lock ();
@@ -301,8 +272,6 @@ clutter_master_clock_gdk_update (GdkFrameClock         *frame_clock,
   master_clock->prev_tick = master_clock->cur_tick;
 
   _clutter_threads_release_lock ();
-
-  CLUTTER_TIMER_STOP (_clutter_uprof_context, master_dispatch_timer);
 }
 
 static void
diff --git a/configure.ac b/configure.ac
index a857cd0..b10ac69 100644
--- a/configure.ac
+++ b/configure.ac
@@ -143,7 +143,6 @@ m4_define([atk_req_version],            [2.5.3])
 m4_define([cairo_req_version],          [1.14.0])
 m4_define([pango_req_version],          [1.30])
 m4_define([gi_req_version],             [1.39.0])
-m4_define([uprof_req_version],          [0.3])
 m4_define([gtk_doc_req_version],        [1.20])
 m4_define([xcomposite_req_version],     [0.4])
 m4_define([gdk_req_version],            [3.3.18])
@@ -157,7 +156,6 @@ AC_SUBST([ATK_REQ_VERSION],        [atk_req_version])
 AC_SUBST([CAIRO_REQ_VERSION],      [cairo_req_version])
 AC_SUBST([PANGO_REQ_VERSION],      [pango_req_version])
 AC_SUBST([GI_REQ_VERSION],         [gi_req_version])
-AC_SUBST([UPROF_REQ_VERSION],      [uprof_req_version])
 AC_SUBST([GTK_DOC_REQ_VERSION],    [gtk_doc_req_version])
 AC_SUBST([XCOMPOSITE_REQ_VERSION], [xcomposite_req_version])
 AC_SUBST([GDK_REQ_VERSION],        [gdk_req_version])
@@ -930,44 +928,6 @@ AS_CASE([$enable_deprecated],
 
 AC_SUBST([CLUTTER_DEPRECATED_CFLAGS])
 
-dnl === Profiling =============================================================
-
-m4_define([profile_default], [no])
-AC_ARG_ENABLE(profile,
-              AS_HELP_STRING([--enable-profile=@<:@no/yes@:>@],
-                             [Turn on profiling support. yes; All profiling probe points are compiled in and 
may be runtime enabled. no; No profiling support will built into clutter.  @<:@default=no@:>@]),
-              [],
-              [enable_profile=profile_default])
-
-AS_CASE([$enable_profile],
-
-        [yes],
-        [
-          AS_IF([test "x$GCC" = "xyes"],
-                [
-                  PKG_CHECK_MODULES([PROFILE_DEP], [uprof-0.3])
-                  CLUTTER_PROFILE_CFLAGS="-DCLUTTER_ENABLE_PROFILE $PROFILE_DEP_CFLAGS"
-                  CLUTTER_PROFILE_LDFLAGS="$PROFILE_DEP_LIBS"
-
-                  AS_IF([test "x$enable_debug" = "xyes"], [CLUTTER_PROFILE_CFLAGS+=" -DUPROF_DEBUG"])
-                ],
-                [
-                  AC_MSG_ERROR([--enable-profile is currently only supported if using GCC])
-                ])
-        ],
-
-        [no],
-        [
-          CLUTTER_PROFILE_CFLAGS=""
-          CLUTTER_PROFILE_LDFLAGS=""
-        ],
-
-        [*], [AC_MSG_ERROR([Invalid value for --enable-profile])]
-)
-AM_CONDITIONAL(PROFILE, test "x$enable_profile" != "xno")
-AC_SUBST(CLUTTER_PROFILE_CFLAGS)
-AC_SUBST(CLUTTER_PROFILE_LDFLAGS)
-
 dnl === Enable strict compiler flags ==========================================
 
 # use strict compiler flags only when building from git; the rules for
@@ -1043,8 +1003,8 @@ AS_IF([test "x$CLUTTER_BASE_PC_FILES_PRIVATE" = "x" && test "x$BACKEND_PC_FILES_
 AC_SUBST(CLUTTER_REQUIRES)
 AC_SUBST(CLUTTER_REQUIRES_PRIVATE)
 
-CLUTTER_CFLAGS="$FLAVOUR_CFLAGS $CLUTTER_DEPS_CFLAGS $CLUTTER_DEPS_PRIVATE_CFLAGS $CLUTTER_PROFILE_CFLAGS 
$GLIB_CFLAGS"
-CLUTTER_LIBS="$FLAVOUR_LIBS $CLUTTER_DEPS_LIBS $CLUTTER_DEPS_PRIVATE_LIBS $CLUTTER_PROFILE_LDFLAGS 
$GLIB_LIBS"
+CLUTTER_CFLAGS="$FLAVOUR_CFLAGS $CLUTTER_DEPS_CFLAGS $CLUTTER_DEPS_PRIVATE_CFLAGS $GLIB_CFLAGS"
+CLUTTER_LIBS="$FLAVOUR_LIBS $CLUTTER_DEPS_LIBS $CLUTTER_DEPS_PRIVATE_LIBS $GLIB_LIBS"
 AC_SUBST(CLUTTER_CFLAGS)
 AC_SUBST(CLUTTER_LIBS)
 
@@ -1272,7 +1232,6 @@ echo ""
 echo " • Compiler options:"
 echo "        Clutter debug level: ${enable_debug}"
 echo "        Compiler flags: ${CFLAGS} ${MAINTAINER_CFLAGS}"
-echo "        Profiling enabled: ${enable_profile}"
 echo "        Enable coverage tests: ${use_gcov}"
 echo "        Enable deprecated symbols: ${enable_deprecated}"
 
diff --git a/doc/reference/clutter/Makefile.am b/doc/reference/clutter/Makefile.am
index 75a5b51..7fb44c1 100644
--- a/doc/reference/clutter/Makefile.am
+++ b/doc/reference/clutter/Makefile.am
@@ -93,7 +93,6 @@ IGNORE_HFILES = \
        clutter-paint-node-private.h    \
        clutter-paint-volume-private.h  \
        clutter-private.h               \
-       clutter-profile.h               \
        clutter-script-private.h        \
        clutter-settings-private.h      \
        clutter-stage-manager-private.h \
diff --git a/tests/conform/Makefile.am b/tests/conform/Makefile.am
index d0c08b6..af1e64b 100644
--- a/tests/conform/Makefile.am
+++ b/tests/conform/Makefile.am
@@ -9,8 +9,7 @@ AM_CPPFLAGS = \
        -I$(top_builddir)                       \
        -DCOGL_DISABLE_DEPRECATION_WARNINGS     \
        $(CLUTTER_DEPRECATED_CFLAGS)            \
-       $(CLUTTER_DEBUG_CFLAGS)                 \
-       $(CLUTTER_PROFILE_CFLAGS)
+       $(CLUTTER_DEBUG_CFLAGS)
 
 # Basic actor API
 actor_tests = \



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]