aboutsummaryrefslogtreecommitdiffstats
path: root/samples/bpf/task_fd_query_user.c
diff options
context:
space:
mode:
authorDaniel T. Lee <[email protected]>2020-11-24 09:03:05 +0000
committerAndrii Nakryiko <[email protected]>2020-11-27 03:33:35 +0000
commitd89af13c92056c46dfc4bcb3d90efe88937c3381 (patch)
treec4563673da85cde8dde280a53c94fae4591c8fde /samples/bpf/task_fd_query_user.c
parentsamples: bpf: Refactor hbm program with libbpf (diff)
downloadkernel-d89af13c92056c46dfc4bcb3d90efe88937c3381.tar.gz
kernel-d89af13c92056c46dfc4bcb3d90efe88937c3381.zip
samples: bpf: Refactor test_cgrp2_sock2 program with libbpf
This commit refactors the existing cgroup program with libbpf bpf loader. The original test_cgrp2_sock2 has keeped the bpf program attached to the cgroup hierarchy even after the exit of user program. To implement the same functionality with libbpf, this commit uses the BPF_LINK_PINNING to pin the link attachment even after it is closed. Since this uses LINK instead of ATTACH, detach of bpf program from cgroup with 'test_cgrp2_sock' is not used anymore. The code to mount the bpf was added to the .sh file in case the bpff was not mounted on /sys/fs/bpf. Additionally, to fix the problem that shell script cannot find the binary object from the current path, relative path './' has been added in front of binary. Fixes: 554ae6e792ef3 ("samples/bpf: add userspace example for prohibiting sockets") Signed-off-by: Daniel T. Lee <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'samples/bpf/task_fd_query_user.c')
0 files changed, 0 insertions, 0 deletions