Lines Matching refs:link_fd
10757 int prog_fd, link_fd = -1, err; in bpf_program__attach_perf_event_opts() local
10787 link_fd = bpf_link_create(prog_fd, pfd, BPF_PERF_EVENT, &link_opts); in bpf_program__attach_perf_event_opts()
10788 if (link_fd < 0) { in bpf_program__attach_perf_event_opts()
10795 link->link.fd = link_fd; in bpf_program__attach_perf_event_opts()
10823 if (link_fd >= 0) in bpf_program__attach_perf_event_opts()
10824 close(link_fd); in bpf_program__attach_perf_event_opts()
11486 int err, link_fd, prog_fd; in bpf_program__attach_kprobe_multi_opts() local
11548 link_fd = bpf_link_create(prog_fd, 0, attach_type, &lopts); in bpf_program__attach_kprobe_multi_opts()
11549 if (link_fd < 0) { in bpf_program__attach_kprobe_multi_opts()
11555 link->fd = link_fd; in bpf_program__attach_kprobe_multi_opts()
11945 int err = 0, link_fd, prog_fd; in bpf_program__attach_uprobe_multi() local
12038 link_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_UPROBE_MULTI, &lopts); in bpf_program__attach_uprobe_multi()
12039 if (link_fd < 0) { in bpf_program__attach_uprobe_multi()
12045 link->fd = link_fd; in bpf_program__attach_uprobe_multi()
12630 int prog_fd, link_fd; in bpf_program_attach_fd() local
12644 link_fd = bpf_link_create(prog_fd, target_fd, attach_type, opts); in bpf_program_attach_fd()
12645 if (link_fd < 0) { in bpf_program_attach_fd()
12646 link_fd = -errno; in bpf_program_attach_fd()
12650 libbpf_strerror_r(link_fd, errmsg, sizeof(errmsg))); in bpf_program_attach_fd()
12651 return libbpf_err_ptr(link_fd); in bpf_program_attach_fd()
12653 link->fd = link_fd; in bpf_program_attach_fd()
12794 int prog_fd, link_fd; in bpf_program__attach_iter() local
12814 link_fd = bpf_link_create(prog_fd, target_fd, BPF_TRACE_ITER, in bpf_program__attach_iter()
12816 if (link_fd < 0) { in bpf_program__attach_iter()
12817 link_fd = -errno; in bpf_program__attach_iter()
12820 prog->name, libbpf_strerror_r(link_fd, errmsg, sizeof(errmsg))); in bpf_program__attach_iter()
12821 return libbpf_err_ptr(link_fd); in bpf_program__attach_iter()
12823 link->fd = link_fd; in bpf_program__attach_iter()
12838 int prog_fd, link_fd; in bpf_program__attach_netfilter() local
12860 link_fd = bpf_link_create(prog_fd, 0, BPF_NETFILTER, &lopts); in bpf_program__attach_netfilter()
12861 if (link_fd < 0) { in bpf_program__attach_netfilter()
12864 link_fd = -errno; in bpf_program__attach_netfilter()
12867 prog->name, libbpf_strerror_r(link_fd, errmsg, sizeof(errmsg))); in bpf_program__attach_netfilter()
12868 return libbpf_err_ptr(link_fd); in bpf_program__attach_netfilter()
12870 link->fd = link_fd; in bpf_program__attach_netfilter()