[PATCH v6 26/26] perf test uprobe_from_different_cu: Scope probe name to PID
From: Ian Rogers
Date: Mon Sep 28 2026 - 14:41:17 EST
perf probe names the event after the function and binary, so concurrent
runs, as with 'perf test -r3', all add probe_testfile:foo and all but one
fail with 'event "foo" already exists'. Name the event foo_$$.
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
tools/perf/tests/shell/test_uprobe_from_different_cu.sh | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/perf/tests/shell/test_uprobe_from_different_cu.sh b/tools/perf/tests/shell/test_uprobe_from_different_cu.sh
index 83505093257d..33bf36c4037e 100755
--- a/tools/perf/tests/shell/test_uprobe_from_different_cu.sh
+++ b/tools/perf/tests/shell/test_uprobe_from_different_cu.sh
@@ -17,12 +17,15 @@ fi
temp_dir=$(mktemp -d /tmp/perf-uprobe-different-cu-sh.XXXXXXXXXX)
+# Scope to the pid, otherwise every run adds the same probe_testfile:foo.
+probe_name="foo_$$"
+
cleanup()
{
trap - EXIT TERM INT
if [[ "${temp_dir}" =~ ^/tmp/perf-uprobe-different-cu-sh.*$ ]]; then
echo "--- Cleaning up ---"
- perf probe -x ${temp_dir}/testfile -d foo || true
+ perf probe -x ${temp_dir}/testfile -d ${probe_name} || true
rm -f "${temp_dir}/"*
rmdir "${temp_dir}"
fi
@@ -83,6 +86,6 @@ gcc -g -Og -c ${temp_dir}/testfile-main.c -o ${temp_dir}/testfile-main.o
gcc -g -Og -o ${temp_dir}/testfile ${temp_dir}/testfile-foo.o ${temp_dir}/testfile-main.o
perf probe -x ${temp_dir}/testfile --funcs foo | grep "foo"
-perf probe -x ${temp_dir}/testfile foo
+perf probe -x ${temp_dir}/testfile ${probe_name}=foo
cleanup
--
2.56.0.rc1.315.gc6ed9934b7-goog