-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpf: Add kprobe multi link #2613
Conversation
Master branch: 13c6a37 |
Master branch: 6966d4c |
0ad6665
to
d1cbad6
Compare
Master branch: b4f7278 |
d1cbad6
to
6c2f025
Compare
Master branch: a19df71 |
6c2f025
to
83a08f0
Compare
Master branch: 08894d9 |
83a08f0
to
7ce4852
Compare
Master branch: c561d11 |
7ce4852
to
8ad6553
Compare
Master branch: 08d4dba |
8ad6553
to
d231e4a
Compare
Master branch: 80bebeb |
d231e4a
to
50fd844
Compare
Master branch: dda7596 |
50fd844
to
4db8ca9
Compare
Master branch: 5e214f2 |
4db8ca9
to
d403afd
Compare
Master branch: c62dd8a |
d403afd
to
1f5a8d9
Compare
Adding support to have priv pointer in swap callback function. Following the initial change on cmp callback functions [1] and adding SWAP_WRAPPER macro to identify sort call of sort_r. Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk> [1] 4333fb9 ("media: lib/sort.c: implement sort() variant taking context argument") Signed-off-by: Jiri Olsa <jolsa@kernel.org> Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Adding new link type BPF_LINK_TYPE_KPROBE_MULTI that attaches kprobe program through fprobe API. The fprobe API allows to attach probe on multiple functions at once very fast, because it works on top of ftrace. On the other hand this limits the probe point to the function entry or return. The kprobe program gets the same pt_regs input ctx as when it's attached through the perf API. Adding new attach type BPF_TRACE_KPROBE_MULTI that allows attachment kprobe to multiple function with new link. User provides array of addresses or symbols with count to attach the kprobe program to. The new link_create uapi interface looks like: struct { __aligned_u64 syms; __aligned_u64 addrs; __u32 cnt; __u32 flags; } kprobe_multi; The flags field allows single BPF_TRACE_KPROBE_MULTI bit to create return multi kprobe. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Adding support to call bpf_get_func_ip helper from kprobe programs attached by multi kprobe link. Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Adding support to inline it on x86, because it's single load instruction. Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Adding support to call bpf_get_attach_cookie helper from kprobe programs attached with kprobe multi link. The cookie is provided by array of u64 values, where each value is paired with provided function address or symbol with the same array index. Suggested-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Move the kallsyms parsing in internal libbpf_kallsyms_parse function, so it can be used from other places. It will be used in following changes. Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Adding new kprobe_multi struct to bpf_link_create_opts object to pass multiple kprobe data to link_create attr uapi. Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Adding support to bpf_program__attach_kprobe_opts to attach kprobes to multiple functions. If the kprobe program has BPF_TRACE_KPROBE_MULTI as expected_attach_type it will use the new kprobe_multi link to attach the program. In this case it will use 'func_name' as pattern for functions to attach. Adding also new section types 'kprobe.multi' and kretprobe.multi' that allows to specify wildcards (*?) for functions, like: SEC("kprobe.multi/bpf_fentry_test*") SEC("kretprobe.multi/bpf_fentry_test?") This will set kprobe's expected_attach_type to BPF_TRACE_KPROBE_MULTI, and attach it to functions provided by the function pattern. Using glob_match from selftests/bpf/test_progs.c and adding support to match '?' based on original perf code. Cc: Masami Hiramatsu <mhiramat@redhat.com> Cc: Yucong Sun <fallentree@fb.com> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Adding kprobe_multi attach test that uses new fprobe interface to attach kprobe program to multiple functions. The test is attaching programs to bpf_fentry_test* functions and uses single trampoline program bpf_prog_test_run to trigger bpf_fentry_test* functions. Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Master branch: 07609c1 |
Adding bpf_cookie test for programs attached by kprobe_multi links. Signed-off-by: Jiri Olsa <jolsa@kernel.org>
1f5a8d9
to
fb21503
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=616820 expired. Closing PR. |
Pull request for series with
subject: bpf: Add kprobe multi link
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=616820