Searched refs:cgroup_fd (Results 1 - 25 of 39) sorted by path

12

/linux-master/include/uapi/linux/
H A Dbpf.h128 /* At most one of cgroup_fd and cgroup_id can be non-zero. If
131 * specify cgroup_fd.
133 __u32 cgroup_fd; member in struct:bpf_iter_link_info::__anon2582
/linux-master/kernel/bpf/
H A Dcgroup_iter.c198 int fd = linfo->cgroup.cgroup_fd;
/linux-master/kernel/events/
H A Dcore.c11889 void *context, int cgroup_fd)
12029 if (pmu->task_ctx_nr == perf_invalid_context && (task || cgroup_fd != -1)) {
12040 if (cgroup_fd != -1) {
12041 err = perf_cgroup_connect(cgroup_fd, event, attr, group_leader);
12433 int cgroup_fd = -1; local
12523 cgroup_fd = pid;
12526 NULL, NULL, cgroup_fd);
11884 perf_event_alloc(struct perf_event_attr *attr, int cpu, struct task_struct *task, struct perf_event *group_leader, struct perf_event *parent_event, perf_overflow_handler_t overflow_handler, void *context, int cgroup_fd) argument
/linux-master/tools/bpf/bpftool/
H A Dcgroup.c171 static int count_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type) argument
176 ret = bpf_prog_query(cgroup_fd, type, query_flags, NULL,
184 static int cgroup_has_attached_progs(int cgroup_fd) argument
190 int count = count_attached_bpf_progs(cgroup_fd, type);
204 static int show_effective_bpf_progs(int cgroup_fd, enum bpf_attach_type type, argument
216 ret = bpf_prog_query_opts(cgroup_fd, type, &p);
229 static int show_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type, argument
245 ret = bpf_prog_query_opts(cgroup_fd, type, &p);
279 static int show_bpf_progs(int cgroup_fd, enum bpf_attach_type type, argument
283 show_effective_bpf_progs(cgroup_fd, typ
292 int cgroup_fd; local
373 int cgroup_fd; local
515 int cgroup_fd, prog_fd; local
575 int prog_fd, cgroup_fd; local
[all...]
/linux-master/tools/include/uapi/linux/
H A Dbpf.h128 /* At most one of cgroup_fd and cgroup_id can be non-zero. If
131 * specify cgroup_fd.
133 __u32 cgroup_fd; member in struct:bpf_iter_link_info::__anon3123
/linux-master/tools/lib/bpf/
H A Dlibbpf.c12446 bpf_program__attach_cgroup(const struct bpf_program *prog, int cgroup_fd) argument
12448 return bpf_program_attach_fd(prog, cgroup_fd, "cgroup", NULL);
H A Dlibbpf.h783 bpf_program__attach_cgroup(const struct bpf_program *prog, int cgroup_fd);
/linux-master/tools/testing/selftests/bpf/
H A Dget_cgroup_id_user.c53 int cgroup_fd, cgidmap_fd, pidmap_fd; local
65 cgroup_fd = cgroup_setup_and_join(TEST_CGROUP);
66 if (CHECK(cgroup_fd < 0, "cgroup_setup_and_join", "err %d errno %d\n", cgroup_fd, errno))
/linux-master/tools/testing/selftests/bpf/prog_tests/
H A Dbind_perm.c55 int cgroup_fd; local
60 cgroup_fd = test__join_cgroup("/bind_perm");
61 if (!ASSERT_GE(cgroup_fd, 0, "test__join_cgroup"))
68 skel->links.bind_v4_prog = bpf_program__attach_cgroup(skel->progs.bind_v4_prog, cgroup_fd);
72 skel->links.bind_v6_prog = bpf_program__attach_cgroup(skel->progs.bind_v6_prog, cgroup_fd);
92 close(cgroup_fd);
H A Dbtf_dump.c767 "(union bpf_iter_link_info){.map = (struct){.map_fd = (__u32)1,},.cgroup = (struct){.order = (enum bpf_cgroup_iter_order)BPF_CGROUP_ITER_SELF_ONLY,.cgroup_fd = (__u32)1,},.task = (struct){.tid = (__u32)1,.pid = (__u32)1,},}",
768 { .cgroup = { .order = 1, .cgroup_fd = 1, }});
H A Dcgroup_getset_retval.c19 static void test_setsockopt_set(int cgroup_fd, int sock_fd) argument
34 cgroup_fd);
55 static void test_setsockopt_set_and_get(int cgroup_fd, int sock_fd) argument
70 cgroup_fd);
74 cgroup_fd);
98 static void test_setsockopt_default_zero(int cgroup_fd, int sock_fd) argument
113 cgroup_fd);
134 static void test_setsockopt_default_zero_and_set(int cgroup_fd, int sock_fd) argument
150 cgroup_fd);
154 cgroup_fd);
178 test_setsockopt_override(int cgroup_fd, int sock_fd) argument
228 test_setsockopt_legacy_eperm(int cgroup_fd, int sock_fd) argument
273 test_setsockopt_legacy_no_override(int cgroup_fd, int sock_fd) argument
325 test_getsockopt_get(int cgroup_fd, int sock_fd) argument
367 test_getsockopt_override(int cgroup_fd, int sock_fd) argument
405 test_getsockopt_retval_sync(int cgroup_fd, int sock_fd) argument
473 test_exposed_hooks(int cgroup_fd, int sock_fd) argument
503 int cgroup_fd = -1; local
[all...]
H A Dcgroup_hierarchical_stats.c247 int cgroup_fd, const char *file_name)
256 * Create an iter link, parameterized by cgroup_fd. We only want to
259 linfo.cgroup.cgroup_fd = cgroup_fd;
246 setup_cgroup_iter(struct cgroup_hierarchical_stats *obj, int cgroup_fd, const char *file_name) argument
H A Dcgroup_iter.c51 static void read_from_cgroup_iter(struct bpf_program *prog, int cgroup_fd, argument
63 linfo.cgroup.cgroup_fd = cgroup_fd;
103 linfo.cgroup.cgroup_fd = (__u32)-1;
112 /* Specifying both cgroup_fd and cgroup_id is invalid. */
120 linfo.cgroup.cgroup_fd = (__u32)cg_fd[PARENT];
214 linfo.cgroup.cgroup_fd = cgrp_fd;
H A Dcgroup_tcp_skb.c16 static int install_filters(int cgroup_fd, argument
28 cgroup_fd);
33 cgroup_fd);
242 int cgroup_fd = -1; local
253 cgroup_fd = create_and_get_cgroup(CGROUP_TCP_SKB_PATH);
254 if (!ASSERT_GE(cgroup_fd, 0, "cgroup_fd"))
258 err = install_filters(cgroup_fd, &egress_link, &ingress_link,
279 err = install_filters(cgroup_fd, &egress_link, &ingress_link,
298 err = install_filters(cgroup_fd,
[all...]
H A Dcgroup_v1v2.c10 static int run_test(int cgroup_fd, int server_fd, bool classid) argument
24 cgroup_fd);
48 int server_fd, client_fd, cgroup_fd; local
64 cgroup_fd = test__join_cgroup("/connect_dropper");
65 if (!ASSERT_GE(cgroup_fd, 0, "cgroup_fd"))
69 close(cgroup_fd);
72 ASSERT_OK(run_test(cgroup_fd, server_fd, false), "cgroup-v2-only");
75 ASSERT_OK(run_test(cgroup_fd, server_fd, true), "cgroup-v1v2");
78 close(cgroup_fd);
[all...]
H A Dcgrp_local_storage.c37 static void test_tp_btf(int cgroup_fd) argument
50 err = bpf_map_update_elem(bpf_map__fd(skel->maps.map_b), &cgroup_fd, &val1, BPF_ANY);
55 err = bpf_map_lookup_elem(bpf_map__fd(skel->maps.map_b), &cgroup_fd, &val2);
62 err = bpf_map_delete_elem(bpf_map__fd(skel->maps.map_b), &cgroup_fd);
85 static void test_attach_cgroup(int cgroup_fd) argument
99 skel->progs.set_cookie, cgroup_fd);
104 skel->progs.update_cookie_sockops, cgroup_fd);
122 &cgroup_fd, &val);
141 static void test_recursion(int cgroup_fd) argument
174 static void test_cgroup_iter_sleepable(int cgroup_fd, __u6 argument
284 int cgroup_fd; local
[all...]
H A Dconnect_force_port.c49 static int run_test(int cgroup_fd, int server_fd, int family, int type) argument
78 err = bpf_prog_attach(bpf_program__fd(prog), cgroup_fd, v4 ?
94 err = bpf_prog_attach(bpf_program__fd(prog), cgroup_fd, v4 ?
110 err = bpf_prog_attach(bpf_program__fd(prog), cgroup_fd, v4 ?
135 int server_fd, cgroup_fd; local
137 cgroup_fd = test__join_cgroup("/connect_force_port");
138 if (CHECK_FAIL(cgroup_fd < 0))
144 CHECK_FAIL(run_test(cgroup_fd, server_fd, AF_INET, SOCK_STREAM));
150 CHECK_FAIL(run_test(cgroup_fd, server_fd, AF_INET6, SOCK_STREAM));
156 CHECK_FAIL(run_test(cgroup_fd, server_f
[all...]
H A Dconnect_ping.c20 static void subtest(int cgroup_fd, struct connect_ping *skel, argument
99 int cgroup_fd; local
126 cgroup_fd = test__join_cgroup("/connect_ping");
127 if (!ASSERT_GE(cgroup_fd, 0, "cg-create"))
134 bpf_program__attach_cgroup(skel->progs.connect_v4_prog, cgroup_fd);
138 bpf_program__attach_cgroup(skel->progs.connect_v6_prog, cgroup_fd);
147 subtest(cgroup_fd, skel, AF_INET, 0);
154 subtest(cgroup_fd, skel, AF_INET, 1);
161 subtest(cgroup_fd, skel, AF_INET6, 0);
168 subtest(cgroup_fd, ske
[all...]
H A Dfexit_bpf2bpf.c484 int cgroup_fd = -1; local
488 cgroup_fd = test__join_cgroup("/fentry_to_cgroup_bpf");
489 if (!ASSERT_GE(cgroup_fd, 0, "cgroup_fd"))
496 skel->links.bind_v4_prog = bpf_program__attach_cgroup(skel->progs.bind_v4_prog, cgroup_fd);
520 if (cgroup_fd >= 0)
521 close(cgroup_fd);
H A Dload_bytes_relative.c12 int server_fd, cgroup_fd, prog_fd, map_fd, client_fd; local
22 cgroup_fd = test__join_cgroup("/load_bytes_relative");
23 if (CHECK_FAIL(cgroup_fd < 0))
47 err = bpf_prog_attach(prog_fd, cgroup_fd, BPF_CGROUP_INET_EGRESS,
70 close(cgroup_fd);
H A Dlsm_cgroup.c19 static __u32 query_prog_cnt(int cgroup_fd, const char *attach_func) argument
25 ASSERT_OK(bpf_prog_query_opts(cgroup_fd, BPF_LSM_CGROUP, &p), "prog_query");
41 ASSERT_OK(bpf_prog_query_opts(cgroup_fd, BPF_LSM_CGROUP, &p), "prog_query");
69 int cgroup_fd = -1, cgroup_fd2 = -1, cgroup_fd3 = -1; local
91 cgroup_fd = test__join_cgroup("/sock_policy");
92 if (!ASSERT_GE(cgroup_fd, 0, "join_cgroup"))
106 ASSERT_EQ(query_prog_cnt(cgroup_fd, "bpf_lsm_sk_alloc_security"), 0, "prog count");
107 ASSERT_EQ(query_prog_cnt(cgroup_fd, NULL), 0, "total prog count");
108 err = bpf_prog_attach(alloc_prog_fd, cgroup_fd, BPF_LSM_CGROUP, 0);
115 ASSERT_EQ(query_prog_cnt(cgroup_fd, "bpf_lsm_sk_alloc_securit
[all...]
H A Dmptcp.c156 static int run_test(int cgroup_fd, int server_fd, bool is_mptcp) argument
171 err = bpf_prog_attach(prog_fd, cgroup_fd, BPF_CGROUP_SOCK_OPS, 0);
194 int server_fd, cgroup_fd; local
196 cgroup_fd = test__join_cgroup("/mptcp");
197 if (!ASSERT_GE(cgroup_fd, 0, "test__join_cgroup"))
209 ASSERT_OK(run_test(cgroup_fd, server_fd, false), "run_test tcp");
219 ASSERT_OK(run_test(cgroup_fd, server_fd, true), "run_test mptcp");
225 close(cgroup_fd);
267 static int run_mptcpify(int cgroup_fd) argument
308 int cgroup_fd; local
[all...]
H A Dnetns_cookie.c15 int server_fd = -1, client_fd = -1, cgroup_fd = -1; local
26 cgroup_fd = test__join_cgroup("/netns_cookie");
27 if (CHECK(cgroup_fd < 0, "join_cgroup", "cgroup creation failed\n"))
31 skel->progs.get_netns_cookie_sockops, cgroup_fd);
77 if (cgroup_fd != -1)
78 close(cgroup_fd);
H A Dpercpu_alloc.c79 int err, cgroup_fd, prog_fd; local
82 cgroup_fd = test__join_cgroup("/percpu_alloc");
83 if (!ASSERT_GE(cgroup_fd, 0, "join_cgroup /percpu_alloc"))
111 close(cgroup_fd);
H A Drcu_read_lock.c137 int cgroup_fd; local
139 cgroup_fd = test__join_cgroup("/rcu_read_lock");
140 if (!ASSERT_GE(cgroup_fd, 0, "join_cgroup /rcu_read_lock"))
152 close(cgroup_fd);

Completed in 408 milliseconds

12