/linux-master/tools/testing/selftests/bpf/ |
H A D | xdp_redirect_multi.c | 85 int prog_fd, group_all, mac_map; local 153 prog_fd = bpf_program__fd(bpf_object__next_program(obj, NULL)); 174 prog_fd = bpf_program__fd(ingress_prog); 176 if (prog_fd < 0 || egress_prog_fd < 0) { 211 /* bind prog_fd to each interface */ 212 ret = bpf_xdp_attach(ifindex, prog_fd, xdp_flags, NULL);
|
H A D | test_cgroup_storage.c | 41 int map_fd, percpu_map_fd, prog_fd, cgroup_fd; local 73 prog_fd = bpf_test_load_program(BPF_PROG_TYPE_CGROUP_SKB, 76 if (prog_fd < 0) { 84 if (bpf_prog_attach(prog_fd, cgroup_fd, BPF_CGROUP_INET_EGRESS, 0)) {
|
H A D | test_tcpnotify_user.c | 77 int prog_fd, rv, cg_fd = -1; local 94 if (bpf_prog_test_load(file, BPF_PROG_TYPE_SOCK_OPS, &obj, &prog_fd)) { 99 rv = bpf_prog_attach(prog_fd, cg_fd, BPF_CGROUP_SOCK_OPS, 0);
|
H A D | get_cgroup_id_user.c | 52 int err, bytes, efd, prog_fd, pmu_fd; local 72 err = bpf_prog_test_load(file, BPF_PROG_TYPE_TRACEPOINT, &obj, &prog_fd); 124 err = ioctl(pmu_fd, PERF_EVENT_IOC_SET_BPF, prog_fd);
|
/linux-master/tools/lib/bpf/ |
H A D | features.c | 347 int prog_fd, link_fd, err; local 349 prog_fd = bpf_prog_load(BPF_PROG_TYPE_TRACEPOINT, NULL, "GPL", 351 if (prog_fd < 0) 357 link_fd = bpf_link_create(prog_fd, -1, BPF_PERF_EVENT, NULL); 362 close(prog_fd); 379 int prog_fd, link_fd, err; local 382 prog_fd = bpf_prog_load(BPF_PROG_TYPE_KPROBE, NULL, "GPL", 384 if (prog_fd < 0) 392 link_fd = bpf_link_create(prog_fd, -1, BPF_TRACE_UPROBE_MULTI, &link_opts); 397 close(prog_fd); 466 int prog_fd, btf_fd, insn_cnt = ARRAY_SIZE(insns); local [all...] |
H A D | bpf.h | 330 LIBBPF_API int bpf_prog_attach(int prog_fd, int attachable_fd, 333 LIBBPF_API int bpf_prog_detach2(int prog_fd, int attachable_fd, 362 * *prog_fd* to a *target* which can represent a file descriptor or netdevice 365 * @param prog_fd BPF program file descriptor 372 LIBBPF_API int bpf_prog_attach_opts(int prog_fd, int target, 378 * *prog_fd* from a *target* which can represent a file descriptor or netdevice 381 * @param prog_fd BPF program file descriptor 388 LIBBPF_API int bpf_prog_detach_opts(int prog_fd, int target, 443 LIBBPF_API int bpf_link_create(int prog_fd, int target_fd, 463 int prog_fd; member in struct:bpf_prog_test_run_attr [all...] |
/linux-master/tools/testing/selftests/bpf/prog_tests/ |
H A D | unpriv_bpf_disabled.c | 59 __u32 prog_id, int prog_fd, int perf_fd, 117 vals[0] = prog_fd; 142 __u32 prog_id, int prog_fd, int perf_fd, 203 ASSERT_EQ(bpf_prog_query(prog_fd, BPF_TRACE_FENTRY, 0, &attach_flags, prog_ids, 236 int prog_fd, perf_fd = -1, i, ret; local 275 prog_fd = bpf_program__fd(skel->progs.sys_nanosleep_enter); 276 ASSERT_OK(bpf_prog_get_info_by_fd(prog_fd, &prog_info, &prog_info_len), 297 test_unpriv_bpf_disabled_positive(skel, prog_id, prog_fd, perf_fd, map_paths, 301 test_unpriv_bpf_disabled_negative(skel, prog_id, prog_fd, perf_fd, map_paths, 58 test_unpriv_bpf_disabled_positive(struct test_unpriv_bpf_disabled *skel, __u32 prog_id, int prog_fd, int perf_fd, char **map_paths, int *map_fds) argument 141 test_unpriv_bpf_disabled_negative(struct test_unpriv_bpf_disabled *skel, __u32 prog_id, int prog_fd, int perf_fd, char **map_paths, int *map_fds) argument
|
H A D | tcp_rtt.c | 94 int prog_fd; local 103 prog_fd = bpf_program__fd(skel->progs._sockops); 105 err = bpf_prog_attach(prog_fd, cgroup_fd, BPF_CGROUP_SOCK_OPS, 0);
|
H A D | kfree_skb.c | 66 int err, prog_fd; local 73 &obj, &prog_fd); 103 err = bpf_prog_test_run_opts(prog_fd, &topts);
|
H A D | metadata.c | 16 static int prog_holds_map(int prog_fd, int map_fd) argument 33 ret = bpf_prog_get_info_by_fd(prog_fd, &prog_info, &prog_info_len); 47 ret = bpf_prog_get_info_by_fd(prog_fd, &prog_info, &prog_info_len);
|
H A D | tc_bpf.c | 14 DECLARE_LIBBPF_OPTS(bpf_tc_opts, opts_f, .prog_fd = __fd); \ 16 DECLARE_LIBBPF_OPTS(bpf_tc_opts, opts_hf, .handle = 1, .prog_fd = __fd); \ 17 DECLARE_LIBBPF_OPTS(bpf_tc_opts, opts_pf, .priority = 1, .prog_fd = __fd); \ 18 DECLARE_LIBBPF_OPTS(bpf_tc_opts, opts_hpf, .handle = 1, .priority = 1, .prog_fd = __fd); \ 22 DECLARE_LIBBPF_OPTS(bpf_tc_opts, opts_hpfi, .handle = 1, .priority = 1, .prog_fd = __fd, \ 28 DECLARE_LIBBPF_OPTS(bpf_tc_opts, opts, .handle = 1, .priority = 1, .prog_fd = fd); 52 opts.flags = opts.prog_fd = opts.prog_id = 0; 63 opts.flags = opts.prog_fd = opts.prog_id = 0; 71 DECLARE_LIBBPF_OPTS(bpf_tc_opts, attach_opts, .handle = 1, .priority = 1, .prog_fd = fd); 218 if (!ASSERT_EQ(ret, -EINVAL, "bpf_tc_detach invalid prog_fd se [all...] |
H A D | test_ldsx_insn.c | 104 int err, prog_fd; local 121 prog_fd = bpf_program__fd(skel->progs._tc); 122 err = bpf_prog_test_run_opts(prog_fd, &topts);
|
H A D | map_ptr.c | 35 err = bpf_prog_test_run_opts(skel->progs.cg_skb.prog_fd, &topts);
|
H A D | tp_attach_query.c | 7 int i, j, bytes, efd, err, prog_fd[num_progs], pmu_fd[num_progs]; local 44 &prog_fd[i]); 53 err = bpf_prog_get_info_by_fd(prog_fd[i], &prog_info, 82 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_SET_BPF, prog_fd[i]);
|
H A D | flow_dissector.c | 511 int i, err, map_fd, prog_fd; local 526 prog_fd = bpf_program__fd(prog); 527 if (prog_fd < 0) 530 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); 580 int err, prog_fd; local 582 prog_fd = bpf_program__fd(skel->progs._dissect); 583 if (CHECK(prog_fd < 0, "bpf_program__fd", "err %d\n", prog_fd)) 586 err = bpf_prog_attach(prog_fd, 0, BPF_FLOW_DISSECTOR, 0); 592 err = bpf_prog_detach2(prog_fd, 619 int i, err, prog_fd, keys_fd = -1, tap_fd; local [all...] |
H A D | bpf_obj_id.c | 157 int prog_fd, cmp_res; local 161 prog_fd = bpf_prog_get_fd_by_id(next_id); 162 if (prog_fd < 0 && errno == ENOENT) 165 if (!ASSERT_GE(prog_fd, 0, "bpf_prog_get_fd_by_id")) 182 err = bpf_prog_get_info_by_fd(prog_fd, &prog_info, &info_len); 192 err = bpf_prog_get_info_by_fd(prog_fd, &prog_info, &info_len); 201 close(prog_fd);
|
H A D | assign_reuse.c | 16 static int attach_reuseport(int sock_fd, int prog_fd) argument 19 &prog_fd, sizeof(prog_fd)); 136 tc_opts.prog_fd = fd_tc; 162 tc_opts.flags = tc_opts.prog_fd = tc_opts.prog_id = 0;
|
H A D | global_data.c | 136 int err, prog_fd; local 143 err = bpf_prog_test_load(file, BPF_PROG_TYPE_SCHED_CLS, &obj, &prog_fd); 147 err = bpf_prog_test_run_opts(prog_fd, &topts);
|
H A D | get_stack_raw_tp.c | 90 int i, err, prog_fd, exp_cnt = MAX_CNT_RAWTP; local 99 err = bpf_prog_test_load(file_err, BPF_PROG_TYPE_RAW_TRACEPOINT, &obj, &prog_fd); 103 err = bpf_prog_test_load(file, BPF_PROG_TYPE_RAW_TRACEPOINT, &obj, &prog_fd);
|
H A D | kprobe_multi_test.c | 13 int err, prog_fd; local 15 prog_fd = bpf_program__fd(skel->progs.trigger); 16 err = bpf_prog_test_run_opts(prog_fd, &topts); 63 int prog_fd, link1_fd = -1, link2_fd = -1; local 71 prog_fd = bpf_program__fd(skel->progs.test_kprobe); 72 link1_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_KPROBE_MULTI, opts); 77 prog_fd = bpf_program__fd(skel->progs.test_kretprobe); 78 link2_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_KPROBE_MULTI, opts);
|
/linux-master/samples/bpf/ |
H A D | test_cgrp2_attach.c | 94 int prog_fd, map_fd, ret, key; local 105 prog_fd = prog_load(map_fd, verdict); 108 if (prog_fd < 0) { 113 ret = bpf_prog_attach(prog_fd, cg_fd, type, 0);
|
H A D | xdp_adjust_tail_user.c | 89 int i, prog_fd, map_fd, opt; local 160 prog_fd = bpf_program__fd(prog); 182 if (bpf_xdp_attach(ifindex, prog_fd, xdp_flags, NULL) < 0) { 187 err = bpf_prog_get_info_by_fd(prog_fd, &info, &info_len);
|
H A D | cookie_uid_helper_example.c | 64 static int map_fd, prog_fd; variable 165 prog_fd = bpf_prog_load(BPF_PROG_TYPE_SOCKET_FILTER, NULL, "GPL", 167 if (prog_fd < 0) 176 if (bpf_obj_pin(prog_fd, file)) 329 close(prog_fd);
|
/linux-master/tools/perf/util/ |
H A D | bpf_counter_cgroup.c | 53 int prog_fd, err; local 158 prog_fd = bpf_program__fd(skel->progs.trigger_read); 159 err = bperf_trigger_reading(prog_fd, 0); 203 int prog_fd = bpf_program__fd(skel->progs.trigger_read); local 206 bperf_trigger_reading(prog_fd, cpu.cpu);
|
H A D | bpf_counter.h | 123 static inline int bperf_trigger_reading(int prog_fd, int cpu) argument 133 return bpf_prog_test_run_opts(prog_fd, &opts);
|