Home
last modified time | relevance | path

Searched refs:obj (Results 1 – 25 of 168) sorted by relevance

1234567

/tools/testing/selftests/bpf/prog_tests/
Dcgroup_getset_retval.c21 struct cgroup_getset_retval_setsockopt *obj; in test_setsockopt_set() local
24 obj = cgroup_getset_retval_setsockopt__open_and_load(); in test_setsockopt_set()
25 if (!ASSERT_OK_PTR(obj, "skel-load")) in test_setsockopt_set()
28 obj->bss->page_size = sysconf(_SC_PAGESIZE); in test_setsockopt_set()
33 link_set_eunatch = bpf_program__attach_cgroup(obj->progs.set_eunatch, in test_setsockopt_set()
44 if (!ASSERT_EQ(obj->bss->invocations, 1, "invocations")) in test_setsockopt_set()
46 if (!ASSERT_FALSE(obj->bss->assertion_error, "assertion_error")) in test_setsockopt_set()
52 cgroup_getset_retval_setsockopt__destroy(obj); in test_setsockopt_set()
57 struct cgroup_getset_retval_setsockopt *obj; in test_setsockopt_set_and_get() local
60 obj = cgroup_getset_retval_setsockopt__open_and_load(); in test_setsockopt_set_and_get()
[all …]
Dmetadata.c68 struct metadata_unused *obj; in test_metadata_unused() local
71 obj = metadata_unused__open_and_load(); in test_metadata_unused()
72 if (CHECK(!obj, "skel-load", "errno %d", errno)) in test_metadata_unused()
75 err = prog_holds_map(bpf_program__fd(obj->progs.prog), in test_metadata_unused()
76 bpf_map__fd(obj->maps.rodata)); in test_metadata_unused()
83 if (CHECK(strncmp(obj->rodata->bpf_metadata_a, "foo", in test_metadata_unused()
84 sizeof(obj->rodata->bpf_metadata_a)), in test_metadata_unused()
87 if (CHECK(obj->rodata->bpf_metadata_b != 1, "bpf_metadata_b", in test_metadata_unused()
88 "expected 1, got %d", obj->rodata->bpf_metadata_b)) in test_metadata_unused()
92 err = bpf_prog_bind_map(bpf_program__fd(obj->progs.prog), in test_metadata_unused()
[all …]
Dpinning.c8 __u32 get_map_id(struct bpf_object *obj, const char *name) in get_map_id() argument
17 map = bpf_object__find_map_by_name(obj, name); in get_map_id()
38 struct bpf_object *obj; in test_pinning() local
46 obj = bpf_object__open_file(file_invalid, NULL); in test_pinning()
47 err = libbpf_get_error(obj); in test_pinning()
49 obj = NULL; in test_pinning()
54 obj = bpf_object__open_file(file, NULL); in test_pinning()
55 err = libbpf_get_error(obj); in test_pinning()
57 obj = NULL; in test_pinning()
61 err = bpf_object__load(obj); in test_pinning()
[all …]
Dcg_storage_multi.c90 struct cg_storage_multi_egress_only *obj; in test_egress_only() local
98 obj = cg_storage_multi_egress_only__open_and_load(); in test_egress_only()
99 if (CHECK(!obj, "skel-load", "errno %d", errno)) in test_egress_only()
107 parent_link = bpf_program__attach_cgroup(obj->progs.egress, in test_egress_only()
114 if (CHECK(obj->bss->invocations != 1, in test_egress_only()
115 "first-invoke", "invocations=%d", obj->bss->invocations)) in test_egress_only()
119 if (assert_storage(obj->maps.cgroup_storage, in test_egress_only()
123 if (assert_storage_noexist(obj->maps.cgroup_storage, &key)) in test_egress_only()
130 child_link = bpf_program__attach_cgroup(obj->progs.egress, in test_egress_only()
137 if (CHECK(obj->bss->invocations != 3, in test_egress_only()
[all …]
Dreference_tracking.c12 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()
Dglobal_data.c5 static void test_global_data_number(struct bpf_object *obj, __u32 duration) in test_global_data_number() argument
10 map_fd = bpf_find_map(__func__, obj, "result_number"); in test_global_data_number()
40 static void test_global_data_string(struct bpf_object *obj, __u32 duration) in test_global_data_string() argument
45 map_fd = bpf_find_map(__func__, obj, "result_string"); in test_global_data_string()
75 static void test_global_data_struct(struct bpf_object *obj, __u32 duration) in test_global_data_struct() argument
80 map_fd = bpf_find_map(__func__, obj, "result_struct"); in test_global_data_struct()
103 static void test_global_data_rdonly(struct bpf_object *obj, __u32 duration) in test_global_data_rdonly() argument
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
[all …]
Dxdp_adjust_tail.c9 struct bpf_object *obj; in test_xdp_adjust_tail_shrink() local
20 err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); in test_xdp_adjust_tail_shrink()
37 bpf_object__close(obj); in test_xdp_adjust_tail_shrink()
43 struct bpf_object *obj; in test_xdp_adjust_tail_grow() local
55 err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); in test_xdp_adjust_tail_grow()
72 bpf_object__close(obj); in test_xdp_adjust_tail_grow()
79 struct bpf_object *obj; in test_xdp_adjust_tail_grow2() local
97 err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); in test_xdp_adjust_tail_grow2()
139 bpf_object__close(obj); in test_xdp_adjust_tail_grow2()
147 struct bpf_object *obj; in test_xdp_adjust_frags_tail_shrink() local
[all …]
Dstacktrace_map.c12 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()
Dstacktrace_map_raw_tp.c12 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()
Dtrampoline_count.c6 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()
Dtest_overhead.c67 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()
Dglobal_func_args.c7 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()
Dtailcalls.c20 struct bpf_object *obj; in test_tailcall_1() local
29 err = bpf_prog_test_load("tailcall1.bpf.o", BPF_PROG_TYPE_SCHED_CLS, &obj, in test_tailcall_1()
34 prog = bpf_object__find_program_by_name(obj, "entry"); in test_tailcall_1()
42 prog_array = bpf_object__find_map_by_name(obj, "jmp_table"); in test_tailcall_1()
53 prog = bpf_object__find_program_by_name(obj, prog_name); in test_tailcall_1()
83 prog = bpf_object__find_program_by_name(obj, prog_name); in test_tailcall_1()
104 prog = bpf_object__find_program_by_name(obj, prog_name); in test_tailcall_1()
144 bpf_object__close(obj); in test_tailcall_1()
156 struct bpf_object *obj; in test_tailcall_2() local
165 err = bpf_prog_test_load("tailcall2.bpf.o", BPF_PROG_TYPE_SCHED_CLS, &obj, in test_tailcall_2()
[all …]
Dsockopt_multi.c7 static int run_getsockopt_test(struct sockopt_multi *obj, int cg_parent, in run_getsockopt_test() argument
44 link_child = bpf_program__attach_cgroup(obj->progs._getsockopt_child, in run_getsockopt_test()
69 link_parent = bpf_program__attach_cgroup(obj->progs._getsockopt_parent, in run_getsockopt_test()
158 static int run_setsockopt_test(struct sockopt_multi *obj, int cg_parent, in run_setsockopt_test() argument
192 link_child = bpf_program__attach_cgroup(obj->progs._setsockopt, in run_setsockopt_test()
220 link_parent = bpf_program__attach_cgroup(obj->progs._setsockopt, in run_setsockopt_test()
256 struct sockopt_multi *obj = NULL; in test_sockopt_multi() local
267 obj = sockopt_multi__open_and_load(); in test_sockopt_multi()
268 if (!ASSERT_OK_PTR(obj, "skel-load")) in test_sockopt_multi()
271 obj->bss->page_size = sysconf(_SC_PAGESIZE); in test_sockopt_multi()
[all …]
/tools/bpf/resolve_btfids/
Dmain.c259 static struct btf_id *add_set(struct object *obj, char *name, bool is_set8) in add_set() argument
274 return btf_id__add(&obj->sets, id, true); in add_set()
328 static int elf_collect(struct object *obj) in elf_collect() argument
337 fd = open(obj->path, O_RDWR, 0666); in elf_collect()
340 obj->path, strerror(errno)); in elf_collect()
354 obj->efile.fd = fd; in elf_collect()
355 obj->efile.elf = elf; in elf_collect()
364 if (gelf_getehdr(obj->efile.elf, &ehdr) == NULL) { in elf_collect()
369 obj->efile.encoding = ehdr.e_ident[EI_DATA]; in elf_collect()
405 obj->efile.symbols = data; in elf_collect()
[all …]
/tools/build/
DMakefile.build54 obj-y :=
56 subdir-obj-y :=
92 cmd_ld_multi = $(if $(strip $(obj-y)),\
93 $(LD) -r -o $@ $(filter $(obj-y),$^),rm -f $@; $(AR) rcs $@)
96 cmd_host_ld_multi = $(if $(strip $(obj-y)),\
97 $(HOSTLD) -r -o $@ $(filter $(obj-y),$^),rm -f $@; $(HOSTAR) rcs $@)
99 ifneq ($(filter $(obj),$(hostprogs)),)
142 obj-y := $($(obj)-y)
143 subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y)))
144 obj-y := $(patsubst %/, %/$(obj)-in.o, $(obj-y))
[all …]
/tools/testing/selftests/livepatch/test_modules/
Dtest_klp_callbacks_demo2.c21 static void callback_info(const char *callback, struct klp_object *obj) in callback_info() argument
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()
[all …]
Dtest_klp_callbacks_demo.c21 static void callback_info(const char *callback, struct klp_object *obj) in callback_info() argument
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()
[all …]
Dtest_klp_state.c23 static void callback_info(const char *callback, struct klp_object *obj) in callback_info() argument
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()
[all …]
Dtest_klp_state2.c23 static void callback_info(const char *callback, struct klp_object *obj) in callback_info() argument
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()
[all …]
/tools/lib/bpf/
Dlibbpf.c76 static struct bpf_map *bpf_object__add_map(struct bpf_object *obj);
77 static bool prog_is_subprog(const struct bpf_object *obj, const struct bpf_program *prog);
474 struct bpf_object *obj; member
545 struct bpf_object *obj; member
740 static const char *elf_sym_str(const struct bpf_object *obj, size_t off);
741 static const char *elf_sec_str(const struct bpf_object *obj, size_t off);
742 static Elf_Scn *elf_sec_by_idx(const struct bpf_object *obj, size_t idx);
743 static Elf_Scn *elf_sec_by_name(const struct bpf_object *obj, const char *name);
744 static Elf64_Shdr *elf_sec_hdr(const struct bpf_object *obj, Elf_Scn *scn);
745 static const char *elf_sec_name(const struct bpf_object *obj, Elf_Scn *scn);
[all …]
Dlinker.c162 struct src_obj *obj);
163 static int linker_sanity_check_elf(struct src_obj *obj);
164 static int linker_sanity_check_elf_symtab(struct src_obj *obj, struct src_sec *sec);
165 static int linker_sanity_check_elf_relos(struct src_obj *obj, struct src_sec *sec);
166 static int linker_sanity_check_btf(struct src_obj *obj);
167 static int linker_sanity_check_btf_ext(struct src_obj *obj);
168 static int linker_fixup_btf(struct src_obj *obj);
169 static int linker_append_sec_data(struct bpf_linker *linker, struct src_obj *obj);
170 static int linker_append_elf_syms(struct bpf_linker *linker, struct src_obj *obj);
171 static int linker_append_elf_sym(struct bpf_linker *linker, struct src_obj *obj,
[all …]
/tools/include/linux/
Dhashtable.h105 #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/
Dflow_dissector_load.h9 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()
/tools/bpf/runqslower/
Drunqslower.c116 struct runqslower_bpf *obj; in main() local
128 obj = runqslower_bpf__open(); in main()
129 if (!obj) { in main()
135 obj->rodata->targ_pid = env.pid; in main()
136 obj->rodata->min_us = env.min_us; in main()
138 err = runqslower_bpf__load(obj); in main()
144 err = runqslower_bpf__attach(obj); in main()
153 pb = perf_buffer__new(bpf_map__fd(obj->maps.events), 64, in main()
168 runqslower_bpf__destroy(obj); in main()

1234567