summaryrefslogtreecommitdiff
path: root/perf/cairo-perf-trace.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-07-03 02:54:55 +0200
committerBenjamin Otte <otte@redhat.com>2010-07-03 02:55:52 +0200
commit9ce87c67ff64083ec48edfefe83a1df3756c364c (patch)
tree5b45592d49a8c4318b96fd8b273f9dfcc6bd560e /perf/cairo-perf-trace.c
parentfcfe7c67248ea171dc40c0dbd861e489a2df5941 (diff)
downloadcairo-9ce87c67ff64083ec48edfefe83a1df3756c364c.tar.gz
perf: print comment describing backend
Use the descibe string to output information about the backend we're testing.
Diffstat (limited to 'perf/cairo-perf-trace.c')
-rw-r--r--perf/cairo-perf-trace.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/perf/cairo-perf-trace.c b/perf/cairo-perf-trace.c
index 5afe9e73c..d34790834 100644
--- a/perf/cairo-perf-trace.c
+++ b/perf/cairo-perf-trace.c
@@ -273,7 +273,34 @@ interrupt (int sig)
}
static void
+describe (cairo_perf_t *perf,
+ void *closure)
+{
+ char *description = NULL;
+
+ if (perf->target->describe)
+ description = perf->target->describe (closure);
+
+ if (description == NULL)
+ return;
+
+ if (perf->raw) {
+ printf ("[ # ] %s: %s\n", perf->target->name, description);
+ }
+
+ if (perf->summary) {
+ fprintf (perf->summary,
+ "[ # ] %8s: %s\n",
+ perf->target->name,
+ description);
+ }
+
+ free (description);
+}
+
+static void
execute (cairo_perf_t *perf,
+ void *closure,
cairo_surface_t *target,
const char *trace)
{
@@ -316,6 +343,8 @@ execute (cairo_perf_t *perf,
first_run = FALSE;
}
+ describe (perf, closure);
+
times = perf->times;
if (perf->summary) {
@@ -686,7 +715,7 @@ cairo_perf_trace (cairo_perf_t *perf,
cairo_perf_timer_set_synchronize (target->synchronize, closure);
- execute (perf, surface, trace);
+ execute (perf, closure, surface, trace);
cairo_surface_destroy (surface);