diff options
| author | Jiri Olsa <jolsa@kernel.org> | 2022-05-10 14:26:16 +0200 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2022-05-10 14:42:06 -0700 |
| commit | 5b6c7e5c44349b29c614e1b61f80c6849fc72ccf (patch) | |
| tree | b3668dbe0d94016081c7e48f29d1bc0febf1f471 /tools/testing/selftests/bpf/progs/kprobe_multi_empty.c | |
| parent | bpf: Resolve symbols with ftrace_lookup_symbols for kprobe multi link (diff) | |
| download | linux-5b6c7e5c44349b29c614e1b61f80c6849fc72ccf.tar.gz linux-5b6c7e5c44349b29c614e1b61f80c6849fc72ccf.zip | |
selftests/bpf: Add attach bench test
Adding test that reads all functions from ftrace available_filter_functions
file and attach them all through kprobe_multi API.
It also prints stats info with -v option, like on my setup:
test_bench_attach: found 48712 functions
test_bench_attach: attached in 1.069s
test_bench_attach: detached in 0.373s
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20220510122616.2652285-6-jolsa@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/kprobe_multi_empty.c')
| -rw-r--r-- | tools/testing/selftests/bpf/progs/kprobe_multi_empty.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/kprobe_multi_empty.c b/tools/testing/selftests/bpf/progs/kprobe_multi_empty.c new file mode 100644 index 000000000000..e76e499aca39 --- /dev/null +++ b/tools/testing/selftests/bpf/progs/kprobe_multi_empty.c @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0 +#include <linux/bpf.h> +#include <bpf/bpf_helpers.h> +#include <bpf/bpf_tracing.h> + +char _license[] SEC("license") = "GPL"; + +SEC("kprobe.multi/") +int test_kprobe_empty(struct pt_regs *ctx) +{ + return 0; +} |
