Lines Matching refs:link_fd
4709 int prog_fd, link_fd, err; in probe_perf_link() local
4719 link_fd = bpf_link_create(prog_fd, -1, BPF_PERF_EVENT, NULL); in probe_perf_link()
4722 if (link_fd >= 0) in probe_perf_link()
4723 close(link_fd); in probe_perf_link()
4726 return link_fd < 0 && err == -EBADF; in probe_perf_link()
9696 int prog_fd, link_fd = -1, err; in bpf_program__attach_perf_event_opts() local
9724 link_fd = bpf_link_create(prog_fd, pfd, BPF_PERF_EVENT, &link_opts); in bpf_program__attach_perf_event_opts()
9725 if (link_fd < 0) { in bpf_program__attach_perf_event_opts()
9732 link->link.fd = link_fd; in bpf_program__attach_perf_event_opts()
9760 if (link_fd >= 0) in bpf_program__attach_perf_event_opts()
9761 close(link_fd); in bpf_program__attach_perf_event_opts()
10244 int err, link_fd, prog_fd; in bpf_program__attach_kprobe_multi_opts() local
10295 link_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_KPROBE_MULTI, &lopts); in bpf_program__attach_kprobe_multi_opts()
10296 if (link_fd < 0) { in bpf_program__attach_kprobe_multi_opts()
10302 link->fd = link_fd; in bpf_program__attach_kprobe_multi_opts()
11249 int prog_fd, link_fd; in bpf_program__attach_fd() local
11263 link_fd = bpf_link_create(prog_fd, target_fd, attach_type, &opts); in bpf_program__attach_fd()
11264 if (link_fd < 0) { in bpf_program__attach_fd()
11265 link_fd = -errno; in bpf_program__attach_fd()
11269 libbpf_strerror_r(link_fd, errmsg, sizeof(errmsg))); in bpf_program__attach_fd()
11270 return libbpf_err_ptr(link_fd); in bpf_program__attach_fd()
11272 link->fd = link_fd; in bpf_program__attach_fd()
11333 int prog_fd, link_fd; in bpf_program__attach_iter() local
11353 link_fd = bpf_link_create(prog_fd, target_fd, BPF_TRACE_ITER, in bpf_program__attach_iter()
11355 if (link_fd < 0) { in bpf_program__attach_iter()
11356 link_fd = -errno; in bpf_program__attach_iter()
11359 prog->name, libbpf_strerror_r(link_fd, errmsg, sizeof(errmsg))); in bpf_program__attach_iter()
11360 return libbpf_err_ptr(link_fd); in bpf_program__attach_iter()
11362 link->fd = link_fd; in bpf_program__attach_iter()