Lines Matching refs:data
32 /* raw BTF data in native endianness */
34 /* raw BTF data in non-native endianness */
55 * If BTF data is later modified, e.g., due to types added or
131 /* Ensure given dynamically allocated memory region pointed to by *data* with
135 * If necessary, memory is reallocated and all existing data is copied over,
136 * new pointer to the memory region is stored at *data, new memory region
141 void *libbpf_add_mem(void **data, size_t *cap_cnt, size_t elem_sz,
148 return *data + cur_cnt * elem_sz;
163 new_data = libbpf_reallocarray(*data, new_cnt, elem_sz);
170 *data = new_data;
178 int libbpf_ensure_mem(void **data, size_t *cap_cnt, size_t elem_sz, size_t need_cnt)
185 p = libbpf_add_mem(data, cap_cnt, elem_sz, *cap_cnt, SIZE_MAX, need_cnt - *cap_cnt);
244 pr_debug("BTF header len %u larger than data size %u\n",
256 pr_debug("Invalid BTF data sections layout: type data at %u + %u, strings data at %u + %u\n",
444 pr_warn("BTF types data is malformed\n");
803 * might still have a cached contiguous raw data present,
867 static struct btf *btf_new(const void *data, __u32 size, struct btf *base_btf)
892 memcpy(btf->raw_data, data, size);
917 struct btf *btf__new(const void *data, __u32 size)
919 return libbpf_ptr(btf_new(data, size, NULL));
987 pr_warn("failed to get section(%d, %s) data from %s\n",
995 pr_warn("failed to get section(%d, %s) data from %s\n",
1061 void *data = NULL;
1100 /* pre-alloc memory and read all of BTF data */
1101 data = malloc(sz);
1102 if (!data) {
1106 if (fread(data, 1, sz, f) < sz) {
1111 /* finally parse BTF data */
1112 btf = btf_new(data, sz, base_btf);
1115 free(data);
1173 /* cache native raw data representation */
1259 void *data, *p;
1263 data = swap_endian ? btf->raw_data_swapped : btf->raw_data;
1264 if (data) {
1266 return data;
1270 data = calloc(1, data_sz);
1271 if (!data)
1273 p = data;
1299 return data;
1301 free(data);
1309 void *data;
1311 data = btf_get_raw_data(btf, &data_sz, btf->swapped_endian);
1312 if (!data)
1317 btf->raw_data_swapped = data;
1319 btf->raw_data = data;
1321 return data;
1444 /* split raw data into three memory regions */
1686 /* bulk copy types data for all types from src_btf */
1710 /* go to next type data and type offset index entry */
1715 /* Up until now any of the copied type data was effectively invisible,
1719 * that we've copied and rewritten all the data successfully, we can
1738 /* and now restore original strings section size; types data size
2035 /* decompose and invalidate raw data */
2145 /* decompose and invalidate raw data */
2220 /* decompose and invalidate raw data */
2441 /* decompose and invalidate raw data */
2519 * - *byte_sz* - data section size, in bytes.
2558 * Append new data section variable information entry for current DATASEC type:
2560 * - *offset* - variable offset within data section, in bytes;
2583 /* decompose and invalidate raw data */
2674 info = btf_ext->data + btf_ext->hdr->hdr_len + ext_sec->off;
2677 if (btf_ext->data + btf_ext->data_size < info + ext_sec->len) {
2785 static int btf_ext_parse_hdr(__u8 *data, __u32 data_size)
2787 const struct btf_ext_header *hdr = (struct btf_ext_header *)data;
2814 pr_debug("BTF.ext has no data\n");
2828 free(btf_ext->data);
2832 struct btf_ext *btf_ext__new(const __u8 *data, __u32 size)
2842 btf_ext->data = malloc(size);
2843 if (!btf_ext->data) {
2847 memcpy(btf_ext->data, data, size);
2849 err = btf_ext_parse_hdr(btf_ext->data, size);
2885 return btf_ext->data;
2905 * section with all BTF type descriptors and string data. It overwrites that
2911 * If function returns with error, type/string data might be garbled and should
2927 * BTF type descriptor, greatly reducing resulting size of BTF data.
2929 * Compilation unit isolation and subsequent duplication of data is not the only
2966 * In case of CU #1, BTF data will know only that `struct B` exist (but no
3020 * information into (while resolving FWDs), as it discovers it from data in
3366 /* replace BTF string data and hash with deduped ones */
4765 * data out of it to use for target BTF.