Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf test: Fix record+script_probe_vfs_getname.sh /tmp cleanup

The temp files are only cleaned up if the test is not skipped, so delay
making them until after the skip so they don't get left behind in /tmp.

Signed-off-by: James Clark <james.clark@arm.com>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20210921131009.390810-1-james.clark@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

James Clark and committed by
Arnaldo Carvalho de Melo
cf95f85e 3a55445f

+3 -3
+3 -3
tools/perf/tests/shell/record+script_probe_vfs_getname.sh
··· 15 15 16 16 . $(dirname $0)/lib/probe_vfs_getname.sh 17 17 18 - perfdata=$(mktemp /tmp/__perf_test.perf.data.XXXXX) 19 - file=$(mktemp /tmp/temporary_file.XXXXX) 20 - 21 18 record_open_file() { 22 19 echo "Recording open file:" 23 20 perf record -o ${perfdata} -e probe:vfs_getname\* touch $file ··· 31 34 if [ $err -ne 0 ] ; then 32 35 exit $err 33 36 fi 37 + 38 + perfdata=$(mktemp /tmp/__perf_test.perf.data.XXXXX) 39 + file=$(mktemp /tmp/temporary_file.XXXXX) 34 40 35 41 record_open_file && perf_script_filenames 36 42 err=$?