Skip to content

Commit

Permalink
perf tests: Fix trace+probe_vfs_getname.sh /tmp cleanup
Browse files Browse the repository at this point in the history
The temp file is only cleaned up if the test is not skipped, so delay
making it until after the skip so it doesn'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.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20210921131009.390810-2-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 cf95f85 commit 39c5348
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/perf/tests/shell/trace+probe_vfs_getname.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ skip_if_no_perf_trace || exit 2

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

file=$(mktemp /tmp/temporary_file.XXXXX)

trace_open_vfs_getname() {
evts=$(echo $(perf list syscalls:sys_enter_open* 2>/dev/null | egrep 'open(at)? ' | sed -r 's/.*sys_enter_([a-z]+) +\[.*$/\1/') | sed 's/ /,/')
perf trace -e $evts touch $file 2>&1 | \
Expand All @@ -32,6 +30,8 @@ if [ $err -ne 0 ] ; then
exit $err
fi

file=$(mktemp /tmp/temporary_file.XXXXX)

# Do not use whatever ~/.perfconfig file, it may change the output
# via trace.{show_timestamp,show_prefix,etc}
export PERF_CONFIG=/dev/null
Expand Down

0 comments on commit 39c5348

Please sign in to comment.