perf: Fix trace path handling in scripts

Fix `run.sh` and `run_traces.sh` trace path handling by taking into
account that the `--trace` option may contain a multi-directory path
relative to traces-db.

Together with this fix, you should expect to find the output directory
of a perf testing session under the same directory of the trace file.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Antonio Caggiano 4 years ago
parent b9dc30355a
commit c165357711
  1. 9
      perf-testing/Docker/run.sh
  2. 9
      perf-testing/Docker/run_traces.sh

@ -132,9 +132,8 @@ export LD_LIBRARY_PATH="/waffle/build/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="/usr/local/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH"
trace_name=$(basename $trace)
trace_base=${trace_name%.*}
datadir="/traces-db/${trace_base}-out"
trace_no_ext=${trace%.*}
datadir="/traces-db/${trace_no_ext}-out"
echo "Host:"
wflinfo --platform surfaceless_egl --api gles2
@ -175,10 +174,10 @@ echo 1 > /proc/sys/net/ipv4/ip_forward
# store name of trace to be replayed so the guest can obtain the name
echo $trace_base > /traces-db/current_trace
echo $trace_no_ext > /traces-db/current_trace
echo $command > /traces-db/command
trace_base=$(basename $trace_no_ext)
guest_perf="$datadir/${trace_base}-guest.perfetto"
host_perf="$datadir/${trace_base}-host.perfetto"
summary_perf="$datadir/${trace_base}-summary.perfetto"

@ -34,8 +34,8 @@ time chronyd -q # Initial synchronization, will take some time
chronyd # Keep clocks in sync
# Get trace cached
trace_base=$(cat /traces-db/current_trace)
if [ "x$trace_base" = "x" ]; then
trace_no_ext=$(cat /traces-db/current_trace)
if [ "x$trace_no_ext" = "x" ]; then
echo "No trace given, bailing out"
exit 1
fi
@ -75,8 +75,9 @@ if [ -e /traces-db/wait_after_frame ]; then
WAIT=-wait-after-frame
fi
trace="/traces-db/${trace_base}.trace"
datadir="/traces-db/${trace_base}-out"
trace="/traces-db/${trace_no_ext}.trace"
datadir="/traces-db/${trace_no_ext}-out"
trace_base=$(basename ${trace_no_ext})
guest_perf="$datadir/${trace_base}-guest.perfetto"
cat "$trace" > /dev/null

Loading…
Cancel
Save