Lines Matching refs:name

388  * bpf_prog should be a better name but it has been used in
392 char *name;
506 char *name;
509 * name. This is important to be able to find corresponding BTF
557 const char *name;
589 char *name;
618 size_t shstrndx; /* section index for section name strings */
633 char name[BPF_OBJ_NAME_LEN];
693 static Elf_Scn *elf_sec_by_name(const struct bpf_object *obj, const char *name);
717 zfree(&prog->name);
749 const char *name, size_t sec_idx, const char *sec_name,
754 sec_name, name, sec_off, insn_data_sz);
776 /* from now on forget there was ? in section name */
791 prog->name = strdup(name);
792 if (!prog->name)
802 pr_warn("sec '%s': failed to allocate memory for prog '%s'\n", sec_name, name);
816 const char *name;
834 name = elf_sym_str(obj, sym->st_name);
835 if (!name) {
836 pr_warn("sec '%s': failed to get symbol name for offset %zu\n",
848 pr_warn("sec '%s': program '%s' is static and not supported\n", sec_name, name);
853 sec_name, name, sec_off / BPF_INSN_SZ, sec_off, prog_sz / BPF_INSN_SZ, prog_sz);
863 sec_name, name);
870 err = bpf_object__init_prog(obj, prog, name, sec_idx, sec_name,
908 const char *name)
914 if (!strcmp(btf__name_by_offset(btf, m->name_off), name))
923 const char *name, __u32 kind);
1013 map->name, st_ops->type_id, kern_type_id, kern_vtype_id);
1040 map->name, mname);
1048 map->name, mname);
1064 map->name, mname, BTF_INFO_KIND(mtype->info),
1086 map->name, mname);
1096 map->name, mname, prog->name, moff,
1106 map->name, mname, (ssize_t)msize,
1112 map->name, mname, (unsigned int)msize,
1195 map->name = strdup(var_name);
1196 if (!map->name)
1265 libbpf_strlcpy(obj->name, obj_name, sizeof(obj->name));
1268 libbpf_strlcpy(obj->name, basename((void *)path), sizeof(obj->name));
1269 end = strchr(obj->name, '.');
1448 static int find_elf_sec_sz(const struct bpf_object *obj, const char *name, __u32 *size)
1453 if (!name)
1456 scn = elf_sec_by_name(obj, name);
1466 static Elf64_Sym *find_elf_var_sym(const struct bpf_object *obj, const char *name)
1484 pr_warn("failed to get sym name string for var %s\n", name);
1487 if (strcmp(name, sname) == 0)
1550 * internal names was to include as much of BPF object name prefix as
1555 * map name advertised to user and to the kernel will be
1556 * 'my_objec.rodata', taking first 8 characters of object name and
1558 * Somewhat confusingly, if internal map ELF section name is shorter
1563 * object name is somewhat consistent in this case. But if the map
1564 * name is '.kconfig', we'll still have entirety of '.kconfig' added
1566 * object name ('my_obje'). Happy guessing, user, that the final map
1567 * name will be "my_obje.kconfig".
1569 * and .data.* data sections, it's possible that ELF section name is
1571 * only up to 15 first characters of ELF name, taking no BPF object
1572 * name characters at all. So '.rodata.abracadabra' will result in
1573 * '.rodata.abracad' kernel and user-visible name.
1576 * maps we use their ELF names as is, not prepending bpf_object name
1578 * kernel. Full name can be recovered for such maps by using DATASEC
1584 /* if there are two or more dots in map name, it's a custom dot map */
1588 pfx_len = min((size_t)BPF_OBJ_NAME_LEN - sfx_len - 1, strlen(obj->name));
1590 snprintf(map_name, sizeof(map_name), "%.*s%.*s", pfx_len, obj->name,
1593 /* sanitise map name to characters allowed by kernel */
1652 map->name = internal_map_name(obj, real_name);
1653 if (!map->real_name || !map->name) {
1655 zfree(&map->name);
1674 map->name, map->sec_idx, map->sec_offset, def->map_flags);
1683 map->name, err);
1685 zfree(&map->name);
1692 pr_debug("map %td is \"%s\"\n", map - obj->maps, map->name);
1747 const void *name)
1752 if (strcmp(obj->externs[i].name, name) == 0)
1765 ext->name, value);
1786 ext->name, value);
1800 ext->name, value);
1807 ext->name, value);
1815 ext->name, value, len, ext->kcfg.sz - 1);
1874 ext->name, (unsigned long long)value);
1879 ext->name, (unsigned long long)value);
1885 ext->name, (unsigned long long)value, ext->kcfg.sz);
1956 pr_warn("extern (kcfg) '%s': value '%s' isn't a valid integer\n", ext->name, value);
1960 pr_warn("extern (kcfg) '%s': value '%s' implies integer type\n", ext->name, value);
1968 pr_debug("extern (kcfg) '%s': set to %s\n", ext->name, value);
2138 const char *name = btf__name_by_offset(btf, m->name_off);
2144 map_name, name, btf_kind_str(t));
2151 map_name, name, t->type);
2156 map_name, name, btf_kind_str(arr_t));
2164 static int pathname_concat(char *buf, size_t buf_sz, const char *path, const char *name)
2168 len = snprintf(buf, buf_sz, "%s/%s", path, name);
2195 /* PIN_BY_NAME: pin maps by name (in /sys/fs/bpf by default) */
2211 const char *name = btf__name_by_offset(btf, m->name_off);
2213 if (!name) {
2217 if (strcmp(name, "type") == 0) {
2221 } else if (strcmp(name, "max_entries") == 0) {
2225 } else if (strcmp(name, "map_flags") == 0) {
2229 } else if (strcmp(name, "numa_node") == 0) {
2233 } else if (strcmp(name, "key_size") == 0) {
2245 } else if (strcmp(name, "key") == 0) {
2273 } else if (strcmp(name, "value_size") == 0) {
2285 } else if (strcmp(name, "value") == 0) {
2314 else if (strcmp(name, "values") == 0) {
2328 map_name, name);
2380 } else if (strcmp(name, "pinning") == 0) {
2396 } else if (strcmp(name, "map_extra") == 0) {
2405 pr_warn("map '%s': unknown field '%s'.\n", map_name, name);
2408 pr_debug("map '%s': ignoring unknown field '%s'.\n", map_name, name);
2475 pr_debug("map '%s': found type = %u.\n", map->name, def->map_type);
2479 map->name, def->key_type_id, def->key_size);
2481 pr_debug("map '%s': found key_size = %u.\n", map->name, def->key_size);
2485 map->name, def->value_type_id, def->value_size);
2487 pr_debug("map '%s': found value_size = %u.\n", map->name, def->value_size);
2490 pr_debug("map '%s': found max_entries = %u.\n", map->name, def->max_entries);
2492 pr_debug("map '%s': found map_flags = 0x%x.\n", map->name, def->map_flags);
2494 pr_debug("map '%s': found map_extra = 0x%llx.\n", map->name,
2497 pr_debug("map '%s': found pinning = %u.\n", map->name, def->pinning);
2499 pr_debug("map '%s': found numa_node = %u.\n", map->name, def->numa_node);
2502 pr_debug("map '%s': found inner map definition.\n", map->name);
2535 pr_warn("map #%d: empty name.\n", var_idx);
2567 map->name = strdup(map_name);
2568 if (!map->name) {
2569 pr_warn("map '%s': failed to alloc map name.\n", map_name);
2580 err = parse_btf_map_def(map->name, obj->btf, def, strict, &map_def, &inner_def);
2589 pr_warn("map '%s': couldn't build pin path.\n", map->name);
2600 map->inner_map->name = malloc(strlen(map_name) + sizeof(".inner") + 1);
2601 if (!map->inner_map->name)
2603 sprintf(map->inner_map->name, "%s.inner", map_name);
2621 const char *name;
2641 name = btf__name_by_offset(obj->btf, t->name_off);
2642 if (strcmp(name, MAPS_ELF_SEC) == 0) {
2741 char *name;
2743 name = (char *)btf__name_by_offset(btf, t->name_off);
2744 while (*name) {
2745 if (*name == '.')
2746 *name = '_';
2747 name++;
2756 /* preserve variable name as member name */
2774 * valid struct name, make it anonymous
2921 pr_debug("No name found in string section for DATASEC kind.\n");
2972 pr_debug("sec '%s': failed to find name of DATASEC's member #%d\n",
3125 const char *name;
3137 name = btf__str_by_offset(obj->btf, t->name_off);
3138 if (strcmp(name, prog->name) != 0)
3203 const char *name;
3205 name = elf_strptr(obj->efile.elf, obj->efile.strtabidx, off);
3206 if (!name) {
3207 pr_warn("elf: failed to get section name string at offset %zu from %s: %s\n",
3212 return name;
3217 const char *name;
3219 name = elf_strptr(obj->efile.elf, obj->efile.shstrndx, off);
3220 if (!name) {
3221 pr_warn("elf: failed to get section name string at offset %zu from %s: %s\n",
3226 return name;
3242 static Elf_Scn *elf_sec_by_name(const struct bpf_object *obj, const char *name)
3253 if (strcmp(sec_name, name) != 0)
3280 const char *name;
3290 name = elf_sec_str(obj, sh->sh_name);
3291 if (!name) {
3292 pr_warn("elf: failed to get section(%zu) name from %s: %s\n",
3297 return name;
3334 static bool is_sec_name_dwarf(const char *name)
3337 return str_has_pfx(name, ".debug_");
3340 static bool ignore_elf_section(Elf64_Shdr *hdr, const char *name)
3352 strcmp(name, ".text") == 0)
3356 if (is_sec_name_dwarf(name))
3359 if (str_has_pfx(name, ".rel")) {
3360 name += sizeof(".rel") - 1;
3362 if (is_sec_name_dwarf(name))
3366 if (strcmp(name, BTF_ELF_SEC) == 0 ||
3367 strcmp(name, BTF_EXT_ELF_SEC) == 0)
3393 const char *name;
3454 name = elf_sec_str(obj, sh->sh_name);
3455 if (!name)
3458 if (ignore_elf_section(sh, name))
3466 idx, name, (unsigned long)data->d_size,
3470 if (strcmp(name, "license") == 0) {
3474 } else if (strcmp(name, "version") == 0) {
3478 } else if (strcmp(name, "maps") == 0) {
3481 } else if (strcmp(name, MAPS_ELF_SEC) == 0) {
3483 } else if (strcmp(name, BTF_ELF_SEC) == 0) {
3487 } else if (strcmp(name, BTF_EXT_ELF_SEC) == 0) {
3495 if (strcmp(name, ".text") == 0)
3497 err = bpf_object__add_programs(obj, data, name, idx);
3500 } else if (strcmp(name, DATA_SEC) == 0 ||
3501 str_has_pfx(name, DATA_SEC ".")) {
3505 } else if (strcmp(name, RODATA_SEC) == 0 ||
3506 str_has_pfx(name, RODATA_SEC ".")) {
3510 } else if (strcmp(name, STRUCT_OPS_SEC) == 0) {
3513 } else if (strcmp(name, STRUCT_OPS_LINK_SEC) == 0) {
3518 idx, name);
3529 strcmp(name, ".rel" STRUCT_OPS_SEC) &&
3530 strcmp(name, ".rel" STRUCT_OPS_LINK_SEC) &&
3531 strcmp(name, ".rel" MAPS_ELF_SEC)) {
3533 idx, name, targ_sec_idx,
3541 } else if (sh->sh_type == SHT_NOBITS && (strcmp(name, BSS_SEC) == 0 ||
3542 str_has_pfx(name, BSS_SEC "."))) {
3547 pr_info("elf: skipping section(%d) %s (size %zu)\n", idx, name,
3557 /* sort BPF programs by section name and in-section instruction offset
3654 const char *name;
3657 name = btf__name_by_offset(btf, t->name_off);
3678 if (strcmp(name, "libbpf_tristate"))
3682 if (strcmp(name, "libbpf_tristate"))
3713 /* resolve ties by name */
3714 return strcmp(a->name, b->name);
3825 ext->name = btf__name_by_offset(obj->btf, t->name_off);
3829 ext_essent_len = bpf_core_essential_name_len(ext->name);
3831 if (ext_essent_len != strlen(ext->name)) {
3832 ext->essent_name = strndup(ext->name, ext_essent_len);
3849 ext->name, KCONFIG_SEC);
3887 /* sort externs by type, for kcfg ones also by (align, size, name) */
3901 * its name string will be used to refill
3902 * the missing param's name.
3911 pr_debug("extern (ksym) #%d: symbol %d, name %s\n",
3912 i, ext->sym_idx, ext->name);
3938 * func proto does not have param name.
3968 pr_debug("extern (kcfg) #%d: symbol %d, off %u, name %s\n",
3969 i, ext->sym_idx, ext->kcfg.data_off, ext->name);
3998 const char *name)
4005 if (!strcmp(prog->name, name))
4063 prog->name, sym_name, insn_idx, insn->code);
4079 prog->name, sym_name, sym_idx);
4083 prog->name, i, ext->name, ext->sym_idx, insn_idx);
4096 pr_warn("prog '%s': incorrect bpf_call opcode\n", prog->name);
4103 prog->name, sym_name, sym_sec_name);
4108 prog->name, sym_name, (size_t)sym->st_value);
4119 prog->name, sym_name, shdr_idx);
4130 prog->name, sym_name, (size_t)sym->st_value, insn->imm);
4147 prog->name, sym_name, sym_sec_name);
4157 prog->name, map_idx, map->name, map->sec_idx,
4163 prog->name, sym_sec_name, (size_t)sym->st_value);
4176 prog->name, sym_sec_name);
4184 prog->name, map_idx, map->name, map->sec_idx,
4190 prog->name, sym_sec_name);
4298 * will point to empty string (0), so fetch section name
4429 name_len = strlen(info.name);
4430 if (name_len == BPF_OBJ_NAME_LEN - 1 && strncmp(map->name, info.name, name_len) == 0)
4431 new_name = strdup(map->name);
4433 new_name = strdup(info.name);
4454 free(map->name);
4457 map->name = new_name;
4563 /* make sure loading with name works */
4791 char name[16];
4799 info.name = ptr_to_u64(name);
4800 info.name_len = sizeof(name);
4802 /* check that BPF_OBJ_GET_INFO_BY_FD supports specifying name pointer;
4804 * name/name_len fields in struct bpf_btf_info.
4909 "BPF program name", probe_kern_prog_name,
5080 map->name, cp);
5091 map->name, cp);
5108 map_name = map->name;
5131 map->name, err);
5183 map->name, cp, err);
5229 map->name, i, targ_map->name, fd, err);
5233 map->name, i, targ_map->name, fd);
5262 map->name, i, targ_prog->name, fd, err);
5266 map->name, i, targ_prog->name, fd);
5303 map->name, nr_cpus);
5306 pr_debug("map '%s': setting size to %d\n", map->name, nr_cpus);
5329 * out with program name and relocation index logged.
5343 pr_debug("map '%s': skipped auto-creating...\n", map->name);
5357 map->name);
5362 map->name);
5370 map->name, map->fd);
5377 map->name, map->fd);
5405 map->name, map->pin_path, err);
5415 pr_warn("map '%s': failed to create: %s(%d)\n", map->name, cp, err);
5424 /* check X___Y name pattern, where X and Y are not underscores */
5430 /* Given 'some_struct_name___with_flavor' return the length of a name prefix
5431 * before last triple underscore. Struct name part after last triple
5434 size_t bpf_core_essential_name_len(const char *name)
5436 size_t n = strlen(name);
5440 if (bpf_core_is_flavor_sep(name + i))
5512 char name[64];
5554 info.name = ptr_to_u64(name);
5555 info.name_len = sizeof(name);
5565 if (!info.kernel_btf || strcmp(name, "vmlinux") == 0) {
5574 name, id, err);
5588 mod_btf->name = strdup(name);
5589 if (!mod_btf->name) {
5651 obj->btf_modules[i].name,
5667 * checked for name match. Beyond that initial root-level name check, names
5748 const char *prog_name = prog->name;
5864 prog->name, i, err);
5874 prog->name, i, err);
5878 err = bpf_core_patch_insn(prog->name, insn, insn_idx, rec, i, &targ_res);
5881 prog->name, i, insn_idx, err);
5912 prog->name, relo_idx, insn_idx, map_idx, map->name);
5940 prog->name, relo_idx, insn_idx, ext->name);
6035 prog->name, i);
6048 prog->name, i, relo->type);
6150 prog->name, err);
6158 pr_warn("prog '%s': missing .BTF.ext function info.\n", prog->name);
6163 prog->name);
6178 prog->name, err);
6186 pr_warn("prog '%s': missing .BTF.ext line info.\n", prog->name);
6191 prog->name);
6270 prog->name, insn_idx, relo->type);
6294 prog->name, insn_idx);
6310 prog->name);
6330 pr_warn("prog '%s': failed to realloc prog code\n", main_prog->name);
6340 main_prog->name, subprog->insns_cnt, subprog->name);
6364 prog->name, insn_idx, insn->imm, subprog->name, subprog->sub_insn_off);
6574 prog->name, err);
6588 prog->name, err);
6610 const char *name, *mname, *type;
6636 name = elf_sym_str(obj, sym->st_name) ?: "<?>";
6638 pr_debug(".maps relo #%d: for %zd value %zd rel->r_offset %zu name %d ('%s')\n",
6640 (size_t)rel->r_offset, sym->st_name, name);
6654 i, name, (size_t)rel->r_offset);
6664 i, name);
6670 i, map->name, sizeof(int));
6673 targ_map = bpf_object__find_map_by_name(obj, name);
6676 i, name);
6680 targ_prog = bpf_object__find_program_by_name(obj, name);
6683 i, name);
6690 i, name);
6730 i, map->name, moff, type, name);
6859 prog->name);
6903 pr_warn("prog '%s': missing BPF prog type, check ELF section name '%s'\n",
6904 prog->name, prog->sec_name);
6912 prog_name = prog->name;
6939 prog->name, err);
6950 bpf_gen__prog_load(obj->gen_loader, prog->type, prog->name,
6993 prog->name, log_buf);
7008 prog->name, map->real_name, cp);
7039 pr_warn("prog '%s': BPF program load failed: %s\n", prog->name, cp);
7044 prog->name, log_buf);
7130 err = bpf_core_parse_spec(prog->name, prog->obj->btf, relo, &spec);
7153 * "345" in "2001000345" is a map index in obj->maps to fetch map name.
7171 insn_idx, map->name);
7186 * "345" in "2002000345" is an extern index in obj->externs to fetch kfunc name.
7204 insn_idx, ext->name);
7275 bpf_gen__record_extern(obj->gen_loader, ext->name,
7280 bpf_gen__record_extern(obj->gen_loader, ext->name,
7321 pr_debug("prog '%s': skipped loading\n", prog->name);
7332 pr_warn("prog '%s': failed to load: %d\n", prog->name, err);
7352 pr_debug("prog '%s': unrecognized ELF section name '%s'\n",
7353 prog->name, prog->sec_name);
7367 prog->name, err);
7635 id = find_ksym_btf_id(obj, ext->name, BTF_KIND_VAR, &btf, &mod_btf);
7640 ext->name);
7663 ext->name, local_type_id,
7673 ext->name, id, btf_kind_str(targ_var), targ_var_name);
7689 kfunc_id = find_ksym_btf_id(obj, ext->essent_name ?: ext->name, BTF_KIND_FUNC, &kern_btf,
7695 ext->name);
7709 ext->name, local_func_proto_id,
7710 mod_btf ? mod_btf->name : "vmlinux", kfunc_proto_id);
7719 ext->name, mod_btf->fd_array_idx);
7745 ext->name, mod_btf ? mod_btf->name : "vmlinux", kfunc_id);
7807 if (str_has_pfx(ext->name, "CONFIG_")) {
7813 if (strcmp(ext->name, "LINUX_KERNEL_VERSION") == 0) {
7816 pr_warn("extern (kcfg) '%s': failed to get kernel version\n", ext->name);
7819 } else if (strcmp(ext->name, "LINUX_HAS_BPF_COOKIE") == 0) {
7821 } else if (strcmp(ext->name, "LINUX_HAS_SYSCALL_WRAPPER") == 0) {
7823 } else if (!str_has_pfx(ext->name, "LINUX_") || !ext->is_weak) {
7831 pr_warn("extern (kcfg) '%s': unrecognized virtual extern\n", ext->name);
7839 ext->name, (long long)value);
7841 pr_warn("extern '%s': unrecognized extern kind\n", ext->name);
7877 pr_warn("extern '%s' (strong): not resolved\n", ext->name);
7881 ext->name);
7927 pr_warn("object '%s': load can't be attempted twice\n", obj->name);
7963 free(obj->btf_modules[i].name);
8051 pr_warn("prog '%s': can't pin program that wasn't loaded\n", prog->name);
8066 pr_warn("prog '%s': failed to pin at '%s': %s\n", prog->name, path, cp);
8070 pr_debug("prog '%s': pinned at '%s'\n", prog->name, path);
8079 pr_warn("prog '%s': can't unpin program that wasn't loaded\n", prog->name);
8091 pr_debug("prog '%s': unpinned from '%s'\n", prog->name, path);
8323 err = pathname_concat(buf, sizeof(buf), path, prog->name);
8336 if (pathname_concat(buf, sizeof(buf), path, prog->name))
8356 err = pathname_concat(buf, sizeof(buf), path, prog->name);
8425 zfree(&map->name);
8476 return obj ? obj->name : libbpf_err_ptr(-EINVAL);
8577 return prog->name;
8630 pr_warn("prog '%s': failed to realloc prog code\n", prog->name);
9046 int libbpf_prog_type_by_name(const char *name, enum bpf_prog_type *prog_type,
9052 if (!name)
9055 sec_def = find_sec_def(name);
9062 pr_debug("failed to guess program type from ELF section '%s'\n", name);
9135 const char *name;
9157 name = elf_sym_str(obj, sym->st_name) ?: "<?>";
9168 pr_debug("struct_ops reloc %s: for %lld value %lld shdr_idx %u rel->r_offset %zu map->sec_offset %zu name %d (\'%s\')\n",
9169 map->name,
9173 map->sec_offset, sym->st_name, name);
9177 map->name, (size_t)rel->r_offset, shdr_idx);
9182 map->name, (unsigned long long)sym->st_value);
9190 map->name, moff);
9194 name = btf__name_by_offset(btf, member->name_off);
9198 map->name, name);
9205 map->name, shdr_idx, name);
9212 map->name, prog->name);
9232 map->name, prog->name, prog->sec_name, prog->type,
9233 prog->attach_btf_id, prog->expected_attach_type, name);
9272 const char *name, __u32 kind)
9278 "%s%s", prefix, name);
9288 static inline int find_attach_btf_id(struct btf *btf, const char *name,
9295 return find_btf_by_prefix_kind(btf, prefix, name, kind);
9298 int libbpf_find_vmlinux_btf_id(const char *name,
9311 err = find_attach_btf_id(btf, name, attach_type);
9313 pr_warn("%s is not found in vmlinux BTF\n", name);
9319 static int libbpf_find_prog_btf_id(const char *name, __u32 attach_prog_fd)
9345 err = btf__find_by_name_kind(btf, name, BTF_KIND_FUNC);
9348 pr_warn("%s is not found in prog's BTF\n", name);
9402 pr_warn("prog '%s': attach program FD is not set\n", prog->name);
9408 prog->name, attach_prog_fd, attach_name, err);
9426 prog->name, attach_name, err);
9432 int libbpf_attach_type_by_name(const char *name,
9438 if (!name)
9441 sec_def = find_sec_def(name);
9443 pr_debug("failed to guess attach type based on ELF section name '%s'\n", name);
9470 * their user-visible name differs from kernel-visible name. Users see
9471 * such map's corresponding ELF section name as a map name.
9473 * maps to know which name has to be returned to the user.
9490 return map->name;
9775 bpf_object__find_map_by_name(const struct bpf_object *obj, const char *name)
9780 /* if it's a special internal map name (which always starts
9781 * with dot) then check if that special name matches the
9782 * real map name (ELF section name)
9784 if (name[0] == '.') {
9785 if (pos->real_name && strcmp(pos->real_name, name) == 0)
9789 /* otherwise map name has to be an exact match */
9791 if (strcmp(pos->real_name, name) == 0)
9795 if (strcmp(pos->name, name) == 0)
9802 bpf_object__find_map_fd_by_name(const struct bpf_object *obj, const char *name)
9804 return bpf_map__fd(bpf_object__find_map_by_name(obj, name));
9815 map->name, key_sz, map->def.key_size);
9832 map->name, value_sz, num_cpu, elem_sz, num_cpu * elem_sz);
9840 map->name, value_sz, map->def.value_size);
10121 prog->name, pfd);
10127 prog->name);
10147 prog->name, pfd,
10154 pr_warn("prog '%s': user context value is not supported\n", prog->name);
10162 prog->name, pfd, libbpf_strerror_r(err, errmsg, sizeof(errmsg)));
10165 prog->name, pfd);
10173 prog->name, pfd, libbpf_strerror_r(err, errmsg, sizeof(errmsg)));
10251 static int perf_event_open_probe(bool uprobe, bool retprobe, const char *name,
10287 attr.config1 = ptr_to_u64(name); /* kprobe_func or uprobe_path */
10371 /* sanitize binary_path in the probe name */
10571 prog->name, retprobe ? "kretprobe" : "kprobe",
10581 prog->name, retprobe ? "kretprobe" : "kprobe",
10724 char *name;
10743 name = strdup(sym_name);
10744 if (!name) {
10749 syms[cnt++] = name;
10895 prog->name, libbpf_strerror_r(err, errmsg, sizeof(errmsg)));
10930 pr_warn("kprobe name is invalid: %s\n", func_name);
11018 pr_warn("prog '%s': invalid format of section definition '%s'\n", prog->name,
11035 /* sanitize binary_path in the probe name */
11110 /* Find offset of function name in archive specified by path. Currently
11112 * Android in the form of APKs, for example. "file_name" is the name of the ELF
11113 * file inside the archive. "func_name" matches symbol name or name@@LIB for
11311 prog->name, path, err);
11353 prog->name, libbpf_strerror_r(err, errmsg, sizeof(errmsg)));
11405 prog->name, binary_path, err);
11469 prog->name, retprobe ? "uretprobe" : "uprobe",
11480 prog->name, retprobe ? "uretprobe" : "uprobe",
11530 prog->name, prog->sec_name);
11538 prog->name);
11546 pr_warn("prog '%s': invalid format of section definition '%s'\n", prog->name,
11583 prog->name);
11594 prog->name, binary_path, err);
11622 char *path = NULL, *provider = NULL, *name = NULL;
11633 n = sscanf(sec_name, "usdt/%m[^:]:%m[^:]:%m[^:]", &path, &provider, &name);
11635 pr_warn("invalid section '%s', expected SEC(\"usdt/<path>:<provider>:<name>\")\n",
11640 provider, name, NULL);
11645 free(name);
11718 prog->name, tp_category, tp_name,
11727 prog->name, tp_category, tp_name,
11755 /* extract "tp/<category>/<name>" or "tracepoint/<category>/<name>" */
11782 pr_warn("prog '%s': can't attach before loaded\n", prog->name);
11796 prog->name, tp_name, libbpf_strerror_r(pfd, errmsg, sizeof(errmsg)));
11835 pr_warn("prog '%s': invalid section name '%s'\n",
11836 prog->name, prog->sec_name);
11858 pr_warn("prog '%s': can't attach before loaded\n", prog->name);
11874 prog->name, libbpf_strerror_r(pfd, errmsg, sizeof(errmsg)));
11921 pr_warn("prog '%s': can't attach before loaded\n", prog->name);
11936 prog->name, target_name,
11979 prog->name);
11984 prog->name);
12005 prog->name);
12011 prog->name);
12052 pr_warn("prog '%s': can't attach before loaded\n", prog->name);
12067 prog->name, libbpf_strerror_r(link_fd, errmsg, sizeof(errmsg)));
12092 pr_warn("prog '%s': can't attach before loaded\n", prog->name);
12114 prog->name, libbpf_strerror_r(link_fd, errmsg, sizeof(errmsg)));
12522 map.name);
12960 const char *name = maps[i].name;
12963 *map = bpf_object__find_map_by_name(obj, name);
12965 pr_warn("failed to find skeleton map '%s'\n", name);
12984 const char *name = progs[i].name;
12986 *prog = bpf_object__find_program_by_name(obj, name);
12988 pr_warn("failed to find skeleton program '%s'\n", name);
12999 .object_name = s->name,
13005 * explicitly. Overwriting object name for skeletons is discouraged,
13006 * as it breaks global data maps, because they contain object name
13007 * prefix as their own map name prefix. When skeleton is generated,
13008 * bpftool is making an assumption that this name will stay the same.
13013 skel_opts.object_name = s->name;
13020 s->name, err);
13027 pr_warn("failed to populate skeleton maps for '%s': %d\n", s->name, err);
13033 pr_warn("failed to populate skeleton progs for '%s': %d\n", s->name, err);
13091 if (strcmp(var_name, var_skel->name) == 0) {
13116 pr_warn("failed to load BPF skeleton '%s': %d\n", s->name, err);
13192 * binary and function name, such BPF program can be