]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Add bpf_cookie support to bpf_link_create() API
authorAndrii Nakryiko <andrii@kernel.org>
Sun, 15 Aug 2021 07:06:03 +0000 (00:06 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 16 Aug 2021 22:45:08 +0000 (00:45 +0200)
commitaf4000edc440b54bfad09903991a083fd96543e9
treed3f711331cd4c4fd2ecd7c01cd68316ec81c3399
parent8ec883bdcf208e97a4bd5908483d18631e2920e7
libbpf: Add bpf_cookie support to bpf_link_create() API

Add ability to specify bpf_cookie value when creating BPF perf link with
bpf_link_create() low-level API.

Given BPF_LINK_CREATE command is growing and keeps getting new fields that are
specific to the type of BPF_LINK, extend libbpf side of bpf_link_create() API
and corresponding OPTS struct to accomodate such changes. Add extra checks to
prevent using incompatible/unexpected combinations of fields.

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