summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2012-08-27 19:44:11 +0100
committerRobert Bragg <robert@linux.intel.com>2012-09-03 15:51:45 +0100
commit85efcfac2a1d6412296cbb352a4f0be2247276b3 (patch)
tree859c24032d69d1bd3bcd25453c62ed74f87b0cdb
parentc477e9ce49801d4d19f92894e3b2f5d063925b3e (diff)
downloadcogl-85efcfac2a1d6412296cbb352a4f0be2247276b3.tar.gz
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)
-rw-r--r--cogl/cogl-journal.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/cogl/cogl-journal.c b/cogl/cogl-journal.c
index 41ebabd4..25422a45 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);
}