Lines Matching refs:link_fd
11264 int prog_fd, link_fd = -1, err; in bpf_program__attach_perf_event_opts() local
11294 link_fd = bpf_link_create(prog_fd, pfd, BPF_PERF_EVENT, &link_opts); in bpf_program__attach_perf_event_opts()
11295 if (link_fd < 0) { in bpf_program__attach_perf_event_opts()
11301 link->link.fd = link_fd; in bpf_program__attach_perf_event_opts()
11332 if (link_fd >= 0) in bpf_program__attach_perf_event_opts()
11333 close(link_fd); in bpf_program__attach_perf_event_opts()
12011 int err, link_fd, prog_fd; in bpf_program__attach_kprobe_multi_opts() local
12084 link_fd = bpf_link_create(prog_fd, 0, attach_type, &lopts); in bpf_program__attach_kprobe_multi_opts()
12085 if (link_fd < 0) { in bpf_program__attach_kprobe_multi_opts()
12091 link->fd = link_fd; in bpf_program__attach_kprobe_multi_opts()
12468 int err = 0, link_fd, prog_fd; in bpf_program__attach_uprobe_multi() local
12568 link_fd = bpf_link_create(prog_fd, 0, attach_type, &lopts); in bpf_program__attach_uprobe_multi()
12569 if (link_fd < 0) { in bpf_program__attach_uprobe_multi()
12575 link->fd = link_fd; in bpf_program__attach_uprobe_multi()
13156 int prog_fd, link_fd; in bpf_program_attach_fd() local
13170 link_fd = bpf_link_create(prog_fd, target_fd, attach_type, opts); in bpf_program_attach_fd()
13171 if (link_fd < 0) { in bpf_program_attach_fd()
13172 link_fd = -errno; in bpf_program_attach_fd()
13176 errstr(link_fd)); in bpf_program_attach_fd()
13177 return libbpf_err_ptr(link_fd); in bpf_program_attach_fd()
13179 link->fd = link_fd; in bpf_program_attach_fd()
13347 int prog_fd, link_fd; in bpf_program__attach_iter() local
13367 link_fd = bpf_link_create(prog_fd, target_fd, BPF_TRACE_ITER, in bpf_program__attach_iter()
13369 if (link_fd < 0) { in bpf_program__attach_iter()
13370 link_fd = -errno; in bpf_program__attach_iter()
13373 prog->name, errstr(link_fd)); in bpf_program__attach_iter()
13374 return libbpf_err_ptr(link_fd); in bpf_program__attach_iter()
13376 link->fd = link_fd; in bpf_program__attach_iter()
13391 int prog_fd, link_fd; in bpf_program__attach_netfilter() local
13413 link_fd = bpf_link_create(prog_fd, 0, BPF_NETFILTER, &lopts); in bpf_program__attach_netfilter()
13414 if (link_fd < 0) { in bpf_program__attach_netfilter()
13415 link_fd = -errno; in bpf_program__attach_netfilter()
13418 prog->name, errstr(link_fd)); in bpf_program__attach_netfilter()
13419 return libbpf_err_ptr(link_fd); in bpf_program__attach_netfilter()
13421 link->fd = link_fd; in bpf_program__attach_netfilter()