Skip to content

Commit 98ce8e4

Browse files
georgmuacmel
authored andcommitted
perf test uprobe_from_different_cu: Skip if there is no gcc
Without gcc, the test will fail. On cleanup, ignore probe removal errors. Otherwise, in case of an error adding the probe, the temporary directory is not removed. Fixes: 56cbeac ("perf probe: Add test for regression introduced by switch to die_get_decl_file()") Signed-off-by: Georg Müller <[email protected]> Acked-by: Ian Rogers <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Georg Müller <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/CAP-5=fUP6UuLgRty3t2=fQsQi3k4hDMz415vWdp1x88QMvZ8ug@mail.gmail.com/ Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent b161f25 commit 98ce8e4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tools/perf/tests/shell/test_uprobe_from_different_cu.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,20 @@
44

55
set -e
66

7+
# skip if there's no gcc
8+
if ! [ -x "$(command -v gcc)" ]; then
9+
echo "failed: no gcc compiler"
10+
exit 2
11+
fi
12+
713
temp_dir=$(mktemp -d /tmp/perf-uprobe-different-cu-sh.XXXXXXXXXX)
814

915
cleanup()
1016
{
1117
trap - EXIT TERM INT
1218
if [[ "${temp_dir}" =~ ^/tmp/perf-uprobe-different-cu-sh.*$ ]]; then
1319
echo "--- Cleaning up ---"
14-
perf probe -x ${temp_dir}/testfile -d foo
20+
perf probe -x ${temp_dir}/testfile -d foo || true
1521
rm -f "${temp_dir}/"*
1622
rmdir "${temp_dir}"
1723
fi

0 commit comments

Comments
 (0)