Lines Matching refs:link_fd

10880 	int prog_fd, link_fd = -1, err;  in bpf_program__attach_perf_event_opts()  local
10910 link_fd = bpf_link_create(prog_fd, pfd, BPF_PERF_EVENT, &link_opts); in bpf_program__attach_perf_event_opts()
10911 if (link_fd < 0) { in bpf_program__attach_perf_event_opts()
10917 link->link.fd = link_fd; in bpf_program__attach_perf_event_opts()
10945 if (link_fd >= 0) in bpf_program__attach_perf_event_opts()
10946 close(link_fd); in bpf_program__attach_perf_event_opts()
11625 int err, link_fd, prog_fd; in bpf_program__attach_kprobe_multi_opts() local
11698 link_fd = bpf_link_create(prog_fd, 0, attach_type, &lopts); in bpf_program__attach_kprobe_multi_opts()
11699 if (link_fd < 0) { in bpf_program__attach_kprobe_multi_opts()
11705 link->fd = link_fd; in bpf_program__attach_kprobe_multi_opts()
12098 int err = 0, link_fd, prog_fd; in bpf_program__attach_uprobe_multi() local
12198 link_fd = bpf_link_create(prog_fd, 0, attach_type, &lopts); in bpf_program__attach_uprobe_multi()
12199 if (link_fd < 0) { in bpf_program__attach_uprobe_multi()
12205 link->fd = link_fd; in bpf_program__attach_uprobe_multi()
12785 int prog_fd, link_fd; in bpf_program_attach_fd() local
12799 link_fd = bpf_link_create(prog_fd, target_fd, attach_type, opts); in bpf_program_attach_fd()
12800 if (link_fd < 0) { in bpf_program_attach_fd()
12801 link_fd = -errno; in bpf_program_attach_fd()
12805 errstr(link_fd)); in bpf_program_attach_fd()
12806 return libbpf_err_ptr(link_fd); in bpf_program_attach_fd()
12808 link->fd = link_fd; in bpf_program_attach_fd()
12948 int prog_fd, link_fd; in bpf_program__attach_iter() local
12968 link_fd = bpf_link_create(prog_fd, target_fd, BPF_TRACE_ITER, in bpf_program__attach_iter()
12970 if (link_fd < 0) { in bpf_program__attach_iter()
12971 link_fd = -errno; in bpf_program__attach_iter()
12974 prog->name, errstr(link_fd)); in bpf_program__attach_iter()
12975 return libbpf_err_ptr(link_fd); in bpf_program__attach_iter()
12977 link->fd = link_fd; in bpf_program__attach_iter()
12992 int prog_fd, link_fd; in bpf_program__attach_netfilter() local
13014 link_fd = bpf_link_create(prog_fd, 0, BPF_NETFILTER, &lopts); in bpf_program__attach_netfilter()
13015 if (link_fd < 0) { in bpf_program__attach_netfilter()
13016 link_fd = -errno; in bpf_program__attach_netfilter()
13019 prog->name, errstr(link_fd)); in bpf_program__attach_netfilter()
13020 return libbpf_err_ptr(link_fd); in bpf_program__attach_netfilter()
13022 link->fd = link_fd; in bpf_program__attach_netfilter()