Home
last modified time | relevance | path

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

/linux-6.12.1/tools/testing/selftests/bpf/prog_tests/
Dmodule_fentry_shadow.c60 int btf_fd[2] = {}; in test_module_fentry_shadow() local
83 btf_fd[1] = get_bpf_testmod_btf_fd(); in test_module_fentry_shadow()
84 if (!ASSERT_GE(btf_fd[1], 0, "get_bpf_testmod_btf_fd")) in test_module_fentry_shadow()
87 mod_btf = btf_get_from_fd(btf_fd[1], vmlinux_btf); in test_module_fentry_shadow()
101 load_opts.attach_btf_obj_fd = btf_fd[i]; in test_module_fentry_shadow()
127 if (btf_fd[i]) in test_module_fentry_shadow()
128 close(btf_fd[i]); in test_module_fentry_shadow()
Dcore_reloc_raw.c73 int btf_fd = -1; in test_bad_local_id() local
75 btf_fd = bpf_btf_load(&raw_btf, sizeof(raw_btf), &opts); in test_bad_local_id()
77 if (btf_fd < 0 || env.verbosity > VERBOSE_NORMAL) { in test_bad_local_id()
82 if (btf_fd < 0) { in test_bad_local_id()
89 attr.prog_btf_fd = btf_fd; in test_bad_local_id()
118 close(btf_fd); in test_bad_local_id()
Dsyscall.c12 int btf_fd; member
53 if (ctx.btf_fd > 0) in test_syscall_load_prog()
54 close(ctx.btf_fd); in test_syscall_load_prog()
Dbtf.c4363 int btf_fd; in load_raw_btf() local
4371 btf_fd = bpf_btf_load(raw_data, raw_size, &opts); in load_raw_btf()
4372 if (btf_fd < 0 && !always_log) { in load_raw_btf()
4376 btf_fd = bpf_btf_load(raw_data, raw_size, &opts); in load_raw_btf()
4379 return btf_fd; in load_raw_btf()
4386 int map_fd = -1, btf_fd = -1; in do_test_raw() local
4411 btf_fd = load_raw_btf(raw_btf, raw_btf_size); in do_test_raw()
4414 err = ((btf_fd < 0) != test->btf_load_err); in do_test_raw()
4416 btf_fd, test->btf_load_err) || in do_test_raw()
4423 if (err || btf_fd < 0) in do_test_raw()
[all …]
Dtoken.c569 int err, token_fd = -1, btf_fd = -1; in userns_btf_load() local
604 btf_fd = bpf_btf_load(raw_btf_data, raw_btf_size, &btf_opts); in userns_btf_load()
605 if (!ASSERT_LT(btf_fd, 0, "no_token_no_cap_should_fail")) in userns_btf_load()
611 btf_fd = bpf_btf_load(raw_btf_data, raw_btf_size, &btf_opts); in userns_btf_load()
612 if (!ASSERT_LT(btf_fd, 0, "token_no_cap_should_fail")) in userns_btf_load()
623 btf_fd = bpf_btf_load(raw_btf_data, raw_btf_size, &btf_opts); in userns_btf_load()
624 if (!ASSERT_GT(btf_fd, 0, "token_and_cap_success")) in userns_btf_load()
630 zclose(btf_fd); in userns_btf_load()
/linux-6.12.1/tools/lib/bpf/
Dlibbpf_probes.c237 int btf_fd, btf_len; in libbpf__load_raw_btf() local
249 btf_fd = bpf_btf_load(raw_btf, btf_len, &opts); in libbpf__load_raw_btf()
252 return btf_fd; in libbpf__load_raw_btf()
287 int fd = -1, btf_fd = -1, fd_inner = -1, exp_err = 0, err = 0; in probe_map_create() local
321 btf_fd = load_local_storage_btf(); in probe_map_create()
322 if (btf_fd < 0) in probe_map_create()
323 return btf_fd; in probe_map_create()
382 if (btf_fd >= 0) { in probe_map_create()
383 opts.btf_fd = btf_fd; in probe_map_create()
396 if (btf_fd >= 0) in probe_map_create()
[all …]
Dfeatures.c496 int prog_fd, btf_fd, insn_cnt = ARRAY_SIZE(insns); in probe_kern_arg_ctx_tag() local
498 btf_fd = libbpf__load_raw_btf((char *)types, sizeof(types), strs, sizeof(strs), token_fd); in probe_kern_arg_ctx_tag()
499 if (btf_fd < 0) in probe_kern_arg_ctx_tag()
502 opts.prog_btf_fd = btf_fd; in probe_kern_arg_ctx_tag()
509 close(btf_fd); in probe_kern_arg_ctx_tag()
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.h43 __u32 btf_fd; member
563 LIBBPF_API int bpf_btf_get_info_by_fd(int btf_fd, struct bpf_btf_info *info, __u32 *info_len);
Dbpf.c193 attr.btf_fd = OPTS_GET(opts, btf_fd, 0); in bpf_map_create()
1168 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
1170 return bpf_obj_get_info_by_fd(btf_fd, info, info_len); in bpf_btf_get_info_by_fd()
Dbtf.c1566 struct btf *btf_get_from_fd(int btf_fd, struct btf *base_btf) in btf_get_from_fd() argument
1587 err = bpf_btf_get_info_by_fd(btf_fd, &btf_info, &len); in btf_get_from_fd()
1605 err = bpf_btf_get_info_by_fd(btf_fd, &btf_info, &len); in btf_get_from_fd()
1623 int btf_fd; in btf__load_from_kernel_by_id_split() local
1625 btf_fd = bpf_btf_get_fd_by_id(id); in btf__load_from_kernel_by_id_split()
1626 if (btf_fd < 0) in btf__load_from_kernel_by_id_split()
1629 btf = btf_get_from_fd(btf_fd, base_btf); in btf__load_from_kernel_by_id_split()
1630 close(btf_fd); in btf__load_from_kernel_by_id_split()
Dlibbpf_internal.h412 struct btf *btf_get_from_fd(int btf_fd, struct btf *base_btf);
Dlibbpf.c5162 create_attr.btf_fd = btf__fd(obj->btf); in bpf_object__create_map()
5199 create_attr.btf_fd = 0; in bpf_object__create_map()
5235 create_attr.btf_fd = 0; in bpf_object__create_map()
/linux-6.12.1/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.12.1/tools/testing/selftests/bpf/
Dtest_verifier.c755 int btf_fd; in load_btf_spec() local
774 btf_fd = bpf_btf_load(raw_btf, ptr - raw_btf, &opts); in load_btf_spec()
775 if (btf_fd < 0) in load_btf_spec()
780 return btf_fd < 0 ? -1 : btf_fd; in load_btf_spec()
809 int fd, btf_fd; in create_map_spin_lock() local
811 btf_fd = load_btf(); in create_map_spin_lock()
812 if (btf_fd < 0) in create_map_spin_lock()
814 opts.btf_fd = btf_fd; in create_map_spin_lock()
828 int fd, btf_fd; in create_sk_storage_map() local
830 btf_fd = load_btf(); in create_sk_storage_map()
[all …]
/linux-6.12.1/tools/testing/selftests/bpf/progs/
Dsyscall.c25 int btf_fd; member
131 ctx->btf_fd = ret; in load_prog()
133 map_create_attr.btf_fd = ret; in load_prog()
/linux-6.12.1/tools/bpf/bpftool/
Dbtf.c778 int btf_fd; in btf_is_kernel_module() local
782 btf_fd = bpf_btf_get_fd_by_id(btf_id); in btf_is_kernel_module()
783 if (btf_fd < 0) { in btf_is_kernel_module()
791 err = bpf_btf_get_info_by_fd(btf_fd, &btf_info, &len); in btf_is_kernel_module()
792 close(btf_fd); in btf_is_kernel_module()
/linux-6.12.1/tools/testing/selftests/bpf/benchs/
Dbench_local_storage.c137 create_opts.btf_fd = bpf_object__btf_fd(ctx.skel->obj); in __setup()
/linux-6.12.1/Documentation/bpf/
Dbtf.rst617 BPF_BTF_GET_FD_BY_ID (get btf_fd) |
630 :ref:`BTF_Type_String`, can be directly loaded into the kernel. A ``btf_fd``
636 A map can be created with ``btf_fd`` and specified key/value type id.::
638 __u32 btf_fd; /* fd pointing to a BTF type data */
/linux-6.12.1/include/uapi/linux/
Dbpf.h1476 __u32 btf_fd; /* fd pointing to a BTF type data */ member
/linux-6.12.1/tools/include/uapi/linux/
Dbpf.h1476 __u32 btf_fd; /* fd pointing to a BTF type data */ member
/linux-6.12.1/kernel/bpf/
Dverifier.c2709 int btf_fd; in __find_kfunc_desc_btf() local
2725 if (copy_from_bpfptr_offset(&btf_fd, env->fd_array, in __find_kfunc_desc_btf()
2726 offset * sizeof(btf_fd), in __find_kfunc_desc_btf()
2727 sizeof(btf_fd))) in __find_kfunc_desc_btf()
2730 btf = btf_get_by_fd(btf_fd); in __find_kfunc_desc_btf()
18703 int i, btf_fd, err; in check_pseudo_btf_id() local
18705 btf_fd = insn[1].imm; in check_pseudo_btf_id()
18706 if (btf_fd) { in check_pseudo_btf_id()
18707 btf = btf_get_by_fd(btf_fd); in check_pseudo_btf_id()
Dsyscall.c1369 btf = btf_get_by_fd(attr->btf_fd); in map_create()