[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!
This commit is contained in:
Chris Wilson 2009-06-03 19:29:19 +01:00
parent 9451f0b983
commit fa5d6c7afd
2 changed files with 27 additions and 2 deletions

View file

@ -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@cairographics.org.
it, LZMA preferred, and posting a link to cairo@cairographics.org, or by
uploading it to git.cairographics.org/cairo-traces.
How to run cairo-perf-diff on WINDOWS

View file

@ -7,6 +7,7 @@ nofile=
flush=
nocallers=
nomarkdirty=
compress=
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
skip=1
nomarkdirty=1
;;
--compress)
skip=1
compress=1
nofile=1
;;
--profile)
skip=1
compress=1
nomarkdirty=1
nocallers=1
nofile=1
;;
--version)
echo "cairo-trace, version @CAIRO_VERSION_MAJOR@.@CAIRO_VERSION_MINOR@.@CAIRO_VERSION_MICRO@."
exit
@ -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
else
CAIRO_TRACE_FD=3 "$@" 3>&1 >/dev/null
fi