[Cogl] [PATCH] journal: Add a uprof timer around the _flush() discard

Robert Bragg robert at sixbynine.org
Tue Aug 28 08:50:07 PDT 2012


From: Robert Bragg <robert at linux.intel.com>

This adds a uprof timer around the _cogl_journal_discard() at the end of
_cogl_journal_flush() since this sometimes takes a significant
proportion of the time to flush the journal.
---
 cogl/cogl-journal.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/cogl/cogl-journal.c b/cogl/cogl-journal.c
index 04460a9..52cab98 100644
--- a/cogl/cogl-journal.c
+++ b/cogl/cogl-journal.c
@@ -1257,6 +1257,11 @@ _cogl_journal_flush (CoglJournal *journal)
                      "Journal Flush",
                      "The time spent flushing the Cogl journal",
                      0 /* no application private data */);
+  COGL_STATIC_TIMER (discard_timer,
+                     "Journal Flush", /* parent */
+                     "flush: discard",
+                     "The time spent discarding the Cogl journal after a flush",
+                     0 /* no application private data */);
 
   if (journal->entries->len == 0)
     return;
@@ -1348,7 +1353,9 @@ _cogl_journal_flush (CoglJournal *journal)
 
   cogl_object_unref (state.attribute_buffer);
 
+  COGL_TIMER_START (_cogl_uprof_context, discard_timer);
   _cogl_journal_discard (journal);
+  COGL_TIMER_STOP (_cogl_uprof_context, discard_timer);
 
   COGL_TIMER_STOP (_cogl_uprof_context, flush_timer);
 }
-- 
1.7.7.6



More information about the Cogl mailing list