[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAEf4Bza4JztS8YBaEFUi81OwH2aSNbv3c29hoVc31vTnfgiCLA@mail.gmail.com>
Date: Fri, 30 Aug 2024 13:51:04 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Jiri Olsa <jolsa@...nel.org>
Cc: Oleg Nesterov <oleg@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Andrii Nakryiko <andrii@...nel.org>, Tianyi Liu <i.pear@...look.com>,
Masami Hiramatsu <mhiramat@...nel.org>, bpf@...r.kernel.org,
Steven Rostedt <rostedt@...dmis.org>, linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next 2/2] selftests/bpf: Add uprobe pid filter test
for multiple processes
On Thu, Aug 29, 2024 at 12:45 PM Jiri Olsa <jolsa@...nel.org> wrote:
>
> The idea is to create and monitor 3 uprobes, each trigered in separate
typo: triggered
> process and make sure the bpf program gets executed just for the proper
> PID specified via pid filter.
>
> Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> ---
> .../bpf/prog_tests/uprobe_multi_test.c | 103 ++++++++++++++++++
> .../bpf/progs/uprobe_multi_pid_filter.c | 61 +++++++++++
> 2 files changed, 164 insertions(+)
> create mode 100644 tools/testing/selftests/bpf/progs/uprobe_multi_pid_filter.c
>
It's good to have a test, thanks for adding it! But we should couple
it with the fix in multi-uprobe and land together, right? I'm not
exactly sure why we can't just use task->signal-based check, but let's
try to converge on something and fix it.
pw-bot: cr
[...]
> +#define TASKS 3
> +
> +static void run_pid_filter(struct uprobe_multi_pid_filter *skel,
> + create_link_t create_link, bool retprobe)
> +{
> + struct bpf_link *link[TASKS] = {};
> + struct child child[TASKS] = {};
> + int i;
> +
> + printf("%s retprobe %d\n", create_link == create_link_uprobe ? "uprobe" : "uprobe_multi",
> + retprobe);
leftovers
> +
> + memset(skel->bss->test, 0, sizeof(skel->bss->test));
> +
> + for (i = 0; i < TASKS; i++) {
> + if (!ASSERT_OK(spawn_child(&child[i]), "spawn_child"))
> + goto cleanup;
> + skel->bss->pids[i] = child[i].pid;
> + }
[...]
Powered by blists - more mailing lists