Home
last modified time | relevance | path

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

/linux-6.1.9/tools/testing/selftests/bpf/prog_tests/
Dperf_link.c31 int pfd = -1, link_fd = -1, err; in serial_test_perf_link() local
51 link_fd = bpf_link_create(bpf_program__fd(skel->progs.handler), pfd, in serial_test_perf_link()
53 if (!ASSERT_GE(link_fd, 0, "link_fd")) in serial_test_perf_link()
57 err = bpf_obj_get_info_by_fd(link_fd, &info, &info_len); in serial_test_perf_link()
72 close(link_fd); in serial_test_perf_link()
73 link_fd = -1; in serial_test_perf_link()
85 if (link_fd >= 0) in serial_test_perf_link()
86 close(link_fd); in serial_test_perf_link()
Dfexit_stress.c11 int link_fd[CNT] = {}; in serial_test_fexit_stress() local
38 link_fd[i] = bpf_link_create(fexit_fd[i], 0, BPF_TRACE_FEXIT, NULL); in serial_test_fexit_stress()
39 if (!ASSERT_GE(link_fd[i], 0, "fexit attach")) in serial_test_fexit_stress()
48 if (link_fd[i]) in serial_test_fexit_stress()
49 close(link_fd[i]); in serial_test_fexit_stress()
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()
Dfentry_test.c9 int link_fd; in fentry_test() local
18 link_fd = fentry_test_lskel__test1__attach(fentry_skel); in fentry_test()
19 if (!ASSERT_LT(link_fd, 0, "fentry_attach_link")) in fentry_test()
Dfexit_test.c9 int link_fd; in fexit_test() local
18 link_fd = fexit_test_lskel__test1__attach(fexit_skel); in fexit_test()
19 if (!ASSERT_LT(link_fd, 0, "fexit_attach_link")) in fexit_test()
Dbpf_obj_id.c302 int link_fd, cmp_res; in serial_test_bpf_obj_id() local
307 link_fd = bpf_link_get_fd_by_id(next_id); in serial_test_bpf_obj_id()
308 if (link_fd < 0 && errno == ENOENT) in serial_test_bpf_obj_id()
311 if (CHECK(link_fd < 0, "get-link-fd(next_id)", in serial_test_bpf_obj_id()
313 link_fd, next_id, errno)) in serial_test_bpf_obj_id()
325 err = bpf_obj_get_info_by_fd(link_fd, &link_info, &info_len); in serial_test_bpf_obj_id()
334 close(link_fd); in serial_test_bpf_obj_id()
Dunpriv_bpf_disabled.c64 int i, nr_cpus, link_fd = -1; in test_unpriv_bpf_disabled_positive() local
128 link_fd = bpf_link_create(bpf_program__fd(skel->progs.handle_perf_event), perf_fd, in test_unpriv_bpf_disabled_positive()
130 ASSERT_GT(link_fd, 0, "link_create"); in test_unpriv_bpf_disabled_positive()
133 if (link_fd) in test_unpriv_bpf_disabled_positive()
134 close(link_fd); in test_unpriv_bpf_disabled_positive()
/linux-6.1.9/tools/testing/selftests/bpf/
Dxsk.c77 int link_fd; member
495 int link_fd; in xsk_create_bpf_link() local
514 link_fd = bpf_link_create(ctx->prog_fd, ctx->ifindex, BPF_XDP, &opts); in xsk_create_bpf_link()
515 if (link_fd < 0) { in xsk_create_bpf_link()
517 return link_fd; in xsk_create_bpf_link()
520 ctx->link_fd = link_fd; in xsk_create_bpf_link()
673 static int xsk_link_lookup(int ifindex, __u32 *prog_id, int *link_fd) in xsk_link_lookup() argument
711 *link_fd = fd; in xsk_link_lookup()
730 int prog_fd, link_fd = -1, insn_cnt = ARRAY_SIZE(insns); in xsk_probe_bpf_link() local
735 err = xsk_link_lookup(ifindex_lo, NULL, &link_fd); in xsk_probe_bpf_link()
[all …]
/linux-6.1.9/tools/lib/bpf/
Dbpf.h333 LIBBPF_API int bpf_link_detach(int link_fd);
342 LIBBPF_API int bpf_link_update(int link_fd, int new_prog_fd,
345 LIBBPF_API int bpf_iter_create(int link_fd);
Dbpf.c774 int bpf_link_detach(int link_fd) in bpf_link_detach() argument
781 attr.link_detach.link_fd = link_fd; in bpf_link_detach()
787 int bpf_link_update(int link_fd, int new_prog_fd, in bpf_link_update() argument
798 attr.link_update.link_fd = link_fd; in bpf_link_update()
807 int bpf_iter_create(int link_fd) in bpf_iter_create() argument
814 attr.iter_create.link_fd = link_fd; in bpf_iter_create()
Dlibbpf.c4721 int prog_fd, link_fd, err; in probe_perf_link() local
4731 link_fd = bpf_link_create(prog_fd, -1, BPF_PERF_EVENT, NULL); in probe_perf_link()
4734 if (link_fd >= 0) in probe_perf_link()
4735 close(link_fd); in probe_perf_link()
4738 return link_fd < 0 && err == -EBADF; in probe_perf_link()
9708 int prog_fd, link_fd = -1, err; in bpf_program__attach_perf_event_opts() local
9736 link_fd = bpf_link_create(prog_fd, pfd, BPF_PERF_EVENT, &link_opts); in bpf_program__attach_perf_event_opts()
9737 if (link_fd < 0) { in bpf_program__attach_perf_event_opts()
9744 link->link.fd = link_fd; in bpf_program__attach_perf_event_opts()
9772 if (link_fd >= 0) in bpf_program__attach_perf_event_opts()
[all …]
/linux-6.1.9/tools/perf/util/
Dbpf_counter.c417 int link_fd, diff_map_fd, err; in bperf_reload_leader_program() local
439 link_fd = bpf_link__fd(link); in bperf_reload_leader_program()
441 entry->link_id = bpf_link_get_id(link_fd); in bperf_reload_leader_program()
/linux-6.1.9/tools/include/uapi/linux/
Dbpf.h1537 __u32 link_fd; /* link fd */ member
1547 __u32 link_fd; member
1555 __u32 link_fd; member
/linux-6.1.9/include/uapi/linux/
Dbpf.h1537 __u32 link_fd; /* link fd */ member
1547 __u32 link_fd; member
1555 __u32 link_fd; member
/linux-6.1.9/kernel/bpf/
Dsyscall.c4639 link = bpf_link_get_from_fd(attr->link_update.link_fd); in link_update()
4676 #define BPF_LINK_DETACH_LAST_FIELD link_detach.link_fd
4686 link = bpf_link_get_from_fd(attr->link_detach.link_fd); in link_detach()
4837 link = bpf_link_get_from_fd(attr->iter_create.link_fd); in bpf_iter_create()