aboutsummaryrefslogtreecommitdiff
path: root/tools/lib/bpf/libbpf.h
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2020-03-02 20:31:57 -0800
committerAlexei Starovoitov <ast@kernel.org>2020-03-02 22:06:27 -0800
commit70ed506c3bbcfa846d4636b23051ca79fa4781f7 (patch)
tree82ef162ee20b4d3b4b501c8768ed1c7c4007d968 /tools/lib/bpf/libbpf.h
parent775a2be52da1c55fc810a5d151049f86f0fd5362 (diff)
bpf: Introduce pinnable bpf_link abstraction
Introduce bpf_link abstraction, representing an attachment of BPF program to a BPF hook point (e.g., tracepoint, perf event, etc). bpf_link encapsulates ownership of attached BPF program, reference counting of a link itself, when reference from multiple anonymous inodes, as well as ensures that release callback will be called from a process context, so that users can safely take mutex locks and sleep. Additionally, with a new abstraction it's now possible to generalize pinning of a link object in BPF FS, allowing to explicitly prevent BPF program detachment on process exit by pinning it in a BPF FS and let it open from independent other process to keep working with it. Convert two existing bpf_link-like objects (raw tracepoint and tracing BPF program attachments) into utilizing bpf_link framework, making them pinnable in BPF FS. More FD-based bpf_links will be added in follow up patches. Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200303043159.323675-2-andriin@fb.com
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
0 files changed, 0 insertions, 0 deletions