Lines Matching defs:obj

94 static int codegen_datasec_def(struct bpf_object *obj,
186 static int codegen_datasecs(struct bpf_object *obj, const char *obj_name)
188 struct btf *btf = bpf_object__btf(obj);
203 err = codegen_datasec_def(obj, btf, d, t, obj_name);
277 struct bpf_object *obj = NULL;
315 obj = bpf_object__open_mem(obj_data, file_sz, &opts);
316 if (IS_ERR(obj)) {
319 libbpf_strerror(PTR_ERR(obj), err_buf, sizeof(err_buf));
321 obj = NULL;
325 bpf_object__for_each_map(map, obj) {
334 bpf_object__for_each_program(prog, obj) {
352 struct bpf_object *obj; \n\
359 bpf_object__for_each_map(map, obj) {
370 bpf_object__for_each_program(prog, obj) {
376 bpf_object__for_each_program(prog, obj) {
383 btf = bpf_object__btf(obj);
385 err = codegen_datasecs(obj, obj_name);
395 %1$s__destroy(struct %1$s *obj) \n\
397 if (!obj) \n\
399 if (obj->skeleton) \n\
400 bpf_object__destroy_skeleton(obj->skeleton);\n\
401 free(obj); \n\
405 %1$s__create_skeleton(struct %1$s *obj); \n\
410 struct %1$s *obj; \n\
412 obj = (struct %1$s *)calloc(1, sizeof(*obj)); \n\
413 if (!obj) \n\
415 if (%1$s__create_skeleton(obj)) \n\
417 if (bpf_object__open_skeleton(obj->skeleton, opts)) \n\
420 return obj; \n\
422 %1$s__destroy(obj); \n\
433 %1$s__load(struct %1$s *obj) \n\
435 return bpf_object__load_skeleton(obj->skeleton); \n\
441 struct %1$s *obj; \n\
443 obj = %1$s__open(); \n\
444 if (!obj) \n\
446 if (%1$s__load(obj)) { \n\
447 %1$s__destroy(obj); \n\
450 return obj; \n\
454 %1$s__attach(struct %1$s *obj) \n\
456 return bpf_object__attach_skeleton(obj->skeleton); \n\
460 %1$s__detach(struct %1$s *obj) \n\
462 return bpf_object__detach_skeleton(obj->skeleton); \n\
472 %1$s__create_skeleton(struct %1$s *obj) \n\
479 obj->skeleton = s; \n\
483 s->obj = &obj->obj; \n\
501 bpf_object__for_each_map(map, obj) {
511 s->maps[%zu].map = &obj->maps.%s; \n\
517 printf("\ts->maps[%zu].mmaped = (void **)&obj->%s;\n",
537 bpf_object__for_each_program(prog, obj) {
542 s->progs[%1$zu].prog = &obj->progs.%2$s;\n\
543 s->progs[%1$zu].link = &obj->links.%2$s;\n\
587 bpf_object__close(obj);