Lines Matching refs:cgroup_fd
98 static int count_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type) in count_attached_bpf_progs() argument
103 ret = bpf_prog_query(cgroup_fd, type, 0, NULL, NULL, &prog_cnt); in count_attached_bpf_progs()
110 static int show_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type, in show_attached_bpf_progs() argument
121 ret = bpf_prog_query(cgroup_fd, type, 0, &attach_flags, prog_ids, in show_attached_bpf_progs()
154 int cgroup_fd; in do_show() local
165 cgroup_fd = open(argv[0], O_RDONLY); in do_show()
166 if (cgroup_fd < 0) { in do_show()
184 if (show_attached_bpf_progs(cgroup_fd, type, 0) == 0) in do_show()
191 close(cgroup_fd); in do_show()
208 int cgroup_fd; in do_show_tree_fn() local
213 cgroup_fd = open(fpath, O_RDONLY); in do_show_tree_fn()
214 if (cgroup_fd < 0) { in do_show_tree_fn()
220 int count = count_attached_bpf_progs(cgroup_fd, type); in do_show_tree_fn()
225 close(cgroup_fd); in do_show_tree_fn()
235 close(cgroup_fd); in do_show_tree_fn()
249 show_attached_bpf_progs(cgroup_fd, type, ftw->level); in do_show_tree_fn()
256 close(cgroup_fd); in do_show_tree_fn()
336 int cgroup_fd, prog_fd; in do_attach() local
346 cgroup_fd = open(argv[0], O_RDONLY); in do_attach()
347 if (cgroup_fd < 0) { in do_attach()
375 if (bpf_prog_attach(prog_fd, cgroup_fd, attach_type, attach_flags)) { in do_attach()
388 close(cgroup_fd); in do_attach()
396 int prog_fd, cgroup_fd; in do_detach() local
404 cgroup_fd = open(argv[0], O_RDONLY); in do_detach()
405 if (cgroup_fd < 0) { in do_detach()
422 if (bpf_prog_detach2(prog_fd, cgroup_fd, attach_type)) { in do_detach()
435 close(cgroup_fd); in do_detach()