| /Linux-v5.15/tools/testing/selftests/bpf/prog_tests/ |
| D | atomics.c | 11 int link_fd; in test_add() local 13 link_fd = atomics__add__attach(skel); in test_add() 14 if (!ASSERT_GT(link_fd, 0, "attach(add)")) in test_add() 36 close(link_fd); in test_add() 43 int link_fd; in test_sub() local 45 link_fd = atomics__sub__attach(skel); in test_sub() 46 if (!ASSERT_GT(link_fd, 0, "attach(sub)")) in test_sub() 69 close(link_fd); in test_sub() 76 int link_fd; in test_and() local 78 link_fd = atomics__and__attach(skel); in test_and() [all …]
|
| D | perf_link.c | 30 int pfd = -1, link_fd = -1, err; in test_perf_link() local 50 link_fd = bpf_link_create(bpf_program__fd(skel->progs.handler), pfd, in test_perf_link() 52 if (!ASSERT_GE(link_fd, 0, "link_fd")) in test_perf_link() 56 err = bpf_obj_get_info_by_fd(link_fd, &info, &info_len); in test_perf_link() 71 close(link_fd); in test_perf_link() 72 link_fd = -1; in test_perf_link() 84 if (link_fd >= 0) in test_perf_link() 85 close(link_fd); in test_perf_link()
|
| D | fexit_stress.c | 12 int link_fd[CNT] = {}; in test_fexit_stress() local 54 link_fd[i] = bpf_raw_tracepoint_open(NULL, fexit_fd[i]); in test_fexit_stress() 55 if (CHECK(link_fd[i] < 0, "fexit attach failed", in test_fexit_stress() 56 "prog %d failed: %d err %d\n", i, link_fd[i], errno)) in test_fexit_stress() 71 if (link_fd[i]) in test_fexit_stress() 72 close(link_fd[i]); in test_fexit_stress()
|
| D | fentry_test.c | 10 int link_fd; in fentry_test() local 18 link_fd = fentry_test__test1__attach(fentry_skel); in fentry_test() 19 if (!ASSERT_LT(link_fd, 0, "fentry_attach_link")) in fentry_test()
|
| D | fexit_test.c | 10 int link_fd; in fexit_test() local 18 link_fd = fexit_test__test1__attach(fexit_skel); in fexit_test() 19 if (!ASSERT_LT(link_fd, 0, "fexit_attach_link")) in fexit_test()
|
| D | bpf_obj_id.c | 302 int link_fd, cmp_res; in test_bpf_obj_id() local 307 link_fd = bpf_link_get_fd_by_id(next_id); in test_bpf_obj_id() 308 if (link_fd < 0 && errno == ENOENT) in test_bpf_obj_id() 311 if (CHECK(link_fd < 0, "get-link-fd(next_id)", in test_bpf_obj_id() 313 link_fd, next_id, errno)) in test_bpf_obj_id() 325 err = bpf_obj_get_info_by_fd(link_fd, &link_info, &info_len); in test_bpf_obj_id() 334 close(link_fd); in test_bpf_obj_id()
|
| /Linux-v5.15/tools/lib/bpf/ |
| D | xsk.c | 76 int link_fd; member 516 int link_fd; in xsk_create_bpf_link() local 535 link_fd = bpf_link_create(ctx->prog_fd, ctx->ifindex, BPF_XDP, &opts); in xsk_create_bpf_link() 536 if (link_fd < 0) { in xsk_create_bpf_link() 538 return link_fd; in xsk_create_bpf_link() 541 ctx->link_fd = link_fd; in xsk_create_bpf_link() 676 static int xsk_link_lookup(int ifindex, __u32 *prog_id, int *link_fd) in xsk_link_lookup() argument 714 *link_fd = fd; in xsk_link_lookup() 735 int prog_fd, link_fd = -1; in xsk_probe_bpf_link() local 740 err = xsk_link_lookup(ifindex_lo, NULL, &link_fd); in xsk_probe_bpf_link() [all …]
|
| D | bpf.h | 193 LIBBPF_API int bpf_link_detach(int link_fd); 202 LIBBPF_API int bpf_link_update(int link_fd, int new_prog_fd, 205 LIBBPF_API int bpf_iter_create(int link_fd);
|
| D | bpf.c | 726 int bpf_link_detach(int link_fd) in bpf_link_detach() argument 732 attr.link_detach.link_fd = link_fd; in bpf_link_detach() 738 int bpf_link_update(int link_fd, int new_prog_fd, in bpf_link_update() argument 748 attr.link_update.link_fd = link_fd; in bpf_link_update() 757 int bpf_iter_create(int link_fd) in bpf_iter_create() argument 763 attr.iter_create.link_fd = link_fd; in bpf_iter_create()
|
| D | libbpf.c | 4349 int prog_fd, link_fd, err; in probe_perf_link() local 4363 link_fd = bpf_link_create(prog_fd, -1, BPF_PERF_EVENT, NULL); in probe_perf_link() 4366 if (link_fd >= 0) in probe_perf_link() 4367 close(link_fd); in probe_perf_link() 4370 return link_fd < 0 && err == -EBADF; in probe_perf_link() 9023 int prog_fd, link_fd = -1, err; in bpf_program__attach_perf_event_opts() local 9051 link_fd = bpf_link_create(prog_fd, pfd, BPF_PERF_EVENT, &link_opts); in bpf_program__attach_perf_event_opts() 9052 if (link_fd < 0) { in bpf_program__attach_perf_event_opts() 9059 link->link.fd = link_fd; in bpf_program__attach_perf_event_opts() 9087 if (link_fd >= 0) in bpf_program__attach_perf_event_opts() [all …]
|
| /Linux-v5.15/tools/perf/util/ |
| D | bpf_counter.c | 394 int link_fd, diff_map_fd, err; in bperf_reload_leader_program() local 416 link_fd = bpf_link__fd(link); in bperf_reload_leader_program() 418 entry->link_id = bpf_link_get_id(link_fd); in bperf_reload_leader_program()
|
| /Linux-v5.15/include/uapi/linux/ |
| D | bpf.h | 1462 __u32 link_fd; /* link fd */ member 1472 __u32 link_fd; member 1480 __u32 link_fd; member
|
| /Linux-v5.15/tools/include/uapi/linux/ |
| D | bpf.h | 1462 __u32 link_fd; /* link fd */ member 1472 __u32 link_fd; member 1480 __u32 link_fd; member
|
| /Linux-v5.15/kernel/bpf/ |
| D | syscall.c | 4297 link = bpf_link_get_from_fd(attr->link_update.link_fd); in link_update() 4334 #define BPF_LINK_DETACH_LAST_FIELD link_detach.link_fd 4344 link = bpf_link_get_from_fd(attr->link_detach.link_fd); in link_detach() 4476 link = bpf_link_get_from_fd(attr->iter_create.link_fd); in bpf_iter_create()
|