[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <175611748780.1420.16967706840831656025.tip-bot2@tip-bot2>
Date: Mon, 25 Aug 2025 10:24:47 -0000
From: "tip-bot2 for Jiri Olsa" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Jiri Olsa <jolsa@...nel.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Andrii Nakryiko <andrii@...nel.org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: perf/core] selftests/bpf: Rename uprobe_syscall_executed prog
to test_uretprobe_multi
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 7932c4cf577187dec42ddfba0aba26434cecab0c
Gitweb: https://git.kernel.org/tip/7932c4cf577187dec42ddfba0aba26434cecab0c
Author: Jiri Olsa <jolsa@...nel.org>
AuthorDate: Sun, 20 Jul 2025 13:21:23 +02:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Thu, 21 Aug 2025 20:09:23 +02:00
selftests/bpf: Rename uprobe_syscall_executed prog to test_uretprobe_multi
Renaming uprobe_syscall_executed prog to test_uretprobe_multi
to fit properly in the following changes that add more programs.
Plus adding pid filter and increasing executed variable.
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Acked-by: Andrii Nakryiko <andrii@...nel.org>
Link: https://lore.kernel.org/r/20250720112133.244369-14-jolsa@kernel.org
---
tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c | 12 ++++---
tools/testing/selftests/bpf/progs/uprobe_syscall_executed.c | 8 +++--
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c b/tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c
index a8f00ae..6d58a44 100644
--- a/tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c
+++ b/tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c
@@ -252,6 +252,7 @@ static void test_uretprobe_syscall_call(void)
);
struct uprobe_syscall_executed *skel;
int pid, status, err, go[2], c = 0;
+ struct bpf_link *link;
if (!ASSERT_OK(pipe(go), "pipe"))
return;
@@ -277,11 +278,14 @@ static void test_uretprobe_syscall_call(void)
_exit(0);
}
- skel->links.test = bpf_program__attach_uprobe_multi(skel->progs.test, pid,
- "/proc/self/exe",
- "uretprobe_syscall_call", &opts);
- if (!ASSERT_OK_PTR(skel->links.test, "bpf_program__attach_uprobe_multi"))
+ skel->bss->pid = pid;
+
+ link = bpf_program__attach_uprobe_multi(skel->progs.test_uretprobe_multi,
+ pid, "/proc/self/exe",
+ "uretprobe_syscall_call", &opts);
+ if (!ASSERT_OK_PTR(link, "bpf_program__attach_uprobe_multi"))
goto cleanup;
+ skel->links.test_uretprobe_multi = link;
/* kick the child */
write(go[1], &c, 1);
diff --git a/tools/testing/selftests/bpf/progs/uprobe_syscall_executed.c b/tools/testing/selftests/bpf/progs/uprobe_syscall_executed.c
index 0d7f1a7..8f48976 100644
--- a/tools/testing/selftests/bpf/progs/uprobe_syscall_executed.c
+++ b/tools/testing/selftests/bpf/progs/uprobe_syscall_executed.c
@@ -8,10 +8,14 @@ struct pt_regs regs;
char _license[] SEC("license") = "GPL";
int executed = 0;
+int pid;
SEC("uretprobe.multi")
-int test(struct pt_regs *regs)
+int test_uretprobe_multi(struct pt_regs *ctx)
{
- executed = 1;
+ if (bpf_get_current_pid_tgid() >> 32 != pid)
+ return 0;
+
+ executed++;
return 0;
}
Powered by blists - more mailing lists