diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-06-13 15:49:15 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-06-13 15:49:15 +0100 |
commit | f115c5479ead934774fea99d74d780e2bb1681c4 (patch) | |
tree | 9a0ccad0a77e5dc56888d272c41bae2512141017 | |
parent | c52eed6680dd13f6bc65dc4a26b6c8eab5a94a54 (diff) | |
download | cairo-f115c5479ead934774fea99d74d780e2bb1681c4.tar.gz |
[trace] Strip absolute path off name when profiling
Carl spotted this last night, but I misinterpreted it as an old problem
caused by the application changing its working directory before its first
cairo call - thus causing cairo-trace to attempt to open a file in the new
directory. Instead the problem was attempting to trace an executable with
an absolute path, where we just tagged it with a .lzma extentsion and
attempted to pipe the output there. Obviously this fails for the user
profiling system binaries. So use basename to strip the leading path.
-rw-r--r-- | util/cairo-trace/cairo-trace.in | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/util/cairo-trace/cairo-trace.in b/util/cairo-trace/cairo-trace.in index 16cdad62e..3e54d4eda 100644 --- a/util/cairo-trace/cairo-trace.in +++ b/util/cairo-trace/cairo-trace.in @@ -108,8 +108,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 >/dev/null | lzma -cz9 > $1.$$.lzma + name=`basename $1` + echo Generating compressed trace file $name.$$.lzma + CAIRO_TRACE_FD=3 "$@" 3>&1 >/dev/null | lzma -cz9 > $name.$$.lzma else CAIRO_TRACE_FD=3 "$@" 3>&1 >/dev/null fi |