From 85efcfac2a1d6412296cbb352a4f0be2247276b3 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Mon, 27 Aug 2012 19:44:11 +0100 Subject: [PATCH] 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 (cherry picked from commit 14ffc3a197100be814452af2d0f839970353b04d) --- cogl/cogl-journal.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cogl/cogl-journal.c b/cogl/cogl-journal.c index 41ebabd47..25422a45e 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); }