Lines Matching refs:base_btf
97 struct btf *base_btf; member
278 if (btf->base_btf && hdr->str_len == 0) in btf_parse_str_sec()
284 if (!btf->base_btf && start[0]) { in btf_parse_str_sec()
620 return btf->base_btf; in btf__base_btf()
629 return btf_type_by_id(btf->base_btf, type_id); in btf_type_by_id()
659 if (btf->base_btf && btf->base_btf->ptr_sz > 0) in determine_ptr_size()
660 return btf->base_btf->ptr_sz; in determine_ptr_size()
976 btf__free(btf->base_btf); in btf__free()
980 static struct btf *btf_new_empty(struct btf *base_btf) in btf_new_empty() argument
995 if (base_btf) { in btf_new_empty()
996 btf->base_btf = base_btf; in btf_new_empty()
997 btf->start_id = btf__type_cnt(base_btf); in btf_new_empty()
998 btf->start_str_off = base_btf->hdr->str_len; in btf_new_empty()
999 btf->swapped_endian = base_btf->swapped_endian; in btf_new_empty()
1003 btf->raw_size = sizeof(struct btf_header) + (base_btf ? 0 : 1); in btf_new_empty()
1017 btf->hdr->str_len = base_btf ? 0 : 1; /* empty string at offset 0 */ in btf_new_empty()
1027 struct btf *btf__new_empty_split(struct btf *base_btf) in btf__new_empty_split() argument
1029 return libbpf_ptr(btf_new_empty(base_btf)); in btf__new_empty_split()
1032 static struct btf *btf_new(const void *data, __u32 size, struct btf *base_btf) in btf_new() argument
1046 if (base_btf) { in btf_new()
1047 btf->base_btf = base_btf; in btf_new()
1048 btf->start_id = btf__type_cnt(base_btf); in btf_new()
1049 btf->start_str_off = base_btf->hdr->str_len; in btf_new()
1088 struct btf *btf__new_split(const void *data, __u32 size, struct btf *base_btf) in btf__new_split() argument
1090 return libbpf_ptr(btf_new(data, size, base_btf)); in btf__new_split()
1165 static struct btf *btf_parse_elf(const char *path, struct btf *base_btf, in btf_parse_elf() argument
1213 dist_base_btf ?: base_btf); in btf_parse_elf()
1218 if (dist_base_btf && base_btf) { in btf_parse_elf()
1219 err = btf__relocate(btf, base_btf); in btf_parse_elf()
1271 struct btf *btf__parse_elf_split(const char *path, struct btf *base_btf) in btf__parse_elf_split() argument
1273 return libbpf_ptr(btf_parse_elf(path, base_btf, NULL)); in btf__parse_elf_split()
1276 static struct btf *btf_parse_raw(const char *path, struct btf *base_btf) in btf_parse_raw() argument
1330 btf = btf_new(data, sz, base_btf); in btf_parse_raw()
1344 struct btf *btf__parse_raw_split(const char *path, struct btf *base_btf) in btf__parse_raw_split() argument
1346 return libbpf_ptr(btf_parse_raw(path, base_btf)); in btf__parse_raw_split()
1349 static struct btf *btf_parse(const char *path, struct btf *base_btf, struct btf_ext **btf_ext) in btf_parse() argument
1357 btf = btf_parse_raw(path, base_btf); in btf_parse()
1363 return btf_parse_elf(path, base_btf, btf_ext); in btf_parse()
1371 struct btf *btf__parse_split(const char *path, struct btf *base_btf) in btf__parse_split() argument
1373 return libbpf_ptr(btf_parse(path, base_btf, NULL)); in btf__parse_split()
1554 return btf__str_by_offset(btf->base_btf, offset); in btf__str_by_offset()
1566 struct btf *btf_get_from_fd(int btf_fd, struct btf *base_btf) in btf_get_from_fd() argument
1613 btf = btf_new(ptr, btf_info.btf_size, base_btf); in btf_get_from_fd()
1620 struct btf *btf__load_from_kernel_by_id_split(__u32 id, struct btf *base_btf) in btf__load_from_kernel_by_id_split() argument
1629 btf = btf_get_from_fd(btf_fd, base_btf); in btf__load_from_kernel_by_id_split()
1695 if (!btf->base_btf && btf->hdr->str_len == 1) in btf_ensure_modifiable()
1720 if (btf->base_btf) { in btf__find_str()
1721 off = btf__find_str(btf->base_btf, s); in btf__find_str()
1746 if (btf->base_btf) { in btf__add_str()
1747 off = btf__find_str(btf->base_btf, s); in btf__add_str()
1878 if (src_btf->base_btf) in btf__add_btf()
3563 if (d->btf->base_btf) { in strs_dedup_remap_str_off()
3564 err = btf__find_str(d->btf->base_btf, s); in strs_dedup_remap_str_off()
3605 if (!d->btf->base_btf) { in btf_dedup_strings()
3935 if (!d->btf->base_btf) in btf_dedup_prep()
5486 void btf_set_base_btf(struct btf *btf, const struct btf *base_btf) in btf_set_base_btf() argument
5488 btf->base_btf = (struct btf *)base_btf; in btf_set_base_btf()
5489 btf->start_id = btf__type_cnt(base_btf); in btf_set_base_btf()
5490 btf->start_str_off = base_btf->hdr->str_len; in btf_set_base_btf()
5493 int btf__relocate(struct btf *btf, const struct btf *base_btf) in btf__relocate() argument
5495 int err = btf_relocate(btf, base_btf, NULL); in btf__relocate()