]> 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)
commitc01addec91887ae2d43a3ee197b9f8cdc7d2e433
treeaae9f132250a1913f42af9e93c0b4343c17f663c
parent584863f65e9bfe5910cc981b6e4c9d7c46e4bdd2
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