Home
last modified time | relevance | path

Searched refs:link_fd (Results 1 – 17 of 17) sorted by relevance

/Linux-v6.6/tools/testing/selftests/bpf/prog_tests/
Dperf_link.c31 int pfd = -1, link_fd = -1, err; in serial_test_perf_link() local
51 link_fd = bpf_link_create(bpf_program__fd(skel->progs.handler), pfd, in serial_test_perf_link()
53 if (!ASSERT_GE(link_fd, 0, "link_fd")) in serial_test_perf_link()
57 err = bpf_link_get_info_by_fd(link_fd, &info, &info_len); in serial_test_perf_link()
72 close(link_fd); in serial_test_perf_link()
73 link_fd = -1; in serial_test_perf_link()
85 if (link_fd >= 0) in serial_test_perf_link()
86 close(link_fd); in serial_test_perf_link()
Dfexit_stress.c8 int *fd, *fexit_fd, *link_fd; in serial_test_fexit_stress() local
17 link_fd = fd + bpf_max_tramp_links; in serial_test_fexit_stress()
43 link_fd[i] = bpf_link_create(fexit_fd[i], 0, BPF_TRACE_FEXIT, NULL); in serial_test_fexit_stress()
44 if (!ASSERT_GE(link_fd[i], 0, "fexit attach")) in serial_test_fexit_stress()
53 if (link_fd[i]) in serial_test_fexit_stress()
54 close(link_fd[i]); in serial_test_fexit_stress()
Dfill_link_info.c143 int link_fd, err; in test_kprobe_fill_link_info() local
150 link_fd = bpf_link__fd(skel->links.kprobe_run); in test_kprobe_fill_link_info()
155 err = verify_perf_link_info(link_fd, type, kprobe_addr, 0, entry_offset); in test_kprobe_fill_link_info()
158 kprobe_fill_invalid_user_buffer(link_fd); in test_kprobe_fill_link_info()
165 int link_fd, err; in test_tp_fill_link_info() local
171 link_fd = bpf_link__fd(skel->links.tp_run); in test_tp_fill_link_info()
172 err = verify_perf_link_info(link_fd, BPF_PERF_EVENT_TRACEPOINT, 0, 0, 0); in test_tp_fill_link_info()
180 int link_fd, err; in test_uprobe_fill_link_info() local
189 link_fd = bpf_link__fd(skel->links.uprobe_run); in test_uprobe_fill_link_info()
190 err = verify_perf_link_info(link_fd, type, 0, uprobe_offset, 0); in test_uprobe_fill_link_info()
[all …]
Dmodule_fentry_shadow.c61 int link_fd[2] = {}; in test_module_fentry_shadow() local
109 link_fd[i] = bpf_link_create(prog_fd[i], 0, BPF_TRACE_FENTRY, NULL); in test_module_fentry_shadow()
110 if (!ASSERT_GE(link_fd[i], 0, "bpf_link_create")) in test_module_fentry_shadow()
125 if (link_fd[i] > 0) in test_module_fentry_shadow()
126 close(link_fd[i]); in test_module_fentry_shadow()
Dcore_kern.c10 int link_fd; in test_core_kern_lskel() local
16 link_fd = core_kern_lskel__core_relo_proto__attach(skel); in test_core_kern_lskel()
17 if (!ASSERT_GT(link_fd, 0, "attach(core_relo_proto)")) in test_core_kern_lskel()
Dfentry_test.c10 int link_fd; in fentry_test_common() local
19 link_fd = fentry_test_lskel__test1__attach(fentry_skel); in fentry_test_common()
20 if (!ASSERT_LT(link_fd, 0, "fentry_attach_link")) in fentry_test_common()
Dfexit_test.c10 int link_fd; in fexit_test_common() local
19 link_fd = fexit_test_lskel__test1__attach(fexit_skel); in fexit_test_common()
20 if (!ASSERT_LT(link_fd, 0, "fexit_attach_link")) in fexit_test_common()
Dbpf_obj_id.c302 int link_fd, cmp_res; in serial_test_bpf_obj_id() local
307 link_fd = bpf_link_get_fd_by_id(next_id); in serial_test_bpf_obj_id()
308 if (link_fd < 0 && errno == ENOENT) in serial_test_bpf_obj_id()
311 if (CHECK(link_fd < 0, "get-link-fd(next_id)", in serial_test_bpf_obj_id()
313 link_fd, next_id, errno)) in serial_test_bpf_obj_id()
325 err = bpf_link_get_info_by_fd(link_fd, &link_info, &info_len); in serial_test_bpf_obj_id()
334 close(link_fd); in serial_test_bpf_obj_id()
Dunpriv_bpf_disabled.c64 int i, nr_cpus, link_fd = -1; in test_unpriv_bpf_disabled_positive() local
128 link_fd = bpf_link_create(bpf_program__fd(skel->progs.handle_perf_event), perf_fd, in test_unpriv_bpf_disabled_positive()
130 ASSERT_GT(link_fd, 0, "link_create"); in test_unpriv_bpf_disabled_positive()
133 if (link_fd) in test_unpriv_bpf_disabled_positive()
134 close(link_fd); in test_unpriv_bpf_disabled_positive()
/Linux-v6.6/tools/lib/bpf/
Dbpf.h427 LIBBPF_API int bpf_link_detach(int link_fd);
437 LIBBPF_API int bpf_link_update(int link_fd, int new_prog_fd,
440 LIBBPF_API int bpf_iter_create(int link_fd);
551 LIBBPF_API int bpf_link_get_info_by_fd(int link_fd, struct bpf_link_info *info, __u32 *info_len);
Dbpf.c853 int bpf_link_detach(int link_fd) in bpf_link_detach() argument
860 attr.link_detach.link_fd = link_fd; in bpf_link_detach()
866 int bpf_link_update(int link_fd, int new_prog_fd, in bpf_link_update() argument
880 attr.link_update.link_fd = link_fd; in bpf_link_update()
892 int bpf_iter_create(int link_fd) in bpf_iter_create() argument
899 attr.iter_create.link_fd = link_fd; in bpf_iter_create()
1148 int bpf_link_get_info_by_fd(int link_fd, struct bpf_link_info *info, __u32 *info_len) in bpf_link_get_info_by_fd() argument
1150 return bpf_obj_get_info_by_fd(link_fd, info, info_len); in bpf_link_get_info_by_fd()
Dlibbpf.c4814 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()
[all …]
/Linux-v6.6/tools/perf/util/
Dbpf_counter.c399 int link_fd, diff_map_fd, err; in bperf_reload_leader_program() local
421 link_fd = bpf_link__fd(link); in bperf_reload_leader_program()
423 entry->link_id = bpf_link_get_id(link_fd); in bperf_reload_leader_program()
/Linux-v6.6/tools/include/uapi/linux/
Dbpf.h1651 __u32 link_fd; /* link fd */ member
1672 __u32 link_fd; member
1680 __u32 link_fd; member
/Linux-v6.6/include/uapi/linux/
Dbpf.h1651 __u32 link_fd; /* link fd */ member
1672 __u32 link_fd; member
1680 __u32 link_fd; member
/Linux-v6.6/kernel/bpf/
Dsyscall.c5030 link = bpf_link_get_from_fd(attr->link_update.link_fd); in link_update()
5072 #define BPF_LINK_DETACH_LAST_FIELD link_detach.link_fd
5082 link = bpf_link_get_from_fd(attr->link_detach.link_fd); in link_detach()
5233 link = bpf_link_get_from_fd(attr->iter_create.link_fd); in bpf_iter_create()
/Linux-v6.6/Documentation/bpf/
Dbpf_iterators.rst77 * Obtain a ``link_fd`` to the BPF program by calling the ``bpf_link_create()``