Home
last modified time | relevance | path

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

/tools/testing/selftests/bpf/prog_tests/
Datomics.c11 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 …]
Dperf_link.c30 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()
Dfexit_stress.c12 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()
Dfexit_test.c10 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()
Dfentry_test.c10 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()
Dbpf_obj_id.c302 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()
/tools/lib/bpf/
Dxsk.c76 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 …]
Dbpf.h193 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);
Dbpf.c728 int bpf_link_detach(int link_fd) in bpf_link_detach() argument
734 attr.link_detach.link_fd = link_fd; in bpf_link_detach()
740 int bpf_link_update(int link_fd, int new_prog_fd, in bpf_link_update() argument
750 attr.link_update.link_fd = link_fd; in bpf_link_update()
759 int bpf_iter_create(int link_fd) in bpf_iter_create() argument
765 attr.iter_create.link_fd = link_fd; in bpf_iter_create()
Dlibbpf.c4365 int prog_fd, link_fd, err; in probe_perf_link() local
4379 link_fd = bpf_link_create(prog_fd, -1, BPF_PERF_EVENT, NULL); in probe_perf_link()
4382 if (link_fd >= 0) in probe_perf_link()
4383 close(link_fd); in probe_perf_link()
4386 return link_fd < 0 && err == -EBADF; in probe_perf_link()
9050 int prog_fd, link_fd = -1, err; in bpf_program__attach_perf_event_opts() local
9078 link_fd = bpf_link_create(prog_fd, pfd, BPF_PERF_EVENT, &link_opts); in bpf_program__attach_perf_event_opts()
9079 if (link_fd < 0) { in bpf_program__attach_perf_event_opts()
9086 link->link.fd = link_fd; in bpf_program__attach_perf_event_opts()
9114 if (link_fd >= 0) in bpf_program__attach_perf_event_opts()
[all …]
/tools/perf/util/
Dbpf_counter.c394 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()
/tools/include/uapi/linux/
Dbpf.h1462 __u32 link_fd; /* link fd */ member
1472 __u32 link_fd; member
1480 __u32 link_fd; member