Home
last modified time | relevance | path

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

123456

/tools/testing/selftests/bpf/prog_tests/
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 …]
Dtrampoline_count.c10 struct bpf_object *obj; member
33 static struct bpf_link *load(struct bpf_object *obj, const char *name) in load() argument
38 prog = bpf_object__find_program_by_title(obj, name); in load()
51 struct bpf_object *obj; in test_trampoline_count() local
57 obj = bpf_object__open_file(object, NULL); in test_trampoline_count()
58 if (!ASSERT_OK_PTR(obj, "obj_open_file")) { in test_trampoline_count()
59 obj = NULL; in test_trampoline_count()
63 err = bpf_object__load(obj); in test_trampoline_count()
66 inst[i].obj = obj; in test_trampoline_count()
67 obj = NULL; in test_trampoline_count()
[all …]
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()
129 struct bpf_object *obj; in test_global_data() local
132 err = bpf_prog_load(file, BPF_PROG_TYPE_SCHED_CLS, &obj, &prog_fd); in test_global_data()
[all …]
Dsockopt_multi.c5 static int prog_attach(struct bpf_object *obj, int cgroup_fd, const char *title) in prog_attach() argument
18 prog = bpf_object__find_program_by_title(obj, title); in prog_attach()
34 static int prog_detach(struct bpf_object *obj, int cgroup_fd, const char *title) in prog_detach() argument
45 prog = bpf_object__find_program_by_title(obj, title); in prog_detach()
57 static int run_getsockopt_test(struct bpf_object *obj, int cg_parent, in run_getsockopt_test() argument
92 err = prog_attach(obj, cg_child, "cgroup/getsockopt/child"); in run_getsockopt_test()
116 err = prog_attach(obj, cg_parent, "cgroup/getsockopt/parent"); in run_getsockopt_test()
160 err = prog_detach(obj, cg_child, "cgroup/getsockopt/child"); in run_getsockopt_test()
201 prog_detach(obj, cg_child, "cgroup/getsockopt/child"); in run_getsockopt_test()
202 prog_detach(obj, cg_parent, "cgroup/getsockopt/parent"); in run_getsockopt_test()
[all …]
Dreference_tracking.c12 struct bpf_object *obj; in test_reference_tracking() local
17 obj = bpf_object__open_file(file, &open_opts); in test_reference_tracking()
18 if (!ASSERT_OK_PTR(obj, "obj_open_file")) in test_reference_tracking()
21 if (CHECK(strcmp(bpf_object__name(obj), obj_name), "obj_name", in test_reference_tracking()
23 bpf_object__name(obj), obj_name)) in test_reference_tracking()
26 bpf_object__for_each_program(prog, obj) { in test_reference_tracking()
51 bpf_object__close(obj); in test_reference_tracking()
Dtailcalls.c14 struct bpf_object *obj; in test_tailcall_1() local
19 err = bpf_prog_load("tailcall1.o", BPF_PROG_TYPE_SCHED_CLS, &obj, in test_tailcall_1()
24 prog = bpf_object__find_program_by_title(obj, "classifier"); in test_tailcall_1()
32 prog_array = bpf_object__find_map_by_name(obj, "jmp_table"); in test_tailcall_1()
43 prog = bpf_object__find_program_by_title(obj, prog_name); in test_tailcall_1()
75 prog = bpf_object__find_program_by_title(obj, prog_name); in test_tailcall_1()
97 prog = bpf_object__find_program_by_title(obj, prog_name); in test_tailcall_1()
140 bpf_object__close(obj); in test_tailcall_1()
152 struct bpf_object *obj; in test_tailcall_2() local
157 err = bpf_prog_load("tailcall2.o", BPF_PROG_TYPE_SCHED_CLS, &obj, in test_tailcall_2()
[all …]
Dstacktrace_map.c12 struct bpf_object *obj; in test_stacktrace_map() local
15 err = bpf_prog_load(file, BPF_PROG_TYPE_TRACEPOINT, &obj, &prog_fd); in test_stacktrace_map()
19 prog = bpf_object__find_program_by_title(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_load(file, BPF_PROG_TYPE_RAW_TRACEPOINT, &obj, &prog_fd); in test_stacktrace_map_raw_tp()
19 prog = bpf_object__find_program_by_title(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()
Dtest_overhead.c67 struct bpf_object *obj; in test_test_overhead() local
75 obj = bpf_object__open_file("./test_overhead.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_title(obj, kprobe_name); in test_test_overhead()
83 kretprobe_prog = bpf_object__find_program_by_title(obj, kretprobe_name); in test_test_overhead()
87 raw_tp_prog = bpf_object__find_program_by_title(obj, raw_tp_name); in test_test_overhead()
91 fentry_prog = bpf_object__find_program_by_title(obj, fentry_name); in test_test_overhead()
95 fexit_prog = bpf_object__find_program_by_title(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()
44 struct bpf_object *obj; in test_global_func_args() local
47 err = bpf_prog_load(file, BPF_PROG_TYPE_CGROUP_SKB, &obj, &prog_fd); in test_global_func_args()
57 test_global_func_args0(obj); in test_global_func_args()
59 bpf_object__close(obj); in test_global_func_args()
Dfexit_bpf2bpf.c7 typedef int (*test_cb)(struct bpf_object *obj);
9 static int check_data_map(struct bpf_object *obj, int prog_cnt, bool reset) in check_data_map() argument
21 bpf_object__for_each_map(map, obj) in check_data_map()
60 struct bpf_object *obj = NULL, *tgt_obj; in test_fexit_bpf2bpf_common() local
92 obj = bpf_object__open_file(obj_file, &opts); in test_fexit_bpf2bpf_common()
93 if (!ASSERT_OK_PTR(obj, "obj_open")) in test_fexit_bpf2bpf_common()
96 err = bpf_object__load(obj); in test_fexit_bpf2bpf_common()
110 prog[i] = bpf_object__find_program_by_title(obj, prog_name[i]); in test_fexit_bpf2bpf_common()
131 err = cb(obj); in test_fexit_bpf2bpf_common()
144 if (check_data_map(obj, prog_cnt, false)) in test_fexit_bpf2bpf_common()
[all …]
Drdonly_maps.c29 struct bpf_object *obj; in test_rdonly_maps() local
32 obj = bpf_object__open_file(file, NULL); in test_rdonly_maps()
33 if (!ASSERT_OK_PTR(obj, "obj_open")) in test_rdonly_maps()
36 err = bpf_object__load(obj); in test_rdonly_maps()
40 bss_map = bpf_object__find_map_by_name(obj, "test_rdo.bss"); in test_rdonly_maps()
50 prog = bpf_object__find_program_by_name(obj, t->prog_name); in test_rdonly_maps()
88 bpf_object__close(obj); in test_rdonly_maps()
Dprobe_user.c14 struct bpf_object *obj; in test_probe_user() local
17 obj = bpf_object__open_file(obj_file, &opts); in test_probe_user()
18 if (!ASSERT_OK_PTR(obj, "obj_open_file")) in test_probe_user()
21 kprobe_prog = bpf_object__find_program_by_title(obj, prog_name); in test_probe_user()
26 err = bpf_object__load(obj); in test_probe_user()
30 results_map_fd = bpf_find_map(__func__, obj, "test_pro.bss"); in test_probe_user()
72 bpf_object__close(obj); in test_probe_user()
Dglobal_data_init.c9 struct bpf_object *obj; in test_global_data_init() local
14 obj = bpf_object__open_file(file, NULL); in test_global_data_init()
15 err = libbpf_get_error(obj); in test_global_data_init()
19 map = bpf_object__find_map_by_name(obj, "test_glo.rodata"); in test_global_data_init()
38 err = bpf_object__load(obj); in test_global_data_init()
61 bpf_object__close(obj); in test_global_data_init()
/tools/bpf/resolve_btfids/
Dmain.c232 static struct btf_id *add_set(struct object *obj, char *name) in add_set() argument
247 return btf_id__add(&obj->sets, id, true); in add_set()
301 static int elf_collect(struct object *obj) in elf_collect() argument
309 fd = open(obj->path, O_RDWR, 0666); in elf_collect()
312 obj->path, strerror(errno)); in elf_collect()
326 obj->efile.fd = fd; in elf_collect()
327 obj->efile.elf = elf; in elf_collect()
370 obj->efile.symbols = data; in elf_collect()
371 obj->efile.symbols_shndx = idx; in elf_collect()
372 obj->efile.strtabidx = sh.sh_link; in elf_collect()
[all …]
/tools/build/
DMakefile.build46 obj-y :=
48 subdir-obj-y :=
83 cmd_ld_multi = $(if $(strip $(obj-y)),\
84 $(LD) -r -o $@ $(filter $(obj-y),$^),rm -f $@; $(AR) rcs $@)
87 cmd_host_ld_multi = $(if $(strip $(obj-y)),\
88 $(HOSTLD) -r -o $@ $(filter $(obj-y),$^),rm -f $@; $(HOSTAR) rcs $@)
90 ifneq ($(filter $(obj),$(hostprogs)),)
123 obj-y := $($(obj)-y)
124 subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y)))
125 obj-y := $(patsubst %/, %/$(obj)-in.o, $(obj-y))
[all …]
/tools/lib/bpf/
Dlibbpf.c72 static struct bpf_map *bpf_object__add_map(struct bpf_object *obj);
73 static bool prog_is_subprog(const struct bpf_object *obj, const struct bpf_program *prog);
201 static bool kernel_supports(const struct bpf_object *obj, enum kern_feature_id feat_id);
291 struct bpf_object *obj; member
522 static const char *elf_sym_str(const struct bpf_object *obj, size_t off);
523 static const char *elf_sec_str(const struct bpf_object *obj, size_t off);
524 static Elf_Scn *elf_sec_by_idx(const struct bpf_object *obj, size_t idx);
525 static Elf_Scn *elf_sec_by_name(const struct bpf_object *obj, const char *name);
526 static int elf_sec_hdr(const struct bpf_object *obj, Elf_Scn *scn, GElf_Shdr *hdr);
527 static const char *elf_sec_name(const struct bpf_object *obj, Elf_Scn *scn);
[all …]
Dlinker.c163 struct src_obj *obj);
164 static int linker_sanity_check_elf(struct src_obj *obj);
165 static int linker_sanity_check_elf_symtab(struct src_obj *obj, struct src_sec *sec);
166 static int linker_sanity_check_elf_relos(struct src_obj *obj, struct src_sec *sec);
167 static int linker_sanity_check_btf(struct src_obj *obj);
168 static int linker_sanity_check_btf_ext(struct src_obj *obj);
169 static int linker_fixup_btf(struct src_obj *obj);
170 static int linker_append_sec_data(struct bpf_linker *linker, struct src_obj *obj);
171 static int linker_append_elf_syms(struct bpf_linker *linker, struct src_obj *obj);
172 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/perf/util/
Dbpf-loader.h52 int fd, struct bpf_object *obj, void *arg);
64 int bpf__probe(struct bpf_object *obj);
65 int bpf__unprobe(struct bpf_object *obj);
66 int bpf__strerror_probe(struct bpf_object *obj, int err,
69 int bpf__load(struct bpf_object *obj);
70 int bpf__strerror_load(struct bpf_object *obj, int err,
72 int bpf__foreach_event(struct bpf_object *obj,
75 int bpf__config_obj(struct bpf_object *obj, struct parse_events_term *term,
77 int bpf__strerror_config_obj(struct bpf_object *obj,
110 static inline int bpf__probe(struct bpf_object *obj __maybe_unused) { return 0;} in bpf__probe()
[all …]
/tools/bpf/bpftool/
Dgen.c95 static int codegen_datasec_def(struct bpf_object *obj, in codegen_datasec_def() argument
193 static int codegen_datasecs(struct bpf_object *obj, const char *obj_name) in codegen_datasecs() argument
195 struct btf *btf = bpf_object__btf(obj); in codegen_datasecs()
210 err = codegen_datasec_def(obj, btf, d, t, obj_name); in codegen_datasecs()
307 static void codegen_attach_detach(struct bpf_object *obj, const char *obj_name) in codegen_attach_detach() argument
311 bpf_object__for_each_program(prog, obj) { in codegen_attach_detach()
355 bpf_object__for_each_program(prog, obj) { in codegen_attach_detach()
372 bpf_object__for_each_program(prog, obj) { in codegen_attach_detach()
385 static void codegen_destroy(struct bpf_object *obj, const char *obj_name) in codegen_destroy() argument
401 bpf_object__for_each_program(prog, obj) { in codegen_destroy()
[all …]
/tools/testing/selftests/bpf/
Dflow_dissector_load.h8 static inline int bpf_flow_load(struct bpf_object **obj, in bpf_flow_load() argument
21 ret = bpf_prog_load(path, BPF_PROG_TYPE_FLOW_DISSECTOR, obj, in bpf_flow_load()
27 bpf_object__for_each_program(prog, *obj) { in bpf_flow_load()
40 prog_array = bpf_object__find_map_by_name(*obj, map_name); in bpf_flow_load()
49 keys = bpf_object__find_map_by_name(*obj, keys_map_name); in bpf_flow_load()
59 bpf_object__for_each_program(prog, *obj) { in bpf_flow_load()
/tools/bpf/runqslower/
Drunqslower.c128 struct runqslower_bpf *obj; in main() local
143 obj = runqslower_bpf__open(); in main()
144 if (!obj) { in main()
150 obj->rodata->targ_pid = env.pid; in main()
151 obj->rodata->min_us = env.min_us; in main()
153 err = runqslower_bpf__load(obj); in main()
159 err = runqslower_bpf__attach(obj); in main()
170 pb = perf_buffer__new(bpf_map__fd(obj->maps.events), 64, &pb_opts); in main()
184 runqslower_bpf__destroy(obj); in main()

123456