Lines Matching refs:link_fd

4814 	int prog_fd, link_fd, err;  in probe_perf_link()  local
4824 link_fd = bpf_link_create(prog_fd, -1, BPF_PERF_EVENT, NULL); in probe_perf_link()
4827 if (link_fd >= 0) in probe_perf_link()
4828 close(link_fd); in probe_perf_link()
4831 return link_fd < 0 && err == -EBADF; in probe_perf_link()
4844 int prog_fd, link_fd, err; in probe_uprobe_multi_link() local
4857 link_fd = bpf_link_create(prog_fd, -1, BPF_TRACE_UPROBE_MULTI, &link_opts); in probe_uprobe_multi_link()
4860 if (link_fd >= 0) in probe_uprobe_multi_link()
4861 close(link_fd); in probe_uprobe_multi_link()
4864 return link_fd < 0 && err == -EBADF; in probe_uprobe_multi_link()
10107 int prog_fd, link_fd = -1, err; in bpf_program__attach_perf_event_opts() local
10137 link_fd = bpf_link_create(prog_fd, pfd, BPF_PERF_EVENT, &link_opts); in bpf_program__attach_perf_event_opts()
10138 if (link_fd < 0) { in bpf_program__attach_perf_event_opts()
10145 link->link.fd = link_fd; in bpf_program__attach_perf_event_opts()
10173 if (link_fd >= 0) in bpf_program__attach_perf_event_opts()
10174 close(link_fd); in bpf_program__attach_perf_event_opts()
10835 int err, link_fd, prog_fd; in bpf_program__attach_kprobe_multi_opts() local
10885 link_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_KPROBE_MULTI, &lopts); in bpf_program__attach_kprobe_multi_opts()
10886 if (link_fd < 0) { in bpf_program__attach_kprobe_multi_opts()
10892 link->fd = link_fd; in bpf_program__attach_kprobe_multi_opts()
11256 int err = 0, link_fd, prog_fd; in bpf_program__attach_uprobe_multi() local
11343 link_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_UPROBE_MULTI, &lopts); in bpf_program__attach_uprobe_multi()
11344 if (link_fd < 0) { in bpf_program__attach_uprobe_multi()
11350 link->fd = link_fd; in bpf_program__attach_uprobe_multi()
11911 int prog_fd, link_fd; in bpf_program_attach_fd() local
11925 link_fd = bpf_link_create(prog_fd, target_fd, attach_type, opts); in bpf_program_attach_fd()
11926 if (link_fd < 0) { in bpf_program_attach_fd()
11927 link_fd = -errno; in bpf_program_attach_fd()
11931 libbpf_strerror_r(link_fd, errmsg, sizeof(errmsg))); in bpf_program_attach_fd()
11932 return libbpf_err_ptr(link_fd); in bpf_program_attach_fd()
11934 link->fd = link_fd; in bpf_program_attach_fd()
12035 int prog_fd, link_fd; in bpf_program__attach_iter() local
12055 link_fd = bpf_link_create(prog_fd, target_fd, BPF_TRACE_ITER, in bpf_program__attach_iter()
12057 if (link_fd < 0) { in bpf_program__attach_iter()
12058 link_fd = -errno; in bpf_program__attach_iter()
12061 prog->name, libbpf_strerror_r(link_fd, errmsg, sizeof(errmsg))); in bpf_program__attach_iter()
12062 return libbpf_err_ptr(link_fd); in bpf_program__attach_iter()
12064 link->fd = link_fd; in bpf_program__attach_iter()
12079 int prog_fd, link_fd; in bpf_program__attach_netfilter() local
12101 link_fd = bpf_link_create(prog_fd, 0, BPF_NETFILTER, &lopts); in bpf_program__attach_netfilter()
12102 if (link_fd < 0) { in bpf_program__attach_netfilter()
12105 link_fd = -errno; in bpf_program__attach_netfilter()
12108 prog->name, libbpf_strerror_r(link_fd, errmsg, sizeof(errmsg))); in bpf_program__attach_netfilter()
12109 return libbpf_err_ptr(link_fd); in bpf_program__attach_netfilter()
12111 link->fd = link_fd; in bpf_program__attach_netfilter()