• Home
  • Raw
  • Download

Lines Matching refs:btf_ext

382 struct btf *btf__parse_elf(const char *path, struct btf_ext **btf_ext)  in btf__parse_elf()  argument
447 } else if (btf_ext && strcmp(name, BTF_EXT_ELF_SEC) == 0) { in btf__parse_elf()
468 if (btf_ext && btf_ext_data) { in btf__parse_elf()
469 *btf_ext = btf_ext__new(btf_ext_data->d_buf, in btf__parse_elf()
471 if (IS_ERR(*btf_ext)) in btf__parse_elf()
473 } else if (btf_ext) { in btf__parse_elf()
474 *btf_ext = NULL; in btf__parse_elf()
489 if (btf_ext && IS_ERR(*btf_ext)) { in btf__parse_elf()
491 err = PTR_ERR(*btf_ext); in btf__parse_elf()
775 static int btf_ext_setup_info(struct btf_ext *btf_ext, in btf_ext_setup_info() argument
793 info = btf_ext->data + btf_ext->hdr->hdr_len + ext_sec->off; in btf_ext_setup_info()
796 if (btf_ext->data + btf_ext->data_size < info + ext_sec->len) { in btf_ext_setup_info()
864 static int btf_ext_setup_func_info(struct btf_ext *btf_ext) in btf_ext_setup_func_info() argument
867 .off = btf_ext->hdr->func_info_off, in btf_ext_setup_func_info()
868 .len = btf_ext->hdr->func_info_len, in btf_ext_setup_func_info()
870 .ext_info = &btf_ext->func_info, in btf_ext_setup_func_info()
874 return btf_ext_setup_info(btf_ext, &param); in btf_ext_setup_func_info()
877 static int btf_ext_setup_line_info(struct btf_ext *btf_ext) in btf_ext_setup_line_info() argument
880 .off = btf_ext->hdr->line_info_off, in btf_ext_setup_line_info()
881 .len = btf_ext->hdr->line_info_len, in btf_ext_setup_line_info()
883 .ext_info = &btf_ext->line_info, in btf_ext_setup_line_info()
887 return btf_ext_setup_info(btf_ext, &param); in btf_ext_setup_line_info()
890 static int btf_ext_setup_offset_reloc(struct btf_ext *btf_ext) in btf_ext_setup_offset_reloc() argument
893 .off = btf_ext->hdr->offset_reloc_off, in btf_ext_setup_offset_reloc()
894 .len = btf_ext->hdr->offset_reloc_len, in btf_ext_setup_offset_reloc()
896 .ext_info = &btf_ext->offset_reloc_info, in btf_ext_setup_offset_reloc()
900 return btf_ext_setup_info(btf_ext, &param); in btf_ext_setup_offset_reloc()
936 void btf_ext__free(struct btf_ext *btf_ext) in btf_ext__free() argument
938 if (!btf_ext) in btf_ext__free()
940 free(btf_ext->data); in btf_ext__free()
941 free(btf_ext); in btf_ext__free()
944 struct btf_ext *btf_ext__new(__u8 *data, __u32 size) in btf_ext__new()
946 struct btf_ext *btf_ext; in btf_ext__new() local
953 btf_ext = calloc(1, sizeof(struct btf_ext)); in btf_ext__new()
954 if (!btf_ext) in btf_ext__new()
957 btf_ext->data_size = size; in btf_ext__new()
958 btf_ext->data = malloc(size); in btf_ext__new()
959 if (!btf_ext->data) { in btf_ext__new()
963 memcpy(btf_ext->data, data, size); in btf_ext__new()
965 if (btf_ext->hdr->hdr_len < in btf_ext__new()
968 err = btf_ext_setup_func_info(btf_ext); in btf_ext__new()
972 err = btf_ext_setup_line_info(btf_ext); in btf_ext__new()
976 if (btf_ext->hdr->hdr_len < in btf_ext__new()
979 err = btf_ext_setup_offset_reloc(btf_ext); in btf_ext__new()
985 btf_ext__free(btf_ext); in btf_ext__new()
989 return btf_ext; in btf_ext__new()
992 const void *btf_ext__get_raw_data(const struct btf_ext *btf_ext, __u32 *size) in btf_ext__get_raw_data() argument
994 *size = btf_ext->data_size; in btf_ext__get_raw_data()
995 return btf_ext->data; in btf_ext__get_raw_data()
1047 const struct btf_ext *btf_ext, in btf_ext__reloc_func_info() argument
1051 return btf_ext_reloc_info(btf, &btf_ext->func_info, sec_name, in btf_ext__reloc_func_info()
1056 const struct btf_ext *btf_ext, in btf_ext__reloc_line_info() argument
1060 return btf_ext_reloc_info(btf, &btf_ext->line_info, sec_name, in btf_ext__reloc_line_info()
1064 __u32 btf_ext__func_info_rec_size(const struct btf_ext *btf_ext) in btf_ext__func_info_rec_size() argument
1066 return btf_ext->func_info.rec_size; in btf_ext__func_info_rec_size()
1069 __u32 btf_ext__line_info_rec_size(const struct btf_ext *btf_ext) in btf_ext__line_info_rec_size() argument
1071 return btf_ext->line_info.rec_size; in btf_ext__line_info_rec_size()
1076 static struct btf_dedup *btf_dedup_new(struct btf *btf, struct btf_ext *btf_ext,
1223 int btf__dedup(struct btf *btf, struct btf_ext *btf_ext, in btf__dedup() argument
1226 struct btf_dedup *d = btf_dedup_new(btf, btf_ext, opts); in btf__dedup()
1280 struct btf_ext *btf_ext; member
1385 static struct btf_dedup *btf_dedup_new(struct btf *btf, struct btf_ext *btf_ext, in btf_dedup_new() argument
1401 d->btf_ext = btf_ext; in btf_dedup_new()
1505 if (!d->btf_ext) in btf_for_each_str_off()
1508 line_data_cur = d->btf_ext->line_info.info; in btf_for_each_str_off()
1509 line_data_end = d->btf_ext->line_info.info + d->btf_ext->line_info.len; in btf_for_each_str_off()
1510 rec_size = d->btf_ext->line_info.rec_size; in btf_for_each_str_off()