| /tools/testing/selftests/bpf/prog_tests/ |
| A D | cgroup_getset_retval.c | 21 struct cgroup_getset_retval_setsockopt *obj; in test_setsockopt_set() local 25 if (!ASSERT_OK_PTR(obj, "skel-load")) in test_setsockopt_set() 28 obj->bss->page_size = sysconf(_SC_PAGESIZE); in test_setsockopt_set() 61 if (!ASSERT_OK_PTR(obj, "skel-load")) in test_setsockopt_set_and_get() 104 if (!ASSERT_OK_PTR(obj, "skel-load")) in test_setsockopt_default_zero() 140 if (!ASSERT_OK_PTR(obj, "skel-load")) in test_setsockopt_default_zero_and_set() 185 if (!ASSERT_OK_PTR(obj, "skel-load")) in test_setsockopt_override() 234 if (!ASSERT_OK_PTR(obj, "skel-load")) in test_setsockopt_legacy_eperm() 280 if (!ASSERT_OK_PTR(obj, "skel-load")) in test_setsockopt_legacy_no_override() 333 if (!ASSERT_OK_PTR(obj, "skel-load")) in test_getsockopt_get() [all …]
|
| A D | metadata.c | 68 struct metadata_unused *obj; in test_metadata_unused() local 71 obj = metadata_unused__open_and_load(); in test_metadata_unused() 76 bpf_map__fd(obj->maps.rodata)); in test_metadata_unused() 84 sizeof(obj->rodata->bpf_metadata_a)), in test_metadata_unused() 93 bpf_map__fd(obj->maps.rodata), NULL); in test_metadata_unused() 97 metadata_unused__destroy(obj); in test_metadata_unused() 102 struct metadata_used *obj; in test_metadata_used() local 105 obj = metadata_used__open_and_load(); in test_metadata_used() 110 bpf_map__fd(obj->maps.rodata)); in test_metadata_used() 127 bpf_map__fd(obj->maps.rodata), NULL); in test_metadata_used() [all …]
|
| A D | pinning.c | 38 struct bpf_object *obj; in test_pinning() local 49 obj = NULL; in test_pinning() 57 obj = NULL; in test_pinning() 86 bpf_object__close(obj); in test_pinning() 90 obj = NULL; in test_pinning() 165 bpf_object__close(obj); in test_pinning() 171 obj = NULL; in test_pinning() 207 bpf_object__close(obj); in test_pinning() 212 obj = NULL; in test_pinning() 240 obj = NULL; in test_pinning() [all …]
|
| A D | cg_storage_multi.c | 90 struct cg_storage_multi_egress_only *obj; in test_egress_only() local 114 if (CHECK(obj->bss->invocations != 1, in test_egress_only() 137 if (CHECK(obj->bss->invocations != 3, in test_egress_only() 160 struct cg_storage_multi_isolated *obj; in test_isolated() local 192 if (CHECK(obj->bss->invocations != 3, in test_isolated() 234 if (CHECK(obj->bss->invocations != 9, in test_isolated() 268 cg_storage_multi_isolated__destroy(obj); in test_isolated() 273 struct cg_storage_multi_shared *obj; in test_shared() local 305 if (CHECK(obj->bss->invocations != 3, in test_shared() 339 if (CHECK(obj->bss->invocations != 9, in test_shared() [all …]
|
| A D | subskeleton.c | 8 static void subskeleton_lib_setup(struct bpf_object *obj) in subskeleton_lib_setup() argument 61 subskeleton_lib_setup(skel->obj); in subtest_skel_subskeleton() 74 result = subskeleton_lib_subresult(skel->obj) * 10; in subtest_skel_subskeleton() 87 struct bpf_object *obj; in subtest_obj_subskeleton() local 99 if (!ASSERT_OK_PTR(obj, "obj_open_mem")) in subtest_obj_subskeleton() 102 map = bpf_object__find_map_by_name(obj, ".rodata"); in subtest_obj_subskeleton() 112 subskeleton_lib_setup(obj); in subtest_obj_subskeleton() 114 err = bpf_object__load(obj); in subtest_obj_subskeleton() 129 map = bpf_object__find_map_by_name(obj, ".bss"); in subtest_obj_subskeleton() 137 result = subskeleton_lib_subresult(obj) * 10; in subtest_obj_subskeleton() [all …]
|
| A D | reference_tracking.c | 12 struct bpf_object *obj_iter, *obj = NULL; in test_reference_tracking() local 34 obj = bpf_object__open_file(file, &open_opts); in test_reference_tracking() 35 if (!ASSERT_OK_PTR(obj, "obj_open_file")) in test_reference_tracking() 41 p = bpf_object__find_program_by_name(obj, name); in test_reference_tracking() 49 err = !bpf_object__load(obj); in test_reference_tracking() 52 err = bpf_object__load(obj); in test_reference_tracking() 56 bpf_object__close(obj); in test_reference_tracking() 57 obj = NULL; in test_reference_tracking() 61 bpf_object__close(obj); in test_reference_tracking()
|
| A D | global_data.c | 10 map_fd = bpf_find_map(__func__, obj, "result_number"); in test_global_data_number() 45 map_fd = bpf_find_map(__func__, obj, "result_string"); in test_global_data_string() 80 map_fd = bpf_find_map(__func__, obj, "result_struct"); in test_global_data_struct() 109 map = bpf_object__find_map_by_name(obj, "test_glo.rodata"); in test_global_data_rdonly() 116 map2 = bpf_object__find_map_by_name(obj, ".rodata"); in test_global_data_rdonly() 135 struct bpf_object *obj; in test_global_data() local 151 test_global_data_number(obj, topts.duration); in test_global_data() 152 test_global_data_string(obj, topts.duration); in test_global_data() 153 test_global_data_struct(obj, topts.duration); in test_global_data() 154 test_global_data_rdonly(obj, topts.duration); in test_global_data() [all …]
|
| A D | xdp_adjust_tail.c | 9 struct bpf_object *obj; in test_xdp_adjust_tail_shrink() local 37 bpf_object__close(obj); in test_xdp_adjust_tail_shrink() 43 struct bpf_object *obj; in test_xdp_adjust_tail_grow() local 77 bpf_object__close(obj); in test_xdp_adjust_tail_grow() 84 struct bpf_object *obj; in test_xdp_adjust_tail_grow2() local 146 bpf_object__close(obj); in test_xdp_adjust_tail_grow2() 154 struct bpf_object *obj; in test_xdp_adjust_frags_tail_shrink() local 213 bpf_object__close(obj); in test_xdp_adjust_frags_tail_shrink() 221 struct bpf_object *obj; in test_xdp_adjust_frags_tail_grow_4k() local 284 bpf_object__close(obj); in test_xdp_adjust_frags_tail_grow_4k() [all …]
|
| A D | stacktrace_map.c | 12 struct bpf_object *obj; in test_stacktrace_map() local 15 err = bpf_prog_test_load(file, BPF_PROG_TYPE_TRACEPOINT, &obj, &prog_fd); in test_stacktrace_map() 19 prog = bpf_object__find_program_by_name(obj, prog_name); in test_stacktrace_map() 28 control_map_fd = bpf_find_map(__func__, obj, "control_map"); in test_stacktrace_map() 32 stackid_hmap_fd = bpf_find_map(__func__, obj, "stackid_hmap"); in test_stacktrace_map() 36 stackmap_fd = bpf_find_map(__func__, obj, "stackmap"); in test_stacktrace_map() 40 stack_amap_fd = bpf_find_map(__func__, obj, "stack_amap"); in test_stacktrace_map() 74 bpf_object__close(obj); in test_stacktrace_map()
|
| A D | prepare.c | 8 static bool check_prepared(struct bpf_object *obj) in check_prepared() argument 13 bpf_object__for_each_map(map, obj) { in check_prepared() 34 if (!ASSERT_FALSE(check_prepared(skel->obj), "not check_prepared")) in test_prepare_no_load() 37 err = bpf_object__prepare(skel->obj); in test_prepare_no_load() 39 if (!ASSERT_TRUE(check_prepared(skel->obj), "check_prepared")) in test_prepare_no_load() 62 if (!ASSERT_FALSE(check_prepared(skel->obj), "not check_prepared")) in test_prepare_load() 65 err = bpf_object__prepare(skel->obj); in test_prepare_load() 73 if (!ASSERT_TRUE(check_prepared(skel->obj), "check_prepared")) in test_prepare_load()
|
| A D | stacktrace_map_raw_tp.c | 12 struct bpf_object *obj; in test_stacktrace_map_raw_tp() local 15 err = bpf_prog_test_load(file, BPF_PROG_TYPE_RAW_TRACEPOINT, &obj, &prog_fd); in test_stacktrace_map_raw_tp() 19 prog = bpf_object__find_program_by_name(obj, prog_name); in test_stacktrace_map_raw_tp() 28 control_map_fd = bpf_find_map(__func__, obj, "control_map"); in test_stacktrace_map_raw_tp() 32 stackid_hmap_fd = bpf_find_map(__func__, obj, "stackid_hmap"); in test_stacktrace_map_raw_tp() 36 stackmap_fd = bpf_find_map(__func__, obj, "stackmap"); in test_stacktrace_map_raw_tp() 63 bpf_object__close(obj); in test_stacktrace_map_raw_tp()
|
| A D | trampoline_count.c | 6 struct bpf_object *obj; member 12 struct bpf_object *obj; in load_prog() local 16 obj = bpf_object__open_file(file, NULL); in load_prog() 17 if (!ASSERT_OK_PTR(obj, "obj_open_file")) in load_prog() 20 inst->obj = obj; in load_prog() 22 err = bpf_object__load(obj); in load_prog() 26 prog = bpf_object__find_program_by_name(obj, name); in load_prog() 97 bpf_object__close(inst[i].obj); in serial_test_trampoline_count()
|
| A D | test_overhead.c | 67 struct bpf_object *obj; in test_test_overhead() local 75 obj = bpf_object__open_file("./test_overhead.bpf.o", NULL); in test_test_overhead() 76 if (!ASSERT_OK_PTR(obj, "obj_open_file")) in test_test_overhead() 79 kprobe_prog = bpf_object__find_program_by_name(obj, kprobe_name); in test_test_overhead() 83 kretprobe_prog = bpf_object__find_program_by_name(obj, kretprobe_name); in test_test_overhead() 87 raw_tp_prog = bpf_object__find_program_by_name(obj, raw_tp_name); in test_test_overhead() 91 fentry_prog = bpf_object__find_program_by_name(obj, fentry_name); in test_test_overhead() 95 fexit_prog = bpf_object__find_program_by_name(obj, fexit_name); in test_test_overhead() 99 err = bpf_object__load(obj); in test_test_overhead() 147 bpf_object__close(obj); in test_test_overhead()
|
| A D | global_func_args.c | 7 static void test_global_func_args0(struct bpf_object *obj) in test_global_func_args0() argument 12 map_fd = bpf_find_map(__func__, obj, map_name); in test_global_func_args0() 43 struct bpf_object *obj; in test_global_func_args() local 51 err = bpf_prog_test_load(file, BPF_PROG_TYPE_CGROUP_SKB, &obj, &prog_fd); in test_global_func_args() 59 test_global_func_args0(obj); in test_global_func_args() 61 bpf_object__close(obj); in test_global_func_args()
|
| A D | tailcalls.c | 21 struct bpf_object *obj; in test_tailcall_1() local 145 bpf_object__close(obj); in test_tailcall_1() 157 struct bpf_object *obj; in test_tailcall_2() local 225 bpf_object__close(obj); in test_tailcall_2() 389 bpf_object__close(obj); in test_tailcall_count() 417 struct bpf_object *obj; in test_tailcall_4() local 496 bpf_object__close(obj); in test_tailcall_4() 606 &obj, &prog_fd); in test_tailcall_bpf2bpf_1() 690 &obj, &prog_fd); in test_tailcall_bpf2bpf_2() 770 &obj, &prog_fd); in test_tailcall_bpf2bpf_3() [all …]
|
| /tools/bpf/resolve_btfids/ |
| A D | main.c | 437 scn = elf_getscn(obj->efile.elf, obj->efile.symbols_shndx); in symbols_collect() 461 name = elf_strptr(obj->efile.elf, obj->efile.strtabidx, in symbols_collect() 479 obj->nr_unions++; in symbols_collect() 487 obj->nr_funcs++; in symbols_collect() 553 btf = btf__parse_split(obj->btf ?: obj->path, base_btf); in symbols_resolve() 557 obj->btf ?: obj->path, strerror(-err)); in symbols_resolve() 745 if (__symbols_patch(obj, &obj->structs) || in symbols_patch() 746 __symbols_patch(obj, &obj->unions) || in symbols_patch() 747 __symbols_patch(obj, &obj->typedefs) || in symbols_patch() 748 __symbols_patch(obj, &obj->funcs) || in symbols_patch() [all …]
|
| /tools/build/ |
| A D | Makefile.build | 34 obj-y := 36 subdir-obj-y := 79 ifneq ($(filter $(obj),$(hostprogs)),) 122 obj-y := $($(obj)-y) 124 obj-y := $(patsubst %/, %/$(obj)-in.o, $(obj-y)) 125 subdir-obj-y := $(filter %/$(obj)-in.o, $(obj-y)) 129 obj-y := $(addprefix $(objprefix),$(obj-y)) 130 subdir-obj-y := $(addprefix $(objprefix),$(subdir-obj-y)) 134 obj-y := $(filter-out %_log, $(obj-y)) 137 in-target := $(objprefix)$(obj)-in.o [all …]
|
| /tools/testing/selftests/livepatch/test_modules/ |
| A D | test_klp_callbacks_demo2.c | 23 if (obj->mod) in callback_info() 24 pr_info("%s: %s -> %s\n", callback, obj->mod->name, in callback_info() 25 module_state[obj->mod->state]); in callback_info() 31 static int pre_patch_callback(struct klp_object *obj) in pre_patch_callback() argument 33 callback_info(__func__, obj); in pre_patch_callback() 38 static void post_patch_callback(struct klp_object *obj) in post_patch_callback() argument 40 callback_info(__func__, obj); in post_patch_callback() 44 static void pre_unpatch_callback(struct klp_object *obj) in pre_unpatch_callback() argument 46 callback_info(__func__, obj); in pre_unpatch_callback() 50 static void post_unpatch_callback(struct klp_object *obj) in post_unpatch_callback() argument [all …]
|
| A D | test_klp_callbacks_demo.c | 23 if (obj->mod) in callback_info() 24 pr_info("%s: %s -> %s\n", callback, obj->mod->name, in callback_info() 25 module_state[obj->mod->state]); in callback_info() 31 static int pre_patch_callback(struct klp_object *obj) in pre_patch_callback() argument 33 callback_info(__func__, obj); in pre_patch_callback() 38 static void post_patch_callback(struct klp_object *obj) in post_patch_callback() argument 40 callback_info(__func__, obj); in post_patch_callback() 44 static void pre_unpatch_callback(struct klp_object *obj) in pre_unpatch_callback() argument 46 callback_info(__func__, obj); in pre_unpatch_callback() 50 static void post_unpatch_callback(struct klp_object *obj) in post_unpatch_callback() argument [all …]
|
| A D | test_klp_state.c | 25 if (obj->mod) in callback_info() 26 pr_info("%s: %s -> %s\n", callback, obj->mod->name, in callback_info() 27 module_state[obj->mod->state]); in callback_info() 90 static int pre_patch_callback(struct klp_object *obj) in pre_patch_callback() argument 92 callback_info(__func__, obj); in pre_patch_callback() 97 static void post_patch_callback(struct klp_object *obj) in post_patch_callback() argument 99 callback_info(__func__, obj); in post_patch_callback() 104 static void pre_unpatch_callback(struct klp_object *obj) in pre_unpatch_callback() argument 106 callback_info(__func__, obj); in pre_unpatch_callback() 111 static void post_unpatch_callback(struct klp_object *obj) in post_unpatch_callback() argument [all …]
|
| A D | test_klp_state2.c | 25 if (obj->mod) in callback_info() 26 pr_info("%s: %s -> %s\n", callback, obj->mod->name, in callback_info() 27 module_state[obj->mod->state]); in callback_info() 119 static int pre_patch_callback(struct klp_object *obj) in pre_patch_callback() argument 121 callback_info(__func__, obj); in pre_patch_callback() 126 static void post_patch_callback(struct klp_object *obj) in post_patch_callback() argument 128 callback_info(__func__, obj); in post_patch_callback() 133 static void pre_unpatch_callback(struct klp_object *obj) in pre_unpatch_callback() argument 135 callback_info(__func__, obj); in pre_unpatch_callback() 140 static void post_unpatch_callback(struct klp_object *obj) in post_unpatch_callback() argument [all …]
|
| /tools/lib/bpf/ |
| A D | libbpf.c | 818 prog->obj = obj; in bpf_object__init_prog() 1140 struct bpf_object *obj = map->obj; in bpf_map__init_kern_struct_ops() local 1767 map = &obj->maps[obj->nr_maps++]; in bpf_object__add_map() 1768 map->obj = obj; in bpf_object__add_map() 4495 struct bpf_object *obj = prog->obj; in bpf_program__record_reloc() local 7756 struct bpf_object *obj = prog->obj; in fixup_log_missing_map_load() local 9198 return obj ? obj->btf : NULL; in bpf_object__btf() 9248 if (p->obj != obj) { in __bpf_program__iter() 10523 if (!obj || !obj->maps) in __bpf_map__iter() 10527 e = obj->maps + obj->nr_maps; in __bpf_map__iter() [all …]
|
| A D | linker.c | 498 obj.fd = fd; in bpf_linker_add_file() 511 free(obj.secs); in bpf_linker_add_file() 513 if (obj.elf) in bpf_linker_add_file() 646 size_t new_cnt = obj->sec_cnt ? obj->sec_cnt + 1 : 2; in add_src_sec() 686 obj->elf = elf_begin(obj->fd, ELF_C_READ_MMAP, NULL); in linker_load_obj_file() 725 if (elf_getshdrstrndx(obj->elf, &obj->shstrs_sec_idx)) { in linker_load_obj_file() 1034 sym_sec = &obj->secs[obj->symtab_sec_idx]; in linker_sanity_check_elf_relos() 1092 if (!obj->btf) in linker_sanity_check_btf() 1408 struct src_sec *symtab = &obj->secs[obj->symtab_sec_idx]; in linker_append_elf_syms() 1414 obj->sym_map = calloc(n + 1, sizeof(*obj->sym_map)); in linker_append_elf_syms() [all …]
|
| /tools/include/linux/ |
| A D | hashtable.h | 105 #define hash_for_each(name, bkt, obj, member) \ argument 106 for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\ 108 hlist_for_each_entry(obj, &name[bkt], member) 119 #define hash_for_each_safe(name, bkt, tmp, obj, member) \ argument 120 for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\ 122 hlist_for_each_entry_safe(obj, tmp, &name[bkt], member) 132 #define hash_for_each_possible(name, obj, member, key) \ argument 133 hlist_for_each_entry(obj, &name[hash_min(key, HASH_BITS(name))], member) 144 #define hash_for_each_possible_safe(name, obj, tmp, member, key) \ argument 145 hlist_for_each_entry_safe(obj, tmp,\
|
| /tools/testing/selftests/bpf/ |
| A D | flow_dissector_load.h | 9 static inline int bpf_flow_load(struct bpf_object **obj, in bpf_flow_load() argument 22 ret = bpf_prog_test_load(path, BPF_PROG_TYPE_FLOW_DISSECTOR, obj, in bpf_flow_load() 27 main_prog = bpf_object__find_program_by_name(*obj, prog_name); in bpf_flow_load() 35 prog_array = bpf_object__find_map_by_name(*obj, map_name); in bpf_flow_load() 44 keys = bpf_object__find_map_by_name(*obj, keys_map_name); in bpf_flow_load() 54 bpf_object__for_each_program(prog, *obj) { in bpf_flow_load()
|