diff options
author | Andrii Nakryiko <andriin@fb.com> | 2020-03-30 05:00:00 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-03-31 02:36:41 +0200 |
commit | cc4f864bb118e0ae7bf9f4e3418eaeb083aa34f2 (patch) | |
tree | c5b57abcdd856f641e0c5d07f3c3bc7ec54e2f15 /tools/lib/bpf/libbpf.map | |
parent | bpf: Implement bpf_prog replacement for an active bpf_cgroup_link (diff) | |
download | linux-cc4f864bb118e0ae7bf9f4e3418eaeb083aa34f2.tar.xz linux-cc4f864bb118e0ae7bf9f4e3418eaeb083aa34f2.zip |
libbpf: Add support for bpf_link-based cgroup attachment
Add bpf_program__attach_cgroup(), which uses BPF_LINK_CREATE subcommand to
create an FD-based kernel bpf_link. Also add low-level bpf_link_create() API.
If expected_attach_type is not specified explicitly with
bpf_program__set_expected_attach_type(), libbpf will try to determine proper
attach type from BPF program's section definition.
Also add support for bpf_link's underlying BPF program replacement:
- unconditional through high-level bpf_link__update_program() API;
- cmpxchg-like with specifying expected current BPF program through
low-level bpf_link_update() API.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200330030001.2312810-4-andriin@fb.com
Diffstat (limited to '')
-rw-r--r-- | tools/lib/bpf/libbpf.map | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map index eabd3d3e689f..bb8831605b25 100644 --- a/tools/lib/bpf/libbpf.map +++ b/tools/lib/bpf/libbpf.map @@ -243,7 +243,11 @@ LIBBPF_0.0.8 { bpf_link__pin; bpf_link__pin_path; bpf_link__unpin; + bpf_link__update_program; + bpf_link_create; + bpf_link_update; bpf_map__set_initial_value; + bpf_program__attach_cgroup; bpf_program__attach_lsm; bpf_program__is_lsm; bpf_program__set_attach_target; |