| /linux/tools/testing/selftests/bpf/prog_tests/ |
| H A D | uprobe_multi_test.c | 381 int prog_fd, link_fd = -1; in test_attach_api_fails() local 394 link_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_UPROBE_MULTI, &opts); in test_attach_api_fails() 395 if (!ASSERT_ERR(link_fd, "link_fd")) in test_attach_api_fails() 397 if (!ASSERT_EQ(link_fd, -E2BIG, "big cnt")) in test_attach_api_fails() 406 link_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_UPROBE_MULTI, &opts); in test_attach_api_fails() 407 if (!ASSERT_ERR(link_fd, "link_fd")) in test_attach_api_fails() 409 if (!ASSERT_EQ(link_fd, -EINVAL, "cnt_is_zero")) in test_attach_api_fails() 418 link_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_UPROBE_MULTI, &opts); in test_attach_api_fails() 419 if (!ASSERT_ERR(link_fd, "link_fd")) in test_attach_api_fails() 421 if (!ASSERT_EQ(link_fd, -EINVAL, "offset_is_negative")) in test_attach_api_fails() [all …]
|
| H 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()
|
| H A D | fill_link_info.c | 165 int link_fd, err; in test_kprobe_fill_link_info() 171 link_fd = bpf_link__fd(link); in test_kprobe_fill_link_info() 180 err = verify_perf_link_info(link_fd, type, kprobe_addr, 0, entry_offset); in test_kprobe_fill_link_info() 183 kprobe_fill_invalid_user_buffer(link_fd); in test_kprobe_fill_link_info() 194 int link_fd, err; in test_tp_fill_link_info() 200 link_fd = bpf_link__fd(link); in test_tp_fill_link_info() 201 err = verify_perf_link_info(link_fd, BPF_PERF_EVENT_TRACEPOINT, 0, 0, 0); in test_tp_fill_link_info() 212 int link_fd, err, pfd; in test_event_fill_link_info() 230 link_fd = bpf_link__fd(link); in test_event_fill_link_info() 231 err = verify_perf_link_info(link_fd, BPF_PERF_EVENT_EVEN in test_event_fill_link_info() 163 int link_fd, err; test_kprobe_fill_link_info() local 192 int link_fd, err; test_tp_fill_link_info() local 210 int link_fd, err, pfd; test_event_fill_link_info() local 245 int link_fd, err; test_uprobe_fill_link_info() local 365 int link_fd, err; test_kprobe_multi_fill_link_info() local 550 int link_fd, err; test_uprobe_multi_fill_link_info() local [all...] |
| H A D | bpf_cookie.c | 600 int prog_fd, link_fd = -1; in tp_btf_subtest() 615 link_fd = bpf_raw_tracepoint_open_opts(prog_fd, &raw_tp_opts); in tp_btf_subtest() 616 if (!ASSERT_GE(link_fd, 0, "bpf_raw_tracepoint_open_opts")) in tp_btf_subtest() 620 close(link_fd); /* detach */ in tp_btf_subtest() 621 link_fd = -1; in tp_btf_subtest() 629 link_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_RAW_TP, &link_opts); in tp_btf_subtest() 630 if (!ASSERT_GE(link_fd, 0, "bpf_link_create")) in tp_btf_subtest() 634 close(link_fd); /* detach */ in tp_btf_subtest() 635 link_fd = -1; in tp_btf_subtest() 654 if (link_fd > in tp_btf_subtest() 601 int prog_fd, link_fd = -1; tp_btf_subtest() local 682 int err, prog_fd, link_fd = -1; raw_tp_subtest() local [all...] |
| H 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()
|
| H 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()
|
| H 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()
|
| H 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()
|
| H 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()
|
| H 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()
|
| H 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()
|
| H 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()
|
| H 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()
|
| /linux/tools/lib/bpf/ |
| H A D | features.c | 342 int prog_fd, link_fd, err; in probe_perf_link() local 352 link_fd = bpf_link_create(prog_fd, -1, BPF_PERF_EVENT, NULL); in probe_perf_link() 355 if (link_fd >= 0) in probe_perf_link() 356 close(link_fd); in probe_perf_link() 359 return link_fd < 0 && err == -EBADF; in probe_perf_link() 374 int prog_fd, link_fd, err; in probe_uprobe_multi_link() local 387 link_fd = bpf_link_create(prog_fd, -1, BPF_TRACE_UPROBE_MULTI, &link_opts); in probe_uprobe_multi_link() 390 if (link_fd >= 0 || err != -EBADF) { in probe_uprobe_multi_link() 391 if (link_fd >= 0) in probe_uprobe_multi_link() 392 close(link_fd); in probe_uprobe_multi_link() [all …]
|
| H A D | libbpf.c | 11264 int prog_fd, link_fd = -1, err; in bpf_program__attach_perf_event_opts() local 11294 link_fd = bpf_link_create(prog_fd, pfd, BPF_PERF_EVENT, &link_opts); in bpf_program__attach_perf_event_opts() 11295 if (link_fd < 0) { in bpf_program__attach_perf_event_opts() 11301 link->link.fd = link_fd; in bpf_program__attach_perf_event_opts() 11332 if (link_fd >= 0) in bpf_program__attach_perf_event_opts() 11333 close(link_fd); in bpf_program__attach_perf_event_opts() 12011 int err, link_fd, prog_fd; in bpf_program__attach_kprobe_multi_opts() local 12084 link_fd = bpf_link_create(prog_fd, 0, attach_type, &lopts); in bpf_program__attach_kprobe_multi_opts() 12085 if (link_fd < 0) { in bpf_program__attach_kprobe_multi_opts() 12091 link->fd = link_fd; in bpf_program__attach_kprobe_multi_opts() [all …]
|
| /linux/tools/testing/selftests/hid/ |
| H 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()
|
| /linux/tools/perf/util/ |
| H A D | bpf_counter.c | 461 int link_fd, diff_map_fd, err; in bperf_reload_leader_program() local 484 link_fd = bpf_link__fd(link); in bperf_reload_leader_program() 486 entry->link_id = bpf_link_get_id(link_fd); in bperf_reload_leader_program()
|
| /linux/Documentation/hid/ |
| H A D | hid-bpf.rst | 425 int err, link_fd; 432 link_fd = bpf_map__attach_struct_ops(hid_skel->maps.haptic_tablet); 433 if (!link_fd) { 438 return link_fd; /* the fd of the created bpf_link */
|
| /linux/include/uapi/linux/ |
| H A D | bpf.h | 801 * Update the eBPF program in the specified *link_fd* to 851 * Create an iterator on top of the specified *link_fd* (as 858 * using the eBPF program attached to *link_fd*. 866 * Forcefully detach the specified *link_fd* from its 1868 __u32 link_fd; /* link fd */ 1889 __u32 link_fd; 1897 __u32 link_fd; 1842 __u32 link_fd; /* link fd */ global() member 1863 __u32 link_fd; global() member 1871 __u32 link_fd; global() member
|
| /linux/tools/include/uapi/linux/ |
| H A D | bpf.h | 801 * Update the eBPF program in the specified *link_fd* to 851 * Create an iterator on top of the specified *link_fd* (as 858 * using the eBPF program attached to *link_fd*. 866 * Forcefully detach the specified *link_fd* from its 1868 __u32 link_fd; /* link fd */ 1889 __u32 link_fd; 1897 __u32 link_fd; 1842 __u32 link_fd; /* link fd */ global() member 1863 __u32 link_fd; global() member 1871 __u32 link_fd; global() member
|
| /linux/kernel/bpf/ |
| H A D | syscall.c | 5830 link = bpf_link_get_from_fd(attr->link_update.link_fd); in link_update() 5872 #define BPF_LINK_DETACH_LAST_FIELD link_detach.link_fd 5882 link = bpf_link_get_from_fd(attr->link_detach.link_fd); in link_detach() 6034 link = bpf_link_get_from_fd(attr->iter_create.link_fd); in bpf_iter_create()
|