Lines Matching refs:cgroup_fd
90 static int count_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type) in count_attached_bpf_progs() argument
95 ret = bpf_prog_query(cgroup_fd, type, query_flags, NULL, in count_attached_bpf_progs()
103 static int cgroup_has_attached_progs(int cgroup_fd) in cgroup_has_attached_progs() argument
109 int count = count_attached_bpf_progs(cgroup_fd, type); in cgroup_has_attached_progs()
122 static int show_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type, in show_attached_bpf_progs() argument
133 ret = bpf_prog_query(cgroup_fd, type, query_flags, &attach_flags, in show_attached_bpf_progs()
168 int cgroup_fd; in do_show() local
192 cgroup_fd = open(path, O_RDONLY); in do_show()
193 if (cgroup_fd < 0) { in do_show()
198 has_attached_progs = cgroup_has_attached_progs(cgroup_fd); in do_show()
221 if (show_attached_bpf_progs(cgroup_fd, type, 0) == 0) in do_show()
229 close(cgroup_fd); in do_show()
246 int cgroup_fd; in do_show_tree_fn() local
251 cgroup_fd = open(fpath, O_RDONLY); in do_show_tree_fn()
252 if (cgroup_fd < 0) { in do_show_tree_fn()
257 has_attached_progs = cgroup_has_attached_progs(cgroup_fd); in do_show_tree_fn()
261 close(cgroup_fd); in do_show_tree_fn()
264 close(cgroup_fd); in do_show_tree_fn()
278 show_attached_bpf_progs(cgroup_fd, type, ftw->level); in do_show_tree_fn()
292 close(cgroup_fd); in do_show_tree_fn()
382 int cgroup_fd, prog_fd; in do_attach() local
392 cgroup_fd = open(argv[0], O_RDONLY); in do_attach()
393 if (cgroup_fd < 0) { in do_attach()
421 if (bpf_prog_attach(prog_fd, cgroup_fd, attach_type, attach_flags)) { in do_attach()
434 close(cgroup_fd); in do_attach()
442 int prog_fd, cgroup_fd; in do_detach() local
450 cgroup_fd = open(argv[0], O_RDONLY); in do_detach()
451 if (cgroup_fd < 0) { in do_detach()
468 if (bpf_prog_detach2(prog_fd, cgroup_fd, attach_type)) { in do_detach()
481 close(cgroup_fd); in do_detach()