]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Allow specification of "kprobe/function+offset"
authorAlan Maguire <alan.maguire@oracle.com>
Wed, 14 Jul 2021 09:43:59 +0000 (11:43 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 16 Jul 2021 00:59:14 +0000 (17:59 -0700)
commit70ac62d650f8d0e2535f52e290486fc81bc0a505
treeaae9f132250a1913f42af9e93c0b4343c17f663c
parent48f708f45bb0a5e09a493cdda9276c532b7435e8
libbpf: Allow specification of "kprobe/function+offset"

kprobes can be placed on most instructions in a function, not
just entry, and ftrace and bpftrace support the function+offset
notification for probe placement.  Adding parsing of func_name
into func+offset to bpf_program__attach_kprobe() allows the
user to specify

SEC("kprobe/bpf_fentry_test5+0x6")

...for example, and the offset can be passed to perf_event_open_probe()
to support kprobe attachment.

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210714094400.396467-8-jolsa@kernel.org
tools/lib/bpf/libbpf.c