Home
last modified time | relevance | path

Searched refs:btf_fd (Results 1 – 20 of 20) sorted by relevance

/linux-6.6.21/tools/testing/selftests/bpf/prog_tests/
Dmodule_fentry_shadow.c59 int btf_fd[2] = {}; in test_module_fentry_shadow() local
82 btf_fd[1] = get_bpf_testmod_btf_fd(); in test_module_fentry_shadow()
83 if (!ASSERT_GE(btf_fd[1], 0, "get_bpf_testmod_btf_fd")) in test_module_fentry_shadow()
86 mod_btf = btf_get_from_fd(btf_fd[1], vmlinux_btf); in test_module_fentry_shadow()
100 load_opts.attach_btf_obj_fd = btf_fd[i]; in test_module_fentry_shadow()
126 if (btf_fd[i]) in test_module_fentry_shadow()
127 close(btf_fd[i]); in test_module_fentry_shadow()
Dsyscall.c12 int btf_fd; member
53 if (ctx.btf_fd > 0) in test_syscall()
54 close(ctx.btf_fd); in test_syscall()
Dbtf.c4303 int btf_fd; in load_raw_btf() local
4311 btf_fd = bpf_btf_load(raw_data, raw_size, &opts); in load_raw_btf()
4312 if (btf_fd < 0 && !always_log) { in load_raw_btf()
4316 btf_fd = bpf_btf_load(raw_data, raw_size, &opts); in load_raw_btf()
4319 return btf_fd; in load_raw_btf()
4326 int map_fd = -1, btf_fd = -1; in do_test_raw() local
4351 btf_fd = load_raw_btf(raw_btf, raw_btf_size); in do_test_raw()
4354 err = ((btf_fd < 0) != test->btf_load_err); in do_test_raw()
4356 btf_fd, test->btf_load_err) || in do_test_raw()
4363 if (err || btf_fd < 0) in do_test_raw()
[all …]
/linux-6.6.21/tools/lib/bpf/
Dlibbpf_probes.c232 int btf_fd, btf_len; in libbpf__load_raw_btf() local
244 btf_fd = bpf_btf_load(raw_btf, btf_len, NULL); in libbpf__load_raw_btf()
247 return btf_fd; in libbpf__load_raw_btf()
282 int fd = -1, btf_fd = -1, fd_inner = -1, exp_err = 0, err = 0; in probe_map_create() local
316 btf_fd = load_local_storage_btf(); in probe_map_create()
317 if (btf_fd < 0) in probe_map_create()
318 return btf_fd; in probe_map_create()
369 if (btf_fd >= 0) { in probe_map_create()
370 opts.btf_fd = btf_fd; in probe_map_create()
383 if (btf_fd >= 0) in probe_map_create()
[all …]
Dbpf.h43 __u32 btf_fd; member
534 LIBBPF_API int bpf_btf_get_info_by_fd(int btf_fd, struct bpf_btf_info *info, __u32 *info_len);
Dgen_loader.c35 __u32 btf_fd; member
380 emit_sys_close_stack(gen, stack_off(btf_fd)); in bpf_gen__finish()
445 emit(gen, BPF_STX_MEM(BPF_W, BPF_REG_10, BPF_REG_7, stack_off(btf_fd))); in bpf_gen__load_btf()
479 move_stack2blob(gen, attr_field(map_create_attr, btf_fd), 4, in bpf_gen__map_create()
480 stack_off(btf_fd)); in bpf_gen__map_create()
1004 stack_off(btf_fd)); in bpf_gen__prog_load()
Dbpf.c190 attr.btf_fd = OPTS_GET(opts, btf_fd, 0); in bpf_map_create()
1143 int bpf_btf_get_info_by_fd(int btf_fd, struct bpf_btf_info *info, __u32 *info_len) in bpf_btf_get_info_by_fd() argument
1145 return bpf_obj_get_info_by_fd(btf_fd, info, info_len); in bpf_btf_get_info_by_fd()
Dbtf.c1342 struct btf *btf_get_from_fd(int btf_fd, struct btf *base_btf) in btf_get_from_fd() argument
1363 err = bpf_btf_get_info_by_fd(btf_fd, &btf_info, &len); in btf_get_from_fd()
1381 err = bpf_btf_get_info_by_fd(btf_fd, &btf_info, &len); in btf_get_from_fd()
1399 int btf_fd; in btf__load_from_kernel_by_id_split() local
1401 btf_fd = bpf_btf_get_fd_by_id(id); in btf__load_from_kernel_by_id_split()
1402 if (btf_fd < 0) in btf__load_from_kernel_by_id_split()
1405 btf = btf_get_from_fd(btf_fd, base_btf); in btf__load_from_kernel_by_id_split()
1406 close(btf_fd); in btf__load_from_kernel_by_id_split()
Dlibbpf_internal.h373 struct btf *btf_get_from_fd(int btf_fd, struct btf *base_btf);
Dlibbpf.c5117 create_attr.btf_fd = btf__fd(obj->btf); in bpf_object__create_map()
5150 create_attr.btf_fd = 0; in bpf_object__create_map()
5180 create_attr.btf_fd = 0; in bpf_object__create_map()
6890 int btf_fd, ret, err; in bpf_object_load_prog() local
6916 btf_fd = bpf_object__btf_fd(obj); in bpf_object_load_prog()
6917 if (btf_fd >= 0 && kernel_supports(obj, FEAT_BTF_FUNC)) { in bpf_object_load_prog()
6918 load_attr.prog_btf_fd = btf_fd; in bpf_object_load_prog()
/linux-6.6.21/tools/testing/selftests/bpf/map_tests/
Dsk_storage_map.c26 .btf_fd = -1,
144 int btf_fd, map_fd; in create_sk_storage_map() local
146 btf_fd = load_btf(); in create_sk_storage_map()
147 CHECK(btf_fd == -1, "bpf_load_btf", "btf_fd:%d errno:%d\n", in create_sk_storage_map()
148 btf_fd, errno); in create_sk_storage_map()
149 map_opts.btf_fd = btf_fd; in create_sk_storage_map()
152 map_opts.btf_fd = -1; in create_sk_storage_map()
153 close(btf_fd); in create_sk_storage_map()
463 int btf_fd, map_fd, sk_fd, err; in test_sk_storage_map_basic() local
465 btf_fd = load_btf(); in test_sk_storage_map_basic()
[all …]
/linux-6.6.21/tools/testing/selftests/bpf/
Dtest_verifier.c753 int btf_fd; in load_btf_spec() local
772 btf_fd = bpf_btf_load(raw_btf, ptr - raw_btf, &opts); in load_btf_spec()
773 if (btf_fd < 0) in load_btf_spec()
778 return btf_fd < 0 ? -1 : btf_fd; in load_btf_spec()
807 int fd, btf_fd; in create_map_spin_lock() local
809 btf_fd = load_btf(); in create_map_spin_lock()
810 if (btf_fd < 0) in create_map_spin_lock()
812 opts.btf_fd = btf_fd; in create_map_spin_lock()
826 int fd, btf_fd; in create_sk_storage_map() local
828 btf_fd = load_btf(); in create_sk_storage_map()
[all …]
/linux-6.6.21/tools/testing/selftests/bpf/progs/
Dsyscall.c18 int btf_fd; member
93 ctx->btf_fd = ret; in bpf_prog()
95 map_create_attr.btf_fd = ret; in bpf_prog()
/linux-6.6.21/tools/bpf/bpftool/
Dbtf.c527 int btf_fd; in btf_is_kernel_module() local
531 btf_fd = bpf_btf_get_fd_by_id(btf_id); in btf_is_kernel_module()
532 if (btf_fd < 0) { in btf_is_kernel_module()
540 err = bpf_btf_get_info_by_fd(btf_fd, &btf_info, &len); in btf_is_kernel_module()
541 close(btf_fd); in btf_is_kernel_module()
/linux-6.6.21/tools/testing/selftests/bpf/benchs/
Dbench_local_storage.c137 create_opts.btf_fd = bpf_object__btf_fd(ctx.skel->obj); in __setup()
/linux-6.6.21/Documentation/bpf/
Dbtf.rst588 BPF_BTF_GET_FD_BY_ID (get btf_fd) |
601 :ref:`BTF_Type_String`, can be directly loaded into the kernel. A ``btf_fd``
607 A map can be created with ``btf_fd`` and specified key/value type id.::
609 __u32 btf_fd; /* fd pointing to a BTF type data */
/linux-6.6.21/tools/include/uapi/linux/
Dbpf.h1372 __u32 btf_fd; /* fd pointing to a BTF type data */ member
/linux-6.6.21/include/uapi/linux/
Dbpf.h1372 __u32 btf_fd; /* fd pointing to a BTF type data */ member
/linux-6.6.21/kernel/bpf/
Dverifier.c2756 int btf_fd; in __find_kfunc_desc_btf() local
2772 if (copy_from_bpfptr_offset(&btf_fd, env->fd_array, in __find_kfunc_desc_btf()
2773 offset * sizeof(btf_fd), in __find_kfunc_desc_btf()
2774 sizeof(btf_fd))) in __find_kfunc_desc_btf()
2777 btf = btf_get_by_fd(btf_fd); in __find_kfunc_desc_btf()
17344 int i, btf_fd, err; in check_pseudo_btf_id() local
17346 btf_fd = insn[1].imm; in check_pseudo_btf_id()
17347 if (btf_fd) { in check_pseudo_btf_id()
17348 btf = btf_get_by_fd(btf_fd); in check_pseudo_btf_id()
Dsyscall.c1259 btf = btf_get_by_fd(attr->btf_fd); in map_create()