]> git.baikalelectronics.ru Git - kernel.git/commit
tools lib bpf: Add bpf_prog_{attach,detach}
authorJoe Stringer <joe@ovn.org>
Wed, 14 Dec 2016 22:05:26 +0000 (14:05 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 20 Dec 2016 15:00:39 +0000 (12:00 -0300)
commit623dba7269b439c34c5ad52a96b6345139fcf3c3
treeb2d6edd5122a4da1c87e5760adbeea14d2323e0d
parent324a337232a6ab867bcc63c7aa85a89c16c4e88b
tools lib bpf: Add bpf_prog_{attach,detach}

Commit 2254e2190d73 ("samples: bpf: add userspace example for attaching
eBPF programs to cgroups") added these functions to samples/libbpf, but
during this merge all of the samples libbpf functionality is shifting to
tools/lib/bpf. Shift these functions there.

Committer notes:

Use bzero + attr.FIELD = value instead of 'attr = { .FIELD = value, just
like the other wrapper calls to sys_bpf with bpf_attr to make this build
in older toolchais, such as the ones in CentOS 5 and 6.

Signed-off-by: Joe Stringer <joe@ovn.org>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-au2zvtsh55vqeo3v3uw7jr4c@git.kernel.org
Link: https://github.com/joestringer/linux/commit/353e6f298c3d0a92fa8bfa61ff898c5050261a12.patch
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
samples/bpf/libbpf.c
samples/bpf/libbpf.h
tools/lib/bpf/bpf.c
tools/lib/bpf/bpf.h