Lines Matching refs:cgroup_fd
203 static int count_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type) in count_attached_bpf_progs() argument
208 ret = bpf_prog_query(cgroup_fd, type, query_flags, NULL, in count_attached_bpf_progs()
216 static int cgroup_has_attached_progs(int cgroup_fd) in cgroup_has_attached_progs() argument
222 int count = count_attached_bpf_progs(cgroup_fd, cgroup_attach_types[i]); in cgroup_has_attached_progs()
236 static int show_effective_bpf_progs(int cgroup_fd, enum bpf_attach_type type, in show_effective_bpf_progs() argument
248 ret = bpf_prog_query_opts(cgroup_fd, type, &p); in show_effective_bpf_progs()
261 static int show_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type, in show_attached_bpf_progs() argument
277 ret = bpf_prog_query_opts(cgroup_fd, type, &p); in show_attached_bpf_progs()
311 static int show_bpf_progs(int cgroup_fd, enum bpf_attach_type type, in show_bpf_progs() argument
315 show_effective_bpf_progs(cgroup_fd, type, level) : in show_bpf_progs()
316 show_attached_bpf_progs(cgroup_fd, type, level); in show_bpf_progs()
324 int cgroup_fd; in do_show() local
348 cgroup_fd = open(path, O_RDONLY); in do_show()
349 if (cgroup_fd < 0) { in do_show()
354 has_attached_progs = cgroup_has_attached_progs(cgroup_fd); in do_show()
380 if (show_bpf_progs(cgroup_fd, type, 0) == 0) in do_show()
388 close(cgroup_fd); in do_show()
405 int cgroup_fd; in do_show_tree_fn() local
410 cgroup_fd = open(fpath, O_RDONLY); in do_show_tree_fn()
411 if (cgroup_fd < 0) { in do_show_tree_fn()
416 has_attached_progs = cgroup_has_attached_progs(cgroup_fd); in do_show_tree_fn()
420 close(cgroup_fd); in do_show_tree_fn()
423 close(cgroup_fd); in do_show_tree_fn()
438 show_bpf_progs(cgroup_fd, type, ftw->level); in do_show_tree_fn()
452 close(cgroup_fd); in do_show_tree_fn()
547 int cgroup_fd, prog_fd; in do_attach() local
557 cgroup_fd = open(argv[0], O_RDONLY); in do_attach()
558 if (cgroup_fd < 0) { in do_attach()
586 if (bpf_prog_attach(prog_fd, cgroup_fd, attach_type, attach_flags)) { in do_attach()
599 close(cgroup_fd); in do_attach()
607 int prog_fd, cgroup_fd; in do_detach() local
615 cgroup_fd = open(argv[0], O_RDONLY); in do_detach()
616 if (cgroup_fd < 0) { in do_detach()
633 if (bpf_prog_detach2(prog_fd, cgroup_fd, attach_type)) { in do_detach()
646 close(cgroup_fd); in do_detach()