/openbmc/linux/tools/testing/selftests/bpf/prog_tests/ |
H A D | perf_link.c | 31 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()
|
H A D | fexit_stress.c | 8 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()
|
H A D | fill_link_info.c | 156 int link_fd, err; in test_kprobe_fill_link_info() local 162 link_fd = bpf_link__fd(link); in test_kprobe_fill_link_info() 171 err = verify_perf_link_info(link_fd, type, kprobe_addr, 0, entry_offset); in test_kprobe_fill_link_info() 174 kprobe_fill_invalid_user_buffer(link_fd); in test_kprobe_fill_link_info() 185 int link_fd, err; in test_tp_fill_link_info() local 191 link_fd = bpf_link__fd(link); in test_tp_fill_link_info() 192 err = verify_perf_link_info(link_fd, BPF_PERF_EVENT_TRACEPOINT, 0, 0, 0); in test_tp_fill_link_info() 205 int link_fd, err; in test_uprobe_fill_link_info() local 214 link_fd = bpf_link__fd(link); in test_uprobe_fill_link_info() 215 err = verify_perf_link_info(link_fd, type, 0, uprobe_offset, 0); in test_uprobe_fill_link_info() [all …]
|
H A D | module_fentry_shadow.c | 61 int link_fd[2] = {}; in test_module_fentry_shadow() local 114 link_fd[i] = bpf_link_create(prog_fd[i], 0, BPF_TRACE_FENTRY, NULL); in test_module_fentry_shadow() 115 if (!ASSERT_GE(link_fd[i], 0, "bpf_link_create")) in test_module_fentry_shadow() 130 if (link_fd[i] > 0) in test_module_fentry_shadow() 131 close(link_fd[i]); in test_module_fentry_shadow()
|
H A D | core_kern.c | 10 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()
|
H A D | fexit_test.c | 10 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()
|
H A D | fentry_test.c | 10 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()
|
H A D | bpf_obj_id.c | 302 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()
|
H A D | unpriv_bpf_disabled.c | 64 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()
|
/openbmc/linux/tools/lib/bpf/ |
H A D | bpf.h | 427 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);
|
H A D | bpf.c | 853 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()
|
H A D | libbpf.c | 4817 int prog_fd, link_fd, err; in probe_perf_link() local 4827 link_fd = bpf_link_create(prog_fd, -1, BPF_PERF_EVENT, NULL); in probe_perf_link() 4830 if (link_fd >= 0) in probe_perf_link() 4831 close(link_fd); in probe_perf_link() 4834 return link_fd < 0 && err == -EBADF; in probe_perf_link() 4847 int prog_fd, link_fd, err; in probe_uprobe_multi_link() local 4860 link_fd = bpf_link_create(prog_fd, -1, BPF_TRACE_UPROBE_MULTI, &link_opts); in probe_uprobe_multi_link() 4863 if (link_fd >= 0) in probe_uprobe_multi_link() 4864 close(link_fd); in probe_uprobe_multi_link() 4867 return link_fd < 0 && err == -EBADF; in probe_uprobe_multi_link() [all …]
|
/openbmc/linux/tools/perf/util/ |
H A D | bpf_counter.c | 399 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()
|
/openbmc/linux/include/uapi/linux/ |
H A D | bpf.h | 1668 __u32 link_fd; /* link fd */ member 1689 __u32 link_fd; member 1697 __u32 link_fd; member
|
/openbmc/linux/tools/include/uapi/linux/ |
H A D | bpf.h | 1668 __u32 link_fd; /* link fd */ member 1689 __u32 link_fd; member 1697 __u32 link_fd; member
|
/openbmc/linux/kernel/bpf/ |
H A D | syscall.c | 5147 link = bpf_link_get_from_fd(attr->link_update.link_fd); in link_update() 5189 #define BPF_LINK_DETACH_LAST_FIELD link_detach.link_fd 5199 link = bpf_link_get_from_fd(attr->link_detach.link_fd); in link_detach() 5350 link = bpf_link_get_from_fd(attr->iter_create.link_fd); in bpf_iter_create()
|
/openbmc/linux/Documentation/bpf/ |
H A D | bpf_iterators.rst | 77 * Obtain a ``link_fd`` to the BPF program by calling the ``bpf_link_create()``
|