Lines Matching refs:sec_name

431 	char *sec_name;  member
769 zfree(&prog->sec_name); in bpf_program__exit()
800 const char *name, size_t sec_idx, const char *sec_name, in bpf_object__init_prog() argument
805 sec_name, name, sec_off, insn_data_sz); in bpf_object__init_prog()
826 if (sec_name[0] == '?') { in bpf_object__init_prog()
829 sec_name++; in bpf_object__init_prog()
839 prog->sec_name = strdup(sec_name); in bpf_object__init_prog()
840 if (!prog->sec_name) in bpf_object__init_prog()
854 pr_warn("sec '%s': failed to allocate memory for prog '%s'\n", sec_name, name); in bpf_object__init_prog()
861 const char *sec_name, int sec_idx) in bpf_object__add_programs() argument
889 sec_name, sec_off); in bpf_object__add_programs()
895 sec_name, sec_off); in bpf_object__add_programs()
900 pr_warn("sec '%s': program '%s' is static and not supported\n", sec_name, name); in bpf_object__add_programs()
905 sec_name, name, sec_off / BPF_INSN_SZ, sec_off, prog_sz / BPF_INSN_SZ, prog_sz); in bpf_object__add_programs()
915 sec_name, name); in bpf_object__add_programs()
922 err = bpf_object__init_prog(obj, prog, name, sec_idx, sec_name, in bpf_object__add_programs()
1289 map->name, mname, prog->name, prog->sec_name, prog->type, in bpf_map__init_kern_struct_ops()
1295 map->name, mname, prog->name, prog->sec_name, prog->type, in bpf_map__init_kern_struct_ops()
1349 static int init_struct_ops_maps(struct bpf_object *obj, const char *sec_name, in init_struct_ops_maps() argument
1365 datasec_id = btf__find_by_name_kind(btf, sec_name, in init_struct_ops_maps()
1369 sec_name); in init_struct_ops_maps()
1382 vsi->type, sec_name); in init_struct_ops_maps()
1411 if (sec_name[0] == '?') { in init_struct_ops_maps()
1414 sec_name++; in init_struct_ops_maps()
1421 map->def.map_flags = strcmp(sec_name, STRUCT_OPS_LINK_SEC) == 0 ? BPF_F_LINK : 0; in init_struct_ops_maps()
1437 var_name, sec_name); in init_struct_ops_maps()
1455 const char *sec_name; in bpf_object_init_struct_ops() local
1464 sec_name = elf_sec_name(obj, elf_sec_by_idx(obj, sec_idx)); in bpf_object_init_struct_ops()
1465 if (!sec_name) in bpf_object_init_struct_ops()
1468 err = init_struct_ops_maps(obj, sec_name, sec_idx, desc->data); in bpf_object_init_struct_ops()
1977 const char *sec_name; in bpf_object__init_global_data_maps() local
1992 sec_name = elf_sec_name(obj, elf_sec_by_idx(obj, sec_idx)); in bpf_object__init_global_data_maps()
1994 sec_name, sec_idx, in bpf_object__init_global_data_maps()
2000 sec_name = elf_sec_name(obj, elf_sec_by_idx(obj, sec_idx)); in bpf_object__init_global_data_maps()
2002 sec_name, sec_idx, in bpf_object__init_global_data_maps()
2007 sec_name = elf_sec_name(obj, elf_sec_by_idx(obj, sec_idx)); in bpf_object__init_global_data_maps()
2009 sec_name, sec_idx, in bpf_object__init_global_data_maps()
2950 const char *sec_name, int sec_idx, in init_arena_map_data() argument
2959 sec_name, mmap_sz, data_sz); in init_arena_map_data()
3266 const char *sec_name; in bpf_object__init_btf() local
3285 sec_name = btf__name_by_offset(obj->btf, sec->sec_name_off); in bpf_object__init_btf()
3286 if (str_is_empty(sec_name)) in bpf_object__init_btf()
3288 scn = elf_sec_by_name(obj, sec_name); in bpf_object__init_btf()
3316 const char *sec_name = btf__name_by_offset(btf, t->name_off); in btf_fixup_datasec() local
3321 if (!sec_name) { in btf_fixup_datasec()
3332 if (strcmp(sec_name, KCONFIG_SEC) == 0 || strcmp(sec_name, KSYMS_SEC) == 0) in btf_fixup_datasec()
3344 err = find_elf_sec_sz(obj, sec_name, &size); in btf_fixup_datasec()
3347 sec_name, size, errstr(err)); in btf_fixup_datasec()
3363 pr_debug("sec '%s': unexpected non-VAR type found\n", sec_name); in btf_fixup_datasec()
3374 sec_name, i); in btf_fixup_datasec()
3381 sec_name, var_name); in btf_fixup_datasec()
3661 const char *sec_name; in elf_sec_by_name() local
3664 sec_name = elf_sec_name(obj, scn); in elf_sec_by_name()
3665 if (!sec_name) in elf_sec_by_name()
3668 if (strcmp(sec_name, name) != 0) in elf_sec_by_name()
4204 const char *ext_name, *sec_name; in bpf_object__collect_externs() local
4270 sec_name = btf__name_by_offset(obj->btf, sec->name_off); in bpf_object__collect_externs()
4272 if (strcmp(sec_name, KCONFIG_SEC) == 0) { in bpf_object__collect_externs()
4298 } else if (strcmp(sec_name, KSYMS_SEC) == 0) { in bpf_object__collect_externs()
4304 pr_warn("unrecognized extern section '%s'\n", sec_name); in bpf_object__collect_externs()
4673 const char *relo_sec_name, *sec_name; in bpf_object__collect_prog_relos() local
4694 sec_name = elf_sec_name(obj, scn); in bpf_object__collect_prog_relos()
4695 if (!relo_sec_name || !sec_name) in bpf_object__collect_prog_relos()
4699 relo_sec_name, sec_idx, sec_name); in bpf_object__collect_prog_relos()
4748 relo_sec_name, i, sec_name, insn_idx); in bpf_object__collect_prog_relos()
5908 const char *sec_name; in bpf_object__relocate_core() local
5935 sec_name = btf__name_by_offset(obj->btf, sec->sec_name_off); in bpf_object__relocate_core()
5936 if (str_is_empty(sec_name)) { in bpf_object__relocate_core()
5941 pr_debug("sec '%s': found %d CO-RE relocations\n", sec_name, sec->num_info); in bpf_object__relocate_core()
5958 sec_name, i, insn_idx); in bpf_object__relocate_core()
7413 attach_name = strchr(prog->sec_name, '/'); in libbpf_prepare_prog_load()
7473 prog->name, prog->sec_name); in bpf_object_load_prog()
7918 static const struct bpf_sec_def *find_sec_def(const char *sec_name);
7926 prog->sec_def = find_sec_def(prog->sec_name); in bpf_object_init_progs()
7930 prog->name, prog->sec_name); in bpf_object_init_progs()
9210 return prog->sec_name; in bpf_program__section_name()
9598 static bool sec_def_matches(const struct bpf_sec_def *sec_def, const char *sec_name) in sec_def_matches() argument
9604 if (str_has_pfx(sec_name, sec_def->sec)) in sec_def_matches()
9615 if (strncmp(sec_name, sec_def->sec, len) != 0) in sec_def_matches()
9618 if (sec_name[len] == '\0' || sec_name[len] == '/') in sec_def_matches()
9623 return strcmp(sec_name, sec_def->sec) == 0; in sec_def_matches()
9626 static const struct bpf_sec_def *find_sec_def(const char *sec_name) in find_sec_def() argument
9634 if (sec_def_matches(sec_def, sec_name)) in find_sec_def()
9641 if (sec_def_matches(sec_def, sec_name)) in find_sec_def()
11614 if (strcmp(prog->sec_name, "kprobe") == 0 || strcmp(prog->sec_name, "kretprobe") == 0) in attach_kprobe()
11617 opts.retprobe = str_has_pfx(prog->sec_name, "kretprobe/"); in attach_kprobe()
11619 func_name = prog->sec_name + sizeof("kretprobe/") - 1; in attach_kprobe()
11621 func_name = prog->sec_name + sizeof("kprobe/") - 1; in attach_kprobe()
11648 if (strcmp(prog->sec_name, "ksyscall") == 0 || strcmp(prog->sec_name, "kretsyscall") == 0) in attach_ksyscall()
11651 opts.retprobe = str_has_pfx(prog->sec_name, "kretsyscall/"); in attach_ksyscall()
11653 syscall_name = prog->sec_name + sizeof("kretsyscall/") - 1; in attach_ksyscall()
11655 syscall_name = prog->sec_name + sizeof("ksyscall/") - 1; in attach_ksyscall()
11671 if (strcmp(prog->sec_name, "kprobe.multi") == 0 || in attach_kprobe_multi()
11672 strcmp(prog->sec_name, "kretprobe.multi") == 0) in attach_kprobe_multi()
11675 opts.retprobe = str_has_pfx(prog->sec_name, "kretprobe.multi/"); in attach_kprobe_multi()
11677 spec = prog->sec_name + sizeof("kretprobe.multi/") - 1; in attach_kprobe_multi()
11679 spec = prog->sec_name + sizeof("kprobe.multi/") - 1; in attach_kprobe_multi()
11703 if (strcmp(prog->sec_name, "kprobe.session") == 0) in attach_kprobe_session()
11706 spec = prog->sec_name + sizeof("kprobe.session/") - 1; in attach_kprobe_session()
11726 n = sscanf(prog->sec_name, "%m[^/]/%m[^:]:%m[^\n]", in attach_uprobe_multi()
11742 prog->sec_name); in attach_uprobe_multi()
12258 n = sscanf(prog->sec_name, "%m[^/]/%m[^:]:%m[^\n]", in attach_uprobe()
12267 prog->name, prog->sec_name); in attach_uprobe()
12294 prog->sec_name); in attach_uprobe()
12370 const char *sec_name; in attach_usdt() local
12373 sec_name = bpf_program__section_name(prog); in attach_usdt()
12374 if (strcmp(sec_name, "usdt") == 0) { in attach_usdt()
12380 n = sscanf(sec_name, "usdt/%m[^:]:%m[^:]:%m[^:]", &path, &provider, &name); in attach_usdt()
12383 sec_name); in attach_usdt()
12488 char *sec_name, *tp_cat, *tp_name; in attach_tp() local
12493 if (strcmp(prog->sec_name, "tp") == 0 || strcmp(prog->sec_name, "tracepoint") == 0) in attach_tp()
12496 sec_name = strdup(prog->sec_name); in attach_tp()
12497 if (!sec_name) in attach_tp()
12501 if (str_has_pfx(prog->sec_name, "tp/")) in attach_tp()
12502 tp_cat = sec_name + sizeof("tp/") - 1; in attach_tp()
12504 tp_cat = sec_name + sizeof("tracepoint/") - 1; in attach_tp()
12507 free(sec_name); in attach_tp()
12514 free(sec_name); in attach_tp()
12577 if (!str_has_pfx(prog->sec_name, prefixes[i])) in attach_raw_tp()
12582 if (prog->sec_name[pfx_len] == '\0') in attach_raw_tp()
12585 if (prog->sec_name[pfx_len] != '/') in attach_raw_tp()
12588 tp_name = prog->sec_name + pfx_len + 1; in attach_raw_tp()
12594 prog->name, prog->sec_name); in attach_raw_tp()