diff options
author | Louis-Francis Ratté-Boulianne <lfrb@collabora.com> | 2020-12-29 21:14:55 -0500 |
---|---|---|
committer | Gert Wollny <gw.fossdev@gmail.com> | 2021-01-25 08:28:05 +0000 |
commit | b9dc30355a2021c6a1cdd8bfbf23f7ffc342d89b (patch) | |
tree | 7c9af386b8a1c5e3e566f1adf6d10fb05b5f79bb /perf-testing | |
parent | f5a45fe97e1f3ef49bdf01273aff24a2f52949ad (diff) |
perf: don't start perfetto when disabled with argument
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Diffstat (limited to 'perf-testing')
-rwxr-xr-x | perf-testing/Docker/run.sh | 43 | ||||
-rw-r--r-- | perf-testing/Docker/run_traces.sh | 29 |
2 files changed, 35 insertions, 37 deletions
diff --git a/perf-testing/Docker/run.sh b/perf-testing/Docker/run.sh index de601a5..218269a 100755 --- a/perf-testing/Docker/run.sh +++ b/perf-testing/Docker/run.sh @@ -152,25 +152,23 @@ fi echo 0 > /sys/kernel/debug/tracing/tracing_on echo nop > /sys/kernel/debug/tracing/current_tracer -/perfetto/out/dist/traced & -/perfetto/out/dist/traced_probes & -sleep 1 -/gfx-pps/build/src/gpu/producer-gpu & -sleep 1 -/perfetto/out/dist/perfetto --txt -c /usr/local/perfetto-host.cfg -o /tmp/perfetto-host.trace --detach=mykey -sleep 1 - if [ "x$perfetto_loops" != "x" ] ; then echo "perfetto_loops parameter not given" fi -echo "Replaying for Perfetto:" -LOOP= if [ "x$perfetto_loops" != "x0" ]; then - LOOP="--loop=$perfetto_loops" + /perfetto/out/dist/traced & + /perfetto/out/dist/traced_probes & + sleep 1 + /gfx-pps/build/src/gpu/producer-gpu & + sleep 1 + /perfetto/out/dist/perfetto --txt -c /usr/local/perfetto-host.cfg -o /tmp/perfetto-host.trace --detach=mykey + sleep 1 + + echo "Replaying for Perfetto:" + eglretrace --benchmark --singlethread --loop=$perfetto_loops $wait_after_frame --headless "/traces-db/${trace}" fi -eglretrace --benchmark --singlethread $LOOP $wait_after_frame --headless "/traces-db/${trace}" iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE echo 1 > /proc/sys/net/ipv4/ip_forward @@ -212,16 +210,19 @@ crosvm run \ rm -f /traces-db/current_trace rm -f /traces-db/command -/perfetto/out/dist/perfetto --attach=mykey --stop +if [ "x$perfetto_loops" != "x0" ]; then + /perfetto/out/dist/perfetto --attach=mykey --stop + + mv /tmp/perfetto-host.trace "$host_perf" + chmod a+rw "$host_perf" -mv /tmp/perfetto-host.trace "$host_perf" -chmod a+rw "$host_perf" + # sometimes one of these processes seems to crash or exit before, so + # check whether it is still + kill `pidof producer-gpu` || echo "producer-gpu was not running (anymore)" + kill `pidof traced_probes` || echo "traced_probes was not running (anymore)" + kill `pidof traced` || echo "traced was not running (anymore=" -# sometimes one of these processes seems to crash or exit before, so -# check whether it is still -kill `pidof producer-gpu` || echo "producer-gpu was not running (anymore)" -kill `pidof traced_probes` || echo "traced_probes was not running (anymore)" -kill `pidof traced` || echo "traced was not running (anymore=" + /usr/local/merge_traces.py "$host_perf" "$guest_perf" "$summary_perf" +fi -/usr/local/merge_traces.py "$host_perf" "$guest_perf" "$summary_perf" sleep 1 diff --git a/perf-testing/Docker/run_traces.sh b/perf-testing/Docker/run_traces.sh index 823ef6b..0787a50 100644 --- a/perf-testing/Docker/run_traces.sh +++ b/perf-testing/Docker/run_traces.sh @@ -88,26 +88,23 @@ echo nop > /sys/kernel/debug/tracing/current_tracer echo "Guest:" wflinfo --platform surfaceless_egl --api gles2 -v -/perfetto/out/dist/traced & -/perfetto/out/dist/traced_probes & -sleep 1 +if [ "x$perfetto_loops" != "x" -a "x$perfetto_loops" != "x0" ]; then + /perfetto/out/dist/traced & + /perfetto/out/dist/traced_probes & + sleep 1 -/perfetto/out/dist/perfetto --txt -c /usr/local/perfetto-guest.cfg -o "$guest_perf" --detach=mykey -sleep 1 + /perfetto/out/dist/perfetto --txt -c /usr/local/perfetto-guest.cfg -o "$guest_perf" --detach=mykey + sleep 1 -# The first virtio-gpu event has to be captured in the guest, so we correlate correctly to the host event + # The first virtio-gpu event has to be captured in the guest, so we correlate correctly to the host event -echo "Replaying for Perfetto:" -LOOP= -if [ "x$perfetto_loops" != "x" -a "x$perfetto_loops" != "x0" ]; then - LOOP="--loop=$perfetto_loops" -fi + echo "Replaying for Perfetto:" + eglretrace --benchmark --singlethread --loop=$perfetto_loops $WAIT --headless "$trace" + sleep 1 -eglretrace --benchmark --singlethread $LOOP $WAIT --headless "$trace" -sleep 1 - -/perfetto/out/dist/perfetto --attach=mykey --stop -chmod a+rw "$guest_perf" + /perfetto/out/dist/perfetto --attach=mykey --stop + chmod a+rw "$guest_perf" +fi if [ "x$benchmark_loops" != "x0" ]; then echo "Measuring rendering times:" |