Searched refs:link_fd (Results 1 - 19 of 19) sorted by relevance

/linux-master/tools/testing/selftests/bpf/prog_tests/
H A Dcore_kern.c10 int link_fd; local
16 link_fd = core_kern_lskel__core_relo_proto__attach(skel);
17 if (!ASSERT_GT(link_fd, 0, "attach(core_relo_proto)"))
H A Dperf_link.c31 int pfd = -1, link_fd = -1, err; local
51 link_fd = bpf_link_create(bpf_program__fd(skel->progs.handler), pfd,
53 if (!ASSERT_GE(link_fd, 0, "link_fd"))
57 err = bpf_link_get_info_by_fd(link_fd, &info, &info_len);
72 close(link_fd);
73 link_fd = -1;
85 if (link_fd >= 0)
86 close(link_fd);
H A Dfexit_stress.c8 int *fd, *fexit_fd, *link_fd; local
17 link_fd = fd + bpf_max_tramp_links;
43 link_fd[i] = bpf_link_create(fexit_fd[i], 0, BPF_TRACE_FEXIT, NULL);
44 if (!ASSERT_GE(link_fd[i], 0, "fexit attach"))
53 if (link_fd[i])
54 close(link_fd[i]);
H A Duprobe_multi_test.c242 int prog_fd, link_fd = -1; local
255 link_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_UPROBE_MULTI, &opts);
256 if (!ASSERT_ERR(link_fd, "link_fd"))
258 if (!ASSERT_EQ(link_fd, -E2BIG, "big cnt"))
267 link_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_UPROBE_MULTI, &opts);
268 if (!ASSERT_ERR(link_fd, "link_fd"))
270 if (!ASSERT_EQ(link_fd, -EINVAL, "cnt_is_zero"))
279 link_fd
[all...]
H A Dfexit_test.c10 int link_fd; local
19 link_fd = fexit_test_lskel__test1__attach(fexit_skel);
20 if (!ASSERT_LT(link_fd, 0, "fexit_attach_link"))
H A Dfentry_test.c10 int link_fd; local
19 link_fd = fentry_test_lskel__test1__attach(fentry_skel);
20 if (!ASSERT_LT(link_fd, 0, "fentry_attach_link"))
H A Dmodule_fentry_shadow.c61 int link_fd[2] = {}; local
114 link_fd[i] = bpf_link_create(prog_fd[i], 0, BPF_TRACE_FENTRY, NULL);
115 if (!ASSERT_GE(link_fd[i], 0, "bpf_link_create"))
130 if (link_fd[i] > 0)
131 close(link_fd[i]);
H A Drecursive_attach.c118 int err, link_fd, tgt_prog_fd; local
139 link_fd = bpf_link_create(tgt_prog_fd, 0, BPF_TRACE_FENTRY, NULL);
140 if (!ASSERT_GE(link_fd, 0, "link_fd"))
H A Dfill_link_info.c160 int link_fd, err; local
166 link_fd = bpf_link__fd(link);
171 err = verify_perf_link_info(link_fd, type, kprobe_addr, 0, entry_offset);
174 kprobe_fill_invalid_user_buffer(link_fd);
185 int link_fd, err; local
191 link_fd = bpf_link__fd(link);
192 err = verify_perf_link_info(link_fd, BPF_PERF_EVENT_TRACEPOINT, 0, 0, 0);
203 int link_fd, err, pfd; local
221 link_fd = bpf_link__fd(link);
222 err = verify_perf_link_info(link_fd, BPF_PERF_EVENT_EVEN
238 int link_fd, err; local
358 int link_fd, err; local
534 int link_fd, err; local
[all...]
H A Dbpf_obj_id.c250 int link_fd, cmp_res; local
255 link_fd = bpf_link_get_fd_by_id(next_id);
256 if (link_fd < 0 && errno == ENOENT)
259 if (!ASSERT_GE(link_fd, 0, "bpf_link_get_fd_by_id"))
271 err = bpf_link_get_info_by_fd(link_fd, &link_info, &info_len);
278 close(link_fd);
H A Dunpriv_bpf_disabled.c64 int i, nr_cpus, link_fd = -1; local
128 link_fd = bpf_link_create(bpf_program__fd(skel->progs.handle_perf_event), perf_fd,
130 ASSERT_GT(link_fd, 0, "link_create");
133 if (link_fd)
134 close(link_fd);
/linux-master/tools/lib/bpf/
H A Dfeatures.c347 int prog_fd, link_fd, err; local
357 link_fd = bpf_link_create(prog_fd, -1, BPF_PERF_EVENT, NULL);
360 if (link_fd >= 0)
361 close(link_fd);
364 return link_fd < 0 && err == -EBADF;
379 int prog_fd, link_fd, err; local
392 link_fd = bpf_link_create(prog_fd, -1, BPF_TRACE_UPROBE_MULTI, &link_opts);
395 if (link_fd >= 0)
396 close(link_fd);
399 return link_fd <
[all...]
H A Dbpf.h447 LIBBPF_API int bpf_link_detach(int link_fd);
457 LIBBPF_API int bpf_link_update(int link_fd, int new_prog_fd,
460 LIBBPF_API int bpf_iter_create(int link_fd);
567 * link corresponding to *link_fd*.
575 * @param link_fd BPF link file descriptor
583 LIBBPF_API int bpf_link_get_info_by_fd(int link_fd, struct bpf_link_info *info, __u32 *info_len);
H A Dbpf.c876 int bpf_link_detach(int link_fd) argument
883 attr.link_detach.link_fd = link_fd;
889 int bpf_link_update(int link_fd, int new_prog_fd, argument
903 attr.link_update.link_fd = link_fd;
915 int bpf_iter_create(int link_fd) argument
922 attr.iter_create.link_fd = link_fd;
1171 int bpf_link_get_info_by_fd(int link_fd, struc argument
[all...]
H A Dlibbpf.c10604 int prog_fd, link_fd = -1, err; local
10634 link_fd = bpf_link_create(prog_fd, pfd, BPF_PERF_EVENT, &link_opts);
10635 if (link_fd < 0) {
10642 link->link.fd = link_fd;
10670 if (link_fd >= 0)
10671 close(link_fd);
11332 int err, link_fd, prog_fd; local
11382 link_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_KPROBE_MULTI, &lopts);
11383 if (link_fd < 0) {
11389 link->fd = link_fd;
11753 int err = 0, link_fd, prog_fd; local
12418 int prog_fd, link_fd; local
12576 int prog_fd, link_fd; local
12620 int prog_fd, link_fd; local
[all...]
/linux-master/tools/perf/util/
H A Dbpf_counter.c402 int link_fd, diff_map_fd, err; local
424 link_fd = bpf_link__fd(link);
426 entry->link_id = bpf_link_get_id(link_fd);
/linux-master/include/uapi/linux/
H A Dbpf.h789 * Update the eBPF program in the specified *link_fd* to
839 * Create an iterator on top of the specified *link_fd* (as
846 * using the eBPF program attached to *link_fd*.
854 * Forcefully detach the specified *link_fd* from its
1776 __u32 link_fd; /* link fd */ member in struct:bpf_attr::__anon2623
1797 __u32 link_fd; member in struct:bpf_attr::__anon2626
1805 __u32 link_fd; member in struct:bpf_attr::__anon2628
/linux-master/tools/include/uapi/linux/
H A Dbpf.h789 * Update the eBPF program in the specified *link_fd* to
839 * Create an iterator on top of the specified *link_fd* (as
846 * using the eBPF program attached to *link_fd*.
854 * Forcefully detach the specified *link_fd* from its
1776 __u32 link_fd; /* link fd */ member in struct:bpf_attr::__anon3164
1797 __u32 link_fd; member in struct:bpf_attr::__anon3167
1805 __u32 link_fd; member in struct:bpf_attr::__anon3169
/linux-master/kernel/bpf/
H A Dsyscall.c5327 link = bpf_link_get_from_fd(attr->link_update.link_fd);
5369 #define BPF_LINK_DETACH_LAST_FIELD link_detach.link_fd
5379 link = bpf_link_get_from_fd(attr->link_detach.link_fd);
5530 link = bpf_link_get_from_fd(attr->iter_create.link_fd);

Completed in 313 milliseconds