[cairo-commit] perf/README util/cairo-trace

Chris Wilson ickle at kemper.freedesktop.org
Wed Jun 3 11:30:53 PDT 2009

 perf/README                     |   11 +++++++++--
 util/cairo-trace/cairo-trace.in |   18 ++++++++++++++++++
 2 files changed, 27 insertions(+), 2 deletions(-)

New commits:
commit fa5d6c7afdb9b742ad653c65e8804e84f2964599
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jun 3 19:29:19 2009 +0100

    [trace] Add a --profile mode
    To save typing when creating macro-benchmarks --profile disables
    mark-dirty and caller-info and compresses the trace using LZMA. Not for
    computers short on memory!

diff --git a/perf/README b/perf/README
index ebc2daf..efd9e40 100644
--- a/perf/README
+++ b/perf/README
@@ -199,15 +199,22 @@ as the files are much smaller.
 The output file will be called $APPLICATION.$PID.trace, the actual path
 written to will be displayed on the terminal.
+Alternatively you can use:
+$ cairo-trace --profile $APPLICATION [$ARGV]
+which automatically passes --no-mark-dirty and --no-callers and compresses
+the resultant trace using LZMA. To use the trace with cairo-perf-trace you
+will first need to decompress it.
 Then to use cairo-perf-trace:
 $ ./cairo-perf-trace $APPLICATION.$PID.trace
-Alternatively you can put the trace into perf/traces, or set
+Alternatively you can put the trace into perf/cairo-traces, or set
 CAIRO_TRACE_DIR to point to your trace directory, and the trace will be
 included in the performance tests.
 If you record an interesting trace, please consider sharing it by compressing
-it, LZMA preferred, and posting a link to cairo at cairographics.org.
+it, LZMA preferred, and posting a link to cairo at cairographics.org, or by
+uploading it to git.cairographics.org/cairo-traces.
 How to run cairo-perf-diff on WINDOWS
diff --git a/util/cairo-trace/cairo-trace.in b/util/cairo-trace/cairo-trace.in
index bf17217..2686970 100644
--- a/util/cairo-trace/cairo-trace.in
+++ b/util/cairo-trace/cairo-trace.in
@@ -7,6 +7,7 @@ nofile=
 usage() {
 cat << EOF
@@ -20,6 +21,8 @@ Whatever else happens is driven by its argument:
                     terminal instead.
   --no-callers    - Do not lookup the caller address/symbol/line whilst tracing.
   --no-mark-dirty - Do not record image data for cairo_mark_dirty()
+  --compress      - Compress the output with LZMA
+  --profile       - Combine --no-callers and --no-mark-dirty and --compress
 Enviroment variables understood by cairo-trace:
   CAIRO_TRACE_FLUSH - flush the output after every function call.
@@ -48,6 +51,18 @@ while test $skip -eq 1; do
+    --compress)
+	skip=1
+	compress=1
+	nofile=1
+	;;
+    --profile)
+	skip=1
+	compress=1
+	nomarkdirty=1
+	nocallers=1
+	nofile=1
+	;;
 	echo "cairo-trace, version @CAIRO_VERSION_MAJOR at .@CAIRO_VERSION_MINOR at .@CAIRO_VERSION_MICRO at ."
@@ -87,6 +102,9 @@ fi
 if test -z "$nofile"; then
     CAIRO_TRACE_OUTDIR=`pwd` "$@"
+elif test -n "$compress"; then
+    echo Generating compressed trace file $1.$$.lzma
+    CAIRO_TRACE_FD=3 "$@" 3>&1 | lzma -cz9 > $1.$$.lzma
     CAIRO_TRACE_FD=3 "$@" 3>&1 >/dev/null

More information about the cairo-commit mailing list