| /tools/testing/selftests/bpf/prog_tests/ |
| A D | perf_link.c | 35 int pfd = -1, link_fd = -1, err; in serial_test_perf_link() local 56 link_fd = bpf_link_create(bpf_program__fd(skel->progs.handler), pfd, in serial_test_perf_link() 58 if (!ASSERT_GE(link_fd, 0, "link_fd")) in serial_test_perf_link() 62 err = bpf_link_get_info_by_fd(link_fd, &info, &info_len); in serial_test_perf_link() 83 close(link_fd); in serial_test_perf_link() 84 link_fd = -1; in serial_test_perf_link() 96 if (link_fd >= 0) in serial_test_perf_link() 97 close(link_fd); in serial_test_perf_link()
|
| A D | fexit_stress.c | 9 int *fd, *fexit_fd, *link_fd; in serial_test_fexit_stress() local 18 link_fd = fd + bpf_max_tramp_links; in serial_test_fexit_stress() 44 link_fd[i] = bpf_link_create(fexit_fd[i], 0, BPF_TRACE_FEXIT, NULL); in serial_test_fexit_stress() 45 if (!ASSERT_GE(link_fd[i], 0, "fexit attach")) in serial_test_fexit_stress() 54 if (link_fd[i] > 0) in serial_test_fexit_stress() 55 close(link_fd[i]); in serial_test_fexit_stress()
|
| A D | core_kern.c | 10 int link_fd; in test_core_kern_lskel() local 16 link_fd = core_kern_lskel__core_relo_proto__attach(skel); in test_core_kern_lskel() 17 if (!ASSERT_GT(link_fd, 0, "attach(core_relo_proto)")) in test_core_kern_lskel()
|
| A D | uprobe_multi_test.c | 377 int prog_fd, link_fd = -1; in test_attach_api_fails() local 391 if (!ASSERT_ERR(link_fd, "link_fd")) in test_attach_api_fails() 403 if (!ASSERT_ERR(link_fd, "link_fd")) in test_attach_api_fails() 415 if (!ASSERT_ERR(link_fd, "link_fd")) in test_attach_api_fails() 427 if (!ASSERT_ERR(link_fd, "link_fd")) in test_attach_api_fails() 440 if (!ASSERT_ERR(link_fd, "link_fd")) in test_attach_api_fails() 453 if (!ASSERT_ERR(link_fd, "link_fd")) in test_attach_api_fails() 538 if (link_fd >= 0) in test_attach_api_fails() 539 close(link_fd); in test_attach_api_fails() 602 int prog_fd, link_fd, err; in attach_uprobe_fail_refctr() local [all …]
|
| A D | module_fentry_shadow.c | 62 int link_fd[2] = {}; in test_module_fentry_shadow() local 115 link_fd[i] = bpf_link_create(prog_fd[i], 0, BPF_TRACE_FENTRY, NULL); in test_module_fentry_shadow() 116 if (!ASSERT_GE(link_fd[i], 0, "bpf_link_create")) in test_module_fentry_shadow() 131 if (link_fd[i] > 0) in test_module_fentry_shadow() 132 close(link_fd[i]); in test_module_fentry_shadow()
|
| A D | fill_link_info.c | 165 int link_fd, err; in test_kprobe_fill_link_info() local 171 link_fd = bpf_link__fd(link); in test_kprobe_fill_link_info() 194 int link_fd, err; in test_tp_fill_link_info() local 200 link_fd = bpf_link__fd(link); in test_tp_fill_link_info() 212 int link_fd, err, pfd; in test_event_fill_link_info() local 230 link_fd = bpf_link__fd(link); in test_event_fill_link_info() 251 int link_fd, err; in test_uprobe_fill_link_info() local 266 link_fd = bpf_link__fd(link); in test_uprobe_fill_link_info() 379 int link_fd, err; in test_kprobe_multi_fill_link_info() local 389 link_fd = bpf_link__fd(link); in test_kprobe_multi_fill_link_info() [all …]
|
| A D | bpf_cookie.c | 601 int prog_fd, link_fd = -1; in tp_btf_subtest() local 621 close(link_fd); /* detach */ in tp_btf_subtest() 622 link_fd = -1; in tp_btf_subtest() 635 close(link_fd); /* detach */ in tp_btf_subtest() 636 link_fd = -1; in tp_btf_subtest() 655 if (link_fd >= 0) in tp_btf_subtest() 656 close(link_fd); in tp_btf_subtest() 705 close(link_fd); /* detach */ in raw_tp_subtest() 706 link_fd = -1; in raw_tp_subtest() 726 if (link_fd >= 0) in raw_tp_subtest() [all …]
|
| A D | fentry_test.c | 10 int link_fd; in fentry_test_common() local 19 link_fd = fentry_test_lskel__test1__attach(fentry_skel); in fentry_test_common() 20 if (!ASSERT_LT(link_fd, 0, "fentry_attach_link")) in fentry_test_common()
|
| A D | fexit_test.c | 10 int link_fd; in fexit_test_common() local 19 link_fd = fexit_test_lskel__test1__attach(fexit_skel); in fexit_test_common() 20 if (!ASSERT_LT(link_fd, 0, "fexit_attach_link")) in fexit_test_common()
|
| A D | bpf_obj_id.c | 250 int link_fd, cmp_res; in serial_test_bpf_obj_id() local 255 link_fd = bpf_link_get_fd_by_id(next_id); in serial_test_bpf_obj_id() 256 if (link_fd < 0 && errno == ENOENT) in serial_test_bpf_obj_id() 259 if (!ASSERT_GE(link_fd, 0, "bpf_link_get_fd_by_id")) in serial_test_bpf_obj_id() 271 err = bpf_link_get_info_by_fd(link_fd, &link_info, &info_len); in serial_test_bpf_obj_id() 278 close(link_fd); in serial_test_bpf_obj_id()
|
| A D | recursive_attach.c | 118 int err, link_fd, tgt_prog_fd; in test_fentry_attach_btf_presence() local 139 link_fd = bpf_link_create(tgt_prog_fd, 0, BPF_TRACE_FENTRY, NULL); in test_fentry_attach_btf_presence() 140 if (!ASSERT_GE(link_fd, 0, "link_fd")) in test_fentry_attach_btf_presence()
|
| A D | unpriv_bpf_disabled.c | 65 int i, nr_cpus, link_fd = -1; in test_unpriv_bpf_disabled_positive() local 129 link_fd = bpf_link_create(bpf_program__fd(skel->progs.handle_perf_event), perf_fd, in test_unpriv_bpf_disabled_positive() 131 ASSERT_GT(link_fd, 0, "link_create"); in test_unpriv_bpf_disabled_positive() 134 if (link_fd) in test_unpriv_bpf_disabled_positive() 135 close(link_fd); in test_unpriv_bpf_disabled_positive()
|
| A D | sockopt.c | 1075 int sock_fd, err, prog_fd, link_fd = -1; in run_test() local 1093 link_fd = err; in run_test() 1188 if (link_fd >= 0) in run_test() 1189 close(link_fd); in run_test()
|
| A D | sockmap_listen.c | 774 int link_fd; in test_msg_redir_to_connected_with_link() local 776 link_fd = bpf_link_create(prog_msg_verdict, sock_map, BPF_SK_MSG_VERDICT, NULL); in test_msg_redir_to_connected_with_link() 777 if (!ASSERT_GE(link_fd, 0, "bpf_link_create")) in test_msg_redir_to_connected_with_link() 782 close(link_fd); in test_msg_redir_to_connected_with_link()
|
| /tools/lib/bpf/ |
| A D | features.c | 343 int prog_fd, link_fd, err; in probe_perf_link() local 356 if (link_fd >= 0) in probe_perf_link() 357 close(link_fd); in probe_perf_link() 360 return link_fd < 0 && err == -EBADF; in probe_perf_link() 375 int prog_fd, link_fd, err; in probe_uprobe_multi_link() local 391 if (link_fd >= 0 || err != -EBADF) { in probe_uprobe_multi_link() 392 if (link_fd >= 0) in probe_uprobe_multi_link() 393 close(link_fd); in probe_uprobe_multi_link() 421 if (link_fd >= 0) in probe_uprobe_multi_link() 422 close(link_fd); in probe_uprobe_multi_link() [all …]
|
| A D | bpf.h | 455 LIBBPF_API int bpf_link_detach(int link_fd); 465 LIBBPF_API int bpf_link_update(int link_fd, int new_prog_fd, 468 LIBBPF_API int bpf_iter_create(int link_fd); 592 LIBBPF_API int bpf_link_get_info_by_fd(int link_fd, struct bpf_link_info *info, __u32 *info_len);
|
| A D | bpf.c | 924 int bpf_link_detach(int link_fd) in bpf_link_detach() argument 931 attr.link_detach.link_fd = link_fd; in bpf_link_detach() 937 int bpf_link_update(int link_fd, int new_prog_fd, in bpf_link_update() argument 951 attr.link_update.link_fd = link_fd; in bpf_link_update() 963 int bpf_iter_create(int link_fd) in bpf_iter_create() argument 970 attr.iter_create.link_fd = link_fd; in bpf_iter_create() 1220 int bpf_link_get_info_by_fd(int link_fd, struct bpf_link_info *info, __u32 *info_len) in bpf_link_get_info_by_fd() argument 1222 return bpf_obj_get_info_by_fd(link_fd, info, info_len); in bpf_link_get_info_by_fd()
|
| A D | libbpf.c | 10943 if (link_fd < 0) { in bpf_program__attach_perf_event_opts() 10980 if (link_fd >= 0) in bpf_program__attach_perf_event_opts() 10981 close(link_fd); in bpf_program__attach_perf_event_opts() 11734 if (link_fd < 0) { in bpf_program__attach_kprobe_multi_opts() 12220 if (link_fd < 0) { in bpf_program__attach_uprobe_multi() 12822 if (link_fd < 0) { in bpf_program_attach_fd() 12823 link_fd = -errno; in bpf_program_attach_fd() 13020 if (link_fd < 0) { in bpf_program__attach_iter() 13021 link_fd = -errno; in bpf_program__attach_iter() 13065 if (link_fd < 0) { in bpf_program__attach_netfilter() [all …]
|
| /tools/testing/selftests/hid/ |
| A D | hid_bpf.c | 270 int err, link_fd; in TEST_F() local 277 link_fd = bpf_link__fd(link); in TEST_F() 278 ASSERT_GE(link_fd, 0) TH_LOG("HID-BPF link FD not valid"); in TEST_F() 297 err = bpf_obj_pin(link_fd, PIN_PATH); in TEST_F()
|
| /tools/perf/util/ |
| A D | bpf_counter.c | 403 int link_fd, diff_map_fd, err; in bperf_reload_leader_program() local 425 link_fd = bpf_link__fd(link); in bperf_reload_leader_program() 427 entry->link_id = bpf_link_get_id(link_fd); in bperf_reload_leader_program()
|
| /tools/include/uapi/linux/ |
| A D | bpf.h | 1826 __u32 link_fd; /* link fd */ member 1847 __u32 link_fd; member 1855 __u32 link_fd; member
|