Lines Matching refs:cgroup_fd

91 static int count_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type)  in count_attached_bpf_progs()  argument
96 ret = bpf_prog_query(cgroup_fd, type, query_flags, NULL, in count_attached_bpf_progs()
104 static int cgroup_has_attached_progs(int cgroup_fd) in cgroup_has_attached_progs() argument
110 int count = count_attached_bpf_progs(cgroup_fd, type); in cgroup_has_attached_progs()
123 static int show_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type, in show_attached_bpf_progs() argument
134 ret = bpf_prog_query(cgroup_fd, type, query_flags, &attach_flags, in show_attached_bpf_progs()
169 int cgroup_fd; in do_show() local
193 cgroup_fd = open(path, O_RDONLY); in do_show()
194 if (cgroup_fd < 0) { in do_show()
199 has_attached_progs = cgroup_has_attached_progs(cgroup_fd); in do_show()
222 if (show_attached_bpf_progs(cgroup_fd, type, 0) == 0) in do_show()
230 close(cgroup_fd); in do_show()
247 int cgroup_fd; in do_show_tree_fn() local
252 cgroup_fd = open(fpath, O_RDONLY); in do_show_tree_fn()
253 if (cgroup_fd < 0) { in do_show_tree_fn()
258 has_attached_progs = cgroup_has_attached_progs(cgroup_fd); in do_show_tree_fn()
262 close(cgroup_fd); in do_show_tree_fn()
265 close(cgroup_fd); in do_show_tree_fn()
279 show_attached_bpf_progs(cgroup_fd, type, ftw->level); in do_show_tree_fn()
293 close(cgroup_fd); in do_show_tree_fn()
383 int cgroup_fd, prog_fd; in do_attach() local
393 cgroup_fd = open(argv[0], O_RDONLY); in do_attach()
394 if (cgroup_fd < 0) { in do_attach()
422 if (bpf_prog_attach(prog_fd, cgroup_fd, attach_type, attach_flags)) { in do_attach()
435 close(cgroup_fd); in do_attach()
443 int prog_fd, cgroup_fd; in do_detach() local
451 cgroup_fd = open(argv[0], O_RDONLY); in do_detach()
452 if (cgroup_fd < 0) { in do_detach()
469 if (bpf_prog_detach2(prog_fd, cgroup_fd, attach_type)) { in do_detach()
482 close(cgroup_fd); in do_detach()