]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Add uprobe ref counter offset support for USDT semaphores
authorAndrii Nakryiko <andrii@kernel.org>
Sun, 15 Aug 2021 07:06:08 +0000 (00:06 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 16 Aug 2021 22:45:08 +0000 (00:45 +0200)
commit3afdf4e8507c57696a1bf836a0e9790bbe4d8e22
tree290b81ae84bd5819db142c6da14c8502ae20c3b0
parent9dd02a4dcd4742436dbf06f5eb961e5c131db71c
libbpf: Add uprobe ref counter offset support for USDT semaphores

When attaching to uprobes through perf subsystem, it's possible to specify
offset of a so-called USDT semaphore, which is just a reference counted u16,
used by kernel to keep track of how many tracers are attached to a given
location. Support for this feature was added in [0], so just wire this through
uprobe_opts. This is important to enable implementing USDT attachment and
tracing through libbpf's bpf_program__attach_uprobe_opts() API.

  [0] b83bf3bcb5b1 ("trace_uprobe: support reference counter in fd-based uprobe")

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210815070609.987780-16-andrii@kernel.org
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h