Lines Matching refs:link_fd
4743 int prog_fd, link_fd, err; in probe_perf_link() local
4753 link_fd = bpf_link_create(prog_fd, -1, BPF_PERF_EVENT, NULL); in probe_perf_link()
4756 if (link_fd >= 0) in probe_perf_link()
4757 close(link_fd); in probe_perf_link()
4760 return link_fd < 0 && err == -EBADF; in probe_perf_link()
9726 int prog_fd, link_fd = -1, err; in bpf_program__attach_perf_event_opts() local
9754 link_fd = bpf_link_create(prog_fd, pfd, BPF_PERF_EVENT, &link_opts); in bpf_program__attach_perf_event_opts()
9755 if (link_fd < 0) { in bpf_program__attach_perf_event_opts()
9762 link->link.fd = link_fd; in bpf_program__attach_perf_event_opts()
9790 if (link_fd >= 0) in bpf_program__attach_perf_event_opts()
9791 close(link_fd); in bpf_program__attach_perf_event_opts()
10281 int err, link_fd, prog_fd; in bpf_program__attach_kprobe_multi_opts() local
10332 link_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_KPROBE_MULTI, &lopts); in bpf_program__attach_kprobe_multi_opts()
10333 if (link_fd < 0) { in bpf_program__attach_kprobe_multi_opts()
10339 link->fd = link_fd; in bpf_program__attach_kprobe_multi_opts()
11286 int prog_fd, link_fd; in bpf_program__attach_fd() local
11300 link_fd = bpf_link_create(prog_fd, target_fd, attach_type, &opts); in bpf_program__attach_fd()
11301 if (link_fd < 0) { in bpf_program__attach_fd()
11302 link_fd = -errno; in bpf_program__attach_fd()
11306 libbpf_strerror_r(link_fd, errmsg, sizeof(errmsg))); in bpf_program__attach_fd()
11307 return libbpf_err_ptr(link_fd); in bpf_program__attach_fd()
11309 link->fd = link_fd; in bpf_program__attach_fd()
11370 int prog_fd, link_fd; in bpf_program__attach_iter() local
11390 link_fd = bpf_link_create(prog_fd, target_fd, BPF_TRACE_ITER, in bpf_program__attach_iter()
11392 if (link_fd < 0) { in bpf_program__attach_iter()
11393 link_fd = -errno; in bpf_program__attach_iter()
11396 prog->name, libbpf_strerror_r(link_fd, errmsg, sizeof(errmsg))); in bpf_program__attach_iter()
11397 return libbpf_err_ptr(link_fd); in bpf_program__attach_iter()
11399 link->fd = link_fd; in bpf_program__attach_iter()