Home
last modified time | relevance | path

Searched refs:link_fd (Results 1 – 21 of 21) sorted by relevance

/linux/tools/testing/selftests/bpf/prog_tests/
H A Duprobe_multi_test.c382 int prog_fd, link_fd = -1; in test_attach_api_fails()
395 link_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_UPROBE_MULTI, &opts); in test_attach_api_fails()
396 if (!ASSERT_ERR(link_fd, "link_fd")) in test_attach_api_fails()
398 if (!ASSERT_EQ(link_fd, -E2BIG, "big cnt")) in test_attach_api_fails()
407 link_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_UPROBE_MULTI, &opts); in test_attach_api_fails()
408 if (!ASSERT_ERR(link_fd, "link_fd")) in test_attach_api_fails()
410 if (!ASSERT_EQ(link_fd, -EINVAL, "cnt_is_zero")) in test_attach_api_fails()
419 link_fd in test_attach_api_fails()
381 int prog_fd, link_fd = -1; test_attach_api_fails() local
606 int prog_fd, link_fd, err; attach_uprobe_fail_refctr() local
[all...]
H A Dfexit_stress.c9 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 Dbpf_cookie.c618 int prog_fd, link_fd = -1; in tp_btf_subtest()
633 link_fd = bpf_raw_tracepoint_open_opts(prog_fd, &raw_tp_opts); in tp_btf_subtest()
634 if (!ASSERT_GE(link_fd, 0, "bpf_raw_tracepoint_open_opts")) in tp_btf_subtest()
638 close(link_fd); /* detach */ in tp_btf_subtest()
639 link_fd = -1; in tp_btf_subtest()
647 link_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_RAW_TP, &link_opts); in tp_btf_subtest()
648 if (!ASSERT_GE(link_fd, 0, "bpf_link_create")) in tp_btf_subtest()
652 close(link_fd); /* detach */ in tp_btf_subtest()
653 link_fd = -1; in tp_btf_subtest()
672 if (link_fd > in verify_raw_tp_link_info()
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 Dfill_link_info.c182 int link_fd, err; in test_kprobe_fill_link_info() local
188 link_fd = bpf_link__fd(link); in test_kprobe_fill_link_info()
197 err = verify_perf_link_info(link_fd, type, kprobe_addr, 0, entry_offset); in test_kprobe_fill_link_info()
200 kprobe_fill_invalid_user_buffer(link_fd); in test_kprobe_fill_link_info()
211 int link_fd, err; in test_tp_fill_link_info() local
217 link_fd = bpf_link__fd(link); in test_tp_fill_link_info()
218 err = verify_perf_link_info(link_fd, BPF_PERF_EVENT_TRACEPOINT, 0, 0, 0); in test_tp_fill_link_info()
229 int link_fd, err, pfd; in test_event_fill_link_info() local
247 link_fd = bpf_link__fd(link); in test_event_fill_link_info()
248 err = verify_perf_link_info(link_fd, BPF_PERF_EVENT_EVENT, 0, 0, 0); in test_event_fill_link_info()
[all …]
H A Dmodule_fentry_shadow.c62 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 Dcore_kern.c10 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 Dfexit_test.c10 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 Dfentry_test.c10 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 Dbpf_obj_id.c250 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 Dunpriv_bpf_disabled.c46 int i, nr_cpus, link_fd = -1; in sysctl_set()
110 link_fd = bpf_link_create(bpf_program__fd(skel->progs.handle_perf_event), perf_fd, in test_unpriv_bpf_disabled_positive()
112 ASSERT_GT(link_fd, 0, "link_create"); in test_unpriv_bpf_disabled_positive()
115 if (link_fd) in test_unpriv_bpf_disabled_positive()
116 close(link_fd); in test_unpriv_bpf_disabled_positive()
65 int i, nr_cpus, link_fd = -1; test_unpriv_bpf_disabled_positive() local
H A Drecursive_attach.c118 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 Dsockopt.c1097 int sock_fd, err, prog_fd, link_fd = -1; in run_test() local
1115 link_fd = err; in run_test()
1210 if (link_fd >= 0) in run_test()
1211 close(link_fd); in run_test()
H A Dsockmap_listen.c775 int link_fd; in test_msg_redir_to_connected_with_link() local
777 link_fd = bpf_link_create(prog_msg_verdict, sock_map, BPF_SK_MSG_VERDICT, NULL); in test_msg_redir_to_connected_with_link()
778 if (!ASSERT_GE(link_fd, 0, "bpf_link_create")) in test_msg_redir_to_connected_with_link()
783 close(link_fd); in test_msg_redir_to_connected_with_link()
/linux/tools/lib/bpf/
H A Dfeatures.c342 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 Dlibbpf.c11574 int prog_fd, link_fd = -1, err; in bpf_program__attach_perf_event_opts() local
11604 link_fd = bpf_link_create(prog_fd, pfd, BPF_PERF_EVENT, &link_opts); in bpf_program__attach_perf_event_opts()
11605 if (link_fd < 0) { in bpf_program__attach_perf_event_opts()
11611 link->link.fd = link_fd; in bpf_program__attach_perf_event_opts()
11642 if (link_fd >= 0) in bpf_program__attach_perf_event_opts()
11643 close(link_fd); in bpf_program__attach_perf_event_opts()
12323 int err, link_fd, prog_fd; in bpf_program__attach_kprobe_multi_opts() local
12405 link_fd = bpf_link_create(prog_fd, 0, attach_type, &lopts); in bpf_program__attach_kprobe_multi_opts()
12406 if (link_fd < 0) { in bpf_program__attach_kprobe_multi_opts()
12420 link->fd = link_fd; in bpf_program__attach_kprobe_multi_opts()
[all …]
/linux/tools/testing/selftests/hid/
H A Dhid_bpf.c281 int err, link_fd; in TEST_F() local
288 link_fd = bpf_link__fd(link); in TEST_F()
289 ASSERT_GE(link_fd, 0) TH_LOG("HID-BPF link FD not valid"); in TEST_F()
308 err = bpf_obj_pin(link_fd, PIN_PATH); in TEST_F()
/linux/tools/perf/util/
H A Dbpf_counter.c463 int link_fd, diff_map_fd, err; in bperf_reload_leader_program()
486 link_fd = bpf_link__fd(link); in bperf_reload_leader_program()
488 entry->link_id = bpf_link_get_id(link_fd); in bperf_reload_leader_program()
461 int link_fd, diff_map_fd, err; bperf_reload_leader_program() local
/linux/Documentation/hid/
H A Dhid-bpf.rst425 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/tools/include/uapi/linux/
H A Dbpf.h1896 __u32 link_fd; /* link fd */ member
1917 __u32 link_fd; member
1925 __u32 link_fd; member
/linux/include/uapi/linux/
H A Dbpf.h1896 __u32 link_fd; /* link fd */ member
1917 __u32 link_fd; member
1925 __u32 link_fd; member
/linux/kernel/bpf/
H A Dsyscall.c5944 link = bpf_link_get_from_fd(attr->link_update.link_fd); in link_update()
5986 #define BPF_LINK_DETACH_LAST_FIELD link_detach.link_fd
5996 link = bpf_link_get_from_fd(attr->link_detach.link_fd); in link_detach()
6148 link = bpf_link_get_from_fd(attr->iter_create.link_fd); in bpf_iter_create()