[cogl/cogl-1.12] journal: Add a uprof timer around the _flush() discard



commit 85efcfac2a1d6412296cbb352a4f0be2247276b3
Author: Robert Bragg <robert linux intel com>
Date:   Mon Aug 27 19:44:11 2012 +0100

    journal: Add a uprof timer around the _flush() discard
    
    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.
    
    Reviewed-by: Neil Roberts <neil linux intel com>
    
    (cherry picked from commit 14ffc3a197100be814452af2d0f839970353b04d)

 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 41ebabd..25422a4 100644
--- a/cogl/cogl-journal.c
+++ b/cogl/cogl-journal.c
@@ -1266,6 +1266,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;
@@ -1357,7 +1362,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);
 }



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