Lines Matching refs:sec_name

392 	char *sec_name;  member
717 zfree(&prog->sec_name); in bpf_program__exit()
748 const char *name, size_t sec_idx, const char *sec_name, in bpf_object__init_prog() argument
753 sec_name, name, sec_off, insn_data_sz); in bpf_object__init_prog()
773 if (sec_name[0] == '?') { in bpf_object__init_prog()
776 sec_name++; in bpf_object__init_prog()
786 prog->sec_name = strdup(sec_name); in bpf_object__init_prog()
787 if (!prog->sec_name) in bpf_object__init_prog()
801 pr_warn("sec '%s': failed to allocate memory for prog '%s'\n", sec_name, name); in bpf_object__init_prog()
808 const char *sec_name, int sec_idx) in bpf_object__add_programs() argument
836 sec_name, sec_off); in bpf_object__add_programs()
842 sec_name, sec_off); in bpf_object__add_programs()
847 pr_warn("sec '%s': program '%s' is static and not supported\n", sec_name, name); in bpf_object__add_programs()
852 sec_name, name, sec_off / BPF_INSN_SZ, sec_off, prog_sz / BPF_INSN_SZ, prog_sz); in bpf_object__add_programs()
862 sec_name, name); in bpf_object__add_programs()
869 err = bpf_object__init_prog(obj, prog, name, sec_idx, sec_name, in bpf_object__add_programs()
1140 static int init_struct_ops_maps(struct bpf_object *obj, const char *sec_name, in init_struct_ops_maps() argument
1156 datasec_id = btf__find_by_name_kind(btf, sec_name, in init_struct_ops_maps()
1160 sec_name); in init_struct_ops_maps()
1173 vsi->type, sec_name); in init_struct_ops_maps()
1217 var_name, sec_name); in init_struct_ops_maps()
1698 const char *sec_name; in bpf_object__init_global_data_maps() local
1713 sec_name = elf_sec_name(obj, elf_sec_by_idx(obj, sec_idx)); in bpf_object__init_global_data_maps()
1715 sec_name, sec_idx, in bpf_object__init_global_data_maps()
1721 sec_name = elf_sec_name(obj, elf_sec_by_idx(obj, sec_idx)); in bpf_object__init_global_data_maps()
1723 sec_name, sec_idx, in bpf_object__init_global_data_maps()
1728 sec_name = elf_sec_name(obj, elf_sec_by_idx(obj, sec_idx)); in bpf_object__init_global_data_maps()
1730 sec_name, sec_idx, in bpf_object__init_global_data_maps()
2864 const char *sec_name; in bpf_object__init_btf() local
2883 sec_name = btf__name_by_offset(obj->btf, sec->sec_name_off); in bpf_object__init_btf()
2884 if (str_is_empty(sec_name)) in bpf_object__init_btf()
2886 scn = elf_sec_by_name(obj, sec_name); in bpf_object__init_btf()
2914 const char *sec_name = btf__name_by_offset(btf, t->name_off); in btf_fixup_datasec() local
2919 if (!sec_name) { in btf_fixup_datasec()
2930 if (strcmp(sec_name, KCONFIG_SEC) == 0 || strcmp(sec_name, KSYMS_SEC) == 0) in btf_fixup_datasec()
2942 err = find_elf_sec_sz(obj, sec_name, &size); in btf_fixup_datasec()
2945 sec_name, size, err); in btf_fixup_datasec()
2961 pr_debug("sec '%s': unexpected non-VAR type found\n", sec_name); in btf_fixup_datasec()
2972 sec_name, i); in btf_fixup_datasec()
2979 sec_name, var_name); in btf_fixup_datasec()
3245 const char *sec_name; in elf_sec_by_name() local
3248 sec_name = elf_sec_name(obj, scn); in elf_sec_by_name()
3249 if (!sec_name) in elf_sec_by_name()
3252 if (strcmp(sec_name, name) != 0) in elf_sec_by_name()
3777 const char *ext_name, *sec_name; in bpf_object__collect_externs() local
3843 sec_name = btf__name_by_offset(obj->btf, sec->name_off); in bpf_object__collect_externs()
3845 if (strcmp(sec_name, KCONFIG_SEC) == 0) { in bpf_object__collect_externs()
3871 } else if (strcmp(sec_name, KSYMS_SEC) == 0) { in bpf_object__collect_externs()
3877 pr_warn("unrecognized extern section '%s'\n", sec_name); in bpf_object__collect_externs()
4237 const char *relo_sec_name, *sec_name; in bpf_object__collect_prog_relos() local
4256 sec_name = elf_sec_name(obj, scn); in bpf_object__collect_prog_relos()
4257 if (!relo_sec_name || !sec_name) in bpf_object__collect_prog_relos()
4261 relo_sec_name, sec_idx, sec_name); in bpf_object__collect_prog_relos()
4310 relo_sec_name, i, sec_name, insn_idx); in bpf_object__collect_prog_relos()
5787 const char *sec_name; in bpf_object__relocate_core() local
5814 sec_name = btf__name_by_offset(obj->btf, sec->sec_name_off); in bpf_object__relocate_core()
5815 if (str_is_empty(sec_name)) { in bpf_object__relocate_core()
5820 pr_debug("sec '%s': found %d CO-RE relocations\n", sec_name, sec->num_info); in bpf_object__relocate_core()
5837 sec_name, i, insn_idx); in bpf_object__relocate_core()
6841 attach_name = strchr(prog->sec_name, '/'); in libbpf_prepare_prog_load()
6898 prog->name, prog->sec_name); in bpf_object_load_prog()
7335 static const struct bpf_sec_def *find_sec_def(const char *sec_name);
7343 prog->sec_def = find_sec_def(prog->sec_name); in bpf_object_init_progs()
7347 prog->name, prog->sec_name); in bpf_object_init_progs()
8576 return prog->sec_name; in bpf_program__section_name()
8952 static bool sec_def_matches(const struct bpf_sec_def *sec_def, const char *sec_name) in sec_def_matches() argument
8958 if (str_has_pfx(sec_name, sec_def->sec)) in sec_def_matches()
8969 if (strncmp(sec_name, sec_def->sec, len) != 0) in sec_def_matches()
8972 if (sec_name[len] == '\0' || sec_name[len] == '/') in sec_def_matches()
8977 return strcmp(sec_name, sec_def->sec) == 0; in sec_def_matches()
8980 static const struct bpf_sec_def *find_sec_def(const char *sec_name) in find_sec_def() argument
8988 if (sec_def_matches(sec_def, sec_name)) in find_sec_def()
8995 if (sec_def_matches(sec_def, sec_name)) in find_sec_def()
9226 map->name, prog->name, prog->sec_name, prog->type, in bpf_object__collect_st_ops_relos()
10913 if (strcmp(prog->sec_name, "kprobe") == 0 || strcmp(prog->sec_name, "kretprobe") == 0) in attach_kprobe()
10916 opts.retprobe = str_has_pfx(prog->sec_name, "kretprobe/"); in attach_kprobe()
10918 func_name = prog->sec_name + sizeof("kretprobe/") - 1; in attach_kprobe()
10920 func_name = prog->sec_name + sizeof("kprobe/") - 1; in attach_kprobe()
10947 if (strcmp(prog->sec_name, "ksyscall") == 0 || strcmp(prog->sec_name, "kretsyscall") == 0) in attach_ksyscall()
10950 opts.retprobe = str_has_pfx(prog->sec_name, "kretsyscall/"); in attach_ksyscall()
10952 syscall_name = prog->sec_name + sizeof("kretsyscall/") - 1; in attach_ksyscall()
10954 syscall_name = prog->sec_name + sizeof("ksyscall/") - 1; in attach_ksyscall()
10970 if (strcmp(prog->sec_name, "kprobe.multi") == 0 || in attach_kprobe_multi()
10971 strcmp(prog->sec_name, "kretprobe.multi") == 0) in attach_kprobe_multi()
10974 opts.retprobe = str_has_pfx(prog->sec_name, "kretprobe.multi/"); in attach_kprobe_multi()
10976 spec = prog->sec_name + sizeof("kretprobe.multi/") - 1; in attach_kprobe_multi()
10978 spec = prog->sec_name + sizeof("kprobe.multi/") - 1; in attach_kprobe_multi()
10999 n = sscanf(prog->sec_name, "%m[^/]/%m[^:]:%ms", in attach_uprobe_multi()
11013 prog->sec_name); in attach_uprobe_multi()
11515 n = sscanf(prog->sec_name, "%m[^/]/%m[^:]:%m[a-zA-Z0-9_.]+%li", in attach_uprobe()
11524 prog->name, prog->sec_name); in attach_uprobe()
11541 prog->sec_name); in attach_uprobe()
11617 const char *sec_name; in attach_usdt() local
11620 sec_name = bpf_program__section_name(prog); in attach_usdt()
11621 if (strcmp(sec_name, "usdt") == 0) { in attach_usdt()
11627 n = sscanf(sec_name, "usdt/%m[^:]:%m[^:]:%m[^:]", &path, &provider, &name); in attach_usdt()
11630 sec_name); in attach_usdt()
11737 char *sec_name, *tp_cat, *tp_name; in attach_tp() local
11742 if (strcmp(prog->sec_name, "tp") == 0 || strcmp(prog->sec_name, "tracepoint") == 0) in attach_tp()
11745 sec_name = strdup(prog->sec_name); in attach_tp()
11746 if (!sec_name) in attach_tp()
11750 if (str_has_pfx(prog->sec_name, "tp/")) in attach_tp()
11751 tp_cat = sec_name + sizeof("tp/") - 1; in attach_tp()
11753 tp_cat = sec_name + sizeof("tracepoint/") - 1; in attach_tp()
11756 free(sec_name); in attach_tp()
11763 free(sec_name); in attach_tp()
11813 if (!str_has_pfx(prog->sec_name, prefixes[i])) in attach_raw_tp()
11818 if (prog->sec_name[pfx_len] == '\0') in attach_raw_tp()
11821 if (prog->sec_name[pfx_len] != '/') in attach_raw_tp()
11824 tp_name = prog->sec_name + pfx_len + 1; in attach_raw_tp()
11830 prog->name, prog->sec_name); in attach_raw_tp()