Skip to content

Commit

Permalink
perf test: Fix record+script_probe_vfs_getname.sh /tmp cleanup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
James Clark authored and Arnaldo Carvalho de Melo committed Oct 26, 2021
1 parent 3a55445 commit cf95f85
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/perf/tests/shell/record+script_probe_vfs_getname.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ skip_if_no_perf_probe || exit 2

. $(dirname $0)/lib/probe_vfs_getname.sh

perfdata=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
file=$(mktemp /tmp/temporary_file.XXXXX)

record_open_file() {
echo "Recording open file:"
perf record -o ${perfdata} -e probe:vfs_getname\* touch $file
Expand All @@ -35,6 +32,9 @@ if [ $err -ne 0 ] ; then
exit $err
fi

perfdata=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
file=$(mktemp /tmp/temporary_file.XXXXX)

record_open_file && perf_script_filenames
err=$?
rm -f ${perfdata}
Expand Down

0 comments on commit cf95f85

Please sign in to comment.