/linux-master/tools/testing/selftests/bpf/prog_tests/ |
H A D | core_kern.c | 10 int link_fd; local 16 link_fd = core_kern_lskel__core_relo_proto__attach(skel); 17 if (!ASSERT_GT(link_fd, 0, "attach(core_relo_proto)"))
|
H A D | perf_link.c | 31 int pfd = -1, link_fd = -1, err; local 51 link_fd = bpf_link_create(bpf_program__fd(skel->progs.handler), pfd, 53 if (!ASSERT_GE(link_fd, 0, "link_fd")) 57 err = bpf_link_get_info_by_fd(link_fd, &info, &info_len); 72 close(link_fd); 73 link_fd = -1; 85 if (link_fd >= 0) 86 close(link_fd);
|
H A D | fexit_stress.c | 8 int *fd, *fexit_fd, *link_fd; local 17 link_fd = fd + bpf_max_tramp_links; 43 link_fd[i] = bpf_link_create(fexit_fd[i], 0, BPF_TRACE_FEXIT, NULL); 44 if (!ASSERT_GE(link_fd[i], 0, "fexit attach")) 53 if (link_fd[i]) 54 close(link_fd[i]);
|
H A D | uprobe_multi_test.c | 242 int prog_fd, link_fd = -1; local 255 link_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_UPROBE_MULTI, &opts); 256 if (!ASSERT_ERR(link_fd, "link_fd")) 258 if (!ASSERT_EQ(link_fd, -E2BIG, "big cnt")) 267 link_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_UPROBE_MULTI, &opts); 268 if (!ASSERT_ERR(link_fd, "link_fd")) 270 if (!ASSERT_EQ(link_fd, -EINVAL, "cnt_is_zero")) 279 link_fd [all...] |
H A D | fexit_test.c | 10 int link_fd; local 19 link_fd = fexit_test_lskel__test1__attach(fexit_skel); 20 if (!ASSERT_LT(link_fd, 0, "fexit_attach_link"))
|
H A D | fentry_test.c | 10 int link_fd; local 19 link_fd = fentry_test_lskel__test1__attach(fentry_skel); 20 if (!ASSERT_LT(link_fd, 0, "fentry_attach_link"))
|
H A D | module_fentry_shadow.c | 61 int link_fd[2] = {}; local 114 link_fd[i] = bpf_link_create(prog_fd[i], 0, BPF_TRACE_FENTRY, NULL); 115 if (!ASSERT_GE(link_fd[i], 0, "bpf_link_create")) 130 if (link_fd[i] > 0) 131 close(link_fd[i]);
|
H A D | recursive_attach.c | 118 int err, link_fd, tgt_prog_fd; local 139 link_fd = bpf_link_create(tgt_prog_fd, 0, BPF_TRACE_FENTRY, NULL); 140 if (!ASSERT_GE(link_fd, 0, "link_fd"))
|
H A D | fill_link_info.c | 160 int link_fd, err; local 166 link_fd = bpf_link__fd(link); 171 err = verify_perf_link_info(link_fd, type, kprobe_addr, 0, entry_offset); 174 kprobe_fill_invalid_user_buffer(link_fd); 185 int link_fd, err; local 191 link_fd = bpf_link__fd(link); 192 err = verify_perf_link_info(link_fd, BPF_PERF_EVENT_TRACEPOINT, 0, 0, 0); 203 int link_fd, err, pfd; local 221 link_fd = bpf_link__fd(link); 222 err = verify_perf_link_info(link_fd, BPF_PERF_EVENT_EVEN 238 int link_fd, err; local 358 int link_fd, err; local 534 int link_fd, err; local [all...] |
H A D | bpf_obj_id.c | 250 int link_fd, cmp_res; local 255 link_fd = bpf_link_get_fd_by_id(next_id); 256 if (link_fd < 0 && errno == ENOENT) 259 if (!ASSERT_GE(link_fd, 0, "bpf_link_get_fd_by_id")) 271 err = bpf_link_get_info_by_fd(link_fd, &link_info, &info_len); 278 close(link_fd);
|
H A D | unpriv_bpf_disabled.c | 64 int i, nr_cpus, link_fd = -1; local 128 link_fd = bpf_link_create(bpf_program__fd(skel->progs.handle_perf_event), perf_fd, 130 ASSERT_GT(link_fd, 0, "link_create"); 133 if (link_fd) 134 close(link_fd);
|
/linux-master/tools/lib/bpf/ |
H A D | features.c | 347 int prog_fd, link_fd, err; local 357 link_fd = bpf_link_create(prog_fd, -1, BPF_PERF_EVENT, NULL); 360 if (link_fd >= 0) 361 close(link_fd); 364 return link_fd < 0 && err == -EBADF; 379 int prog_fd, link_fd, err; local 392 link_fd = bpf_link_create(prog_fd, -1, BPF_TRACE_UPROBE_MULTI, &link_opts); 395 if (link_fd >= 0) 396 close(link_fd); 399 return link_fd < [all...] |
H A D | bpf.h | 447 LIBBPF_API int bpf_link_detach(int link_fd); 457 LIBBPF_API int bpf_link_update(int link_fd, int new_prog_fd, 460 LIBBPF_API int bpf_iter_create(int link_fd); 567 * link corresponding to *link_fd*. 575 * @param link_fd BPF link file descriptor 583 LIBBPF_API int bpf_link_get_info_by_fd(int link_fd, struct bpf_link_info *info, __u32 *info_len);
|
H A D | bpf.c | 876 int bpf_link_detach(int link_fd) argument 883 attr.link_detach.link_fd = link_fd; 889 int bpf_link_update(int link_fd, int new_prog_fd, argument 903 attr.link_update.link_fd = link_fd; 915 int bpf_iter_create(int link_fd) argument 922 attr.iter_create.link_fd = link_fd; 1171 int bpf_link_get_info_by_fd(int link_fd, struc argument [all...] |
H A D | libbpf.c | 10604 int prog_fd, link_fd = -1, err; local 10634 link_fd = bpf_link_create(prog_fd, pfd, BPF_PERF_EVENT, &link_opts); 10635 if (link_fd < 0) { 10642 link->link.fd = link_fd; 10670 if (link_fd >= 0) 10671 close(link_fd); 11332 int err, link_fd, prog_fd; local 11382 link_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_KPROBE_MULTI, &lopts); 11383 if (link_fd < 0) { 11389 link->fd = link_fd; 11753 int err = 0, link_fd, prog_fd; local 12418 int prog_fd, link_fd; local 12576 int prog_fd, link_fd; local 12620 int prog_fd, link_fd; local [all...] |
/linux-master/tools/perf/util/ |
H A D | bpf_counter.c | 402 int link_fd, diff_map_fd, err; local 424 link_fd = bpf_link__fd(link); 426 entry->link_id = bpf_link_get_id(link_fd);
|
/linux-master/include/uapi/linux/ |
H A D | bpf.h | 789 * Update the eBPF program in the specified *link_fd* to 839 * Create an iterator on top of the specified *link_fd* (as 846 * using the eBPF program attached to *link_fd*. 854 * Forcefully detach the specified *link_fd* from its 1776 __u32 link_fd; /* link fd */ member in struct:bpf_attr::__anon2623 1797 __u32 link_fd; member in struct:bpf_attr::__anon2626 1805 __u32 link_fd; member in struct:bpf_attr::__anon2628
|
/linux-master/tools/include/uapi/linux/ |
H A D | bpf.h | 789 * Update the eBPF program in the specified *link_fd* to 839 * Create an iterator on top of the specified *link_fd* (as 846 * using the eBPF program attached to *link_fd*. 854 * Forcefully detach the specified *link_fd* from its 1776 __u32 link_fd; /* link fd */ member in struct:bpf_attr::__anon3164 1797 __u32 link_fd; member in struct:bpf_attr::__anon3167 1805 __u32 link_fd; member in struct:bpf_attr::__anon3169
|
/linux-master/kernel/bpf/ |
H A D | syscall.c | 5327 link = bpf_link_get_from_fd(attr->link_update.link_fd); 5369 #define BPF_LINK_DETACH_LAST_FIELD link_detach.link_fd 5379 link = bpf_link_get_from_fd(attr->link_detach.link_fd); 5530 link = bpf_link_get_from_fd(attr->iter_create.link_fd);
|