From f1e97767218eb456956b43493cd6833a8806544a Mon Sep 17 00:00:00 2001 From: Romaric Jodin <89833130+rjodinchr@users.noreply.github.com> Date: Sun, 21 Jan 2024 20:49:43 +0100 Subject: [PATCH] always clean perfetto tmp files (#653) --- tests/perfetto/check-perfetto-trace.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/perfetto/check-perfetto-trace.sh b/tests/perfetto/check-perfetto-trace.sh index 3b29d8a9..4623c790 100755 --- a/tests/perfetto/check-perfetto-trace.sh +++ b/tests/perfetto/check-perfetto-trace.sh @@ -14,6 +14,11 @@ EXPECTATION_SORTED="${EXPECTATION_FILE}.sorted" # Either it is in your path, or you need to define the environment variable TRACE_PROCESSOR_SHELL=${TRACE_PROCESSOR_SHELL:-"trace_processor_shell"} +function clean() { + rm -f "${OUTPUT_FILE}" "${EXPECTATION_SORTED}" +} +trap clean EXIT + echo "SELECT name FROM slice WHERE slice.category='clvk'" \ | "${TRACE_PROCESSOR_SHELL}" -q /dev/stdin "${TRACE_FILE}" \ | sort \ @@ -24,4 +29,3 @@ echo "SELECT name FROM slice WHERE slice.category='clvk'" \ sort "${EXPECTATION_FILE}" > "${EXPECTATION_SORTED}" diff "${OUTPUT_FILE}" "${EXPECTATION_SORTED}" -rm "${OUTPUT_FILE}" "${EXPECTATION_SORTED}"