[cairo-commit] 2 commits - perf/cairo-perf-diff-files.c util/cairo-trace

Chris Wilson ickle at kemper.freedesktop.org
Mon Jun 6 07:10:39 PDT 2011


 perf/cairo-perf-diff-files.c |   27 +++++++++++++++++----------
 util/cairo-trace/trace.c     |    3 ++-
 2 files changed, 19 insertions(+), 11 deletions(-)

New commits:
commit 27d26bb8b5552915a63f5e9d65597f0ab99102b3
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 6 15:07:01 2011 +0100

    cairo-perf-diff-files: Don't print size/content for trace results
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/perf/cairo-perf-diff-files.c b/perf/cairo-perf-diff-files.c
index 43bf9ba..2551cd1 100644
--- a/perf/cairo-perf-diff-files.c
+++ b/perf/cairo-perf-diff-files.c
@@ -154,16 +154,23 @@ test_diff_print_binary (test_diff_t		    *diff,
 			double			     max_change,
 			cairo_perf_report_options_t *options)
 {
-    printf ("%5s-%-4s %26s-%-3d  %6.2f (%.2f %4.2f%%) -> %6.2f (%.2f %4.2f%%): %5.2fx ",
-	    diff->tests[0]->backend, diff->tests[0]->content,
-	    diff->tests[0]->name, diff->tests[0]->size,
-	    diff->tests[0]->stats.min_ticks / diff->tests[0]->stats.ticks_per_ms,
-	    diff->tests[0]->stats.median_ticks / diff->tests[0]->stats.ticks_per_ms,
-	    diff->tests[0]->stats.std_dev * 100,
-	    diff->tests[1]->stats.min_ticks / diff->tests[1]->stats.ticks_per_ms,
-	    diff->tests[1]->stats.median_ticks / diff->tests[1]->stats.ticks_per_ms,
-	    diff->tests[1]->stats.std_dev * 100,
-	    fabs (diff->change));
+    if (diff->tests[0]->size)
+	printf ("%5s-%-4s %26s-%-3d",
+		diff->tests[0]->backend, diff->tests[0]->content,
+		diff->tests[0]->name, diff->tests[0]->size);
+    else
+	printf ("%5s %26s", diff->tests[0]->backend, diff->tests[0]->name);
+
+    if (diff->tests[0]->size) {
+	printf ("  %6.2f (%.2f %4.2f%%) -> %6.2f (%.2f %4.2f%%): %5.2fx ",
+		diff->tests[0]->stats.min_ticks / diff->tests[0]->stats.ticks_per_ms,
+		diff->tests[0]->stats.median_ticks / diff->tests[0]->stats.ticks_per_ms,
+		diff->tests[0]->stats.std_dev * 100,
+		diff->tests[1]->stats.min_ticks / diff->tests[1]->stats.ticks_per_ms,
+		diff->tests[1]->stats.median_ticks / diff->tests[1]->stats.ticks_per_ms,
+		diff->tests[1]->stats.std_dev * 100,
+		fabs (diff->change));
+    }
 
     if (diff->change > 1.0)
 	printf ("speedup\n");
commit 61fd10376fd89a0c5aa504924594d12fa9899b80
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 6 15:05:51 2011 +0100

    cairo-trace: Fix use of buf outside of scope
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37746
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index d7fa9d7..95fe35f 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -777,6 +777,7 @@ static cairo_bool_t
 _init_logfile (void)
 {
     static cairo_bool_t initialized;
+    char buf[4096];
     const char *filename;
     const char *env;
 
@@ -818,7 +819,7 @@ _init_logfile (void)
 
     filename = getenv ("CAIRO_TRACE_OUTFILE_EXACT");
     if (filename == NULL) {
-	char buf[4096], name[4096] = "";
+	char name[4096] = "";
 
 	filename = getenv ("CAIRO_TRACE_OUTDIR");
 	if (filename == NULL)


More information about the cairo-commit mailing list