Lines Matching defs:data
36 /* raw BTF data in native endianness */
38 /* raw BTF data in non-native endianness */
59 * If BTF data is later modified, e.g., due to types added or
135 /* Ensure given dynamically allocated memory region pointed to by *data* with
139 * If necessary, memory is reallocated and all existing data is copied over,
140 * new pointer to the memory region is stored at *data, new memory region
145 void *libbpf_add_mem(void **data, size_t *cap_cnt, size_t elem_sz,
152 return *data + cur_cnt * elem_sz;
167 new_data = libbpf_reallocarray(*data, new_cnt, elem_sz);
174 *data = new_data;
182 int libbpf_ensure_mem(void **data, size_t *cap_cnt, size_t elem_sz, size_t need_cnt)
189 p = libbpf_add_mem(data, cap_cnt, elem_sz, *cap_cnt, SIZE_MAX, need_cnt - *cap_cnt);
248 pr_debug("BTF header len %u larger than data size %u\n",
260 pr_debug("Invalid BTF data sections layout: type data at %u + %u, strings data at %u + %u\n",
448 pr_warn("BTF types data is malformed\n");
966 * might still have a cached contiguous raw data present,
1030 static struct btf *btf_new(const void *data, __u32 size, struct btf *base_btf)
1055 memcpy(btf->raw_data, data, size);
1081 struct btf *btf__new(const void *data, __u32 size)
1083 return libbpf_ptr(btf_new(data, size, NULL));
1230 pr_warn("failed to get section(%d, %s) data from %s\n",
1245 pr_warn("failed to get section(%d, %s) data from %s\n",
1323 void *data = NULL;
1362 /* pre-alloc memory and read all of BTF data */
1363 data = malloc(sz);
1364 if (!data) {
1368 if (fread(data, 1, sz, f) < sz) {
1373 /* finally parse BTF data */
1374 btf = btf_new(data, sz, base_btf);
1377 free(data);
1435 /* cache native raw data representation */
1521 void *data, *p;
1525 data = swap_endian ? btf->raw_data_swapped : btf->raw_data;
1526 if (data) {
1528 return data;
1532 data = calloc(1, data_sz);
1533 if (!data)
1535 p = data;
1561 return data;
1563 free(data);
1571 void *data;
1573 data = btf_get_raw_data(btf, &data_sz, btf->swapped_endian);
1574 if (!data)
1579 btf->raw_data_swapped = data;
1581 btf->raw_data = data;
1583 return data;
1706 /* split raw data into three memory regions */
1948 /* bulk copy types data for all types from src_btf */
1972 /* go to next type data and type offset index entry */
1977 /* Up until now any of the copied type data was effectively invisible,
1981 * that we've copied and rewritten all the data successfully, we can
2000 /* and now restore original strings section size; types data size
2297 /* decompose and invalidate raw data */
2407 /* decompose and invalidate raw data */
2482 /* decompose and invalidate raw data */
2703 /* decompose and invalidate raw data */
2781 * - *byte_sz* - data section size, in bytes.
2820 * Append new data section variable information entry for current DATASEC type:
2822 * - *offset* - variable offset within data section, in bytes;
2845 /* decompose and invalidate raw data */
2936 info = btf_ext->data + btf_ext->hdr->hdr_len + ext_sec->off;
2939 if (btf_ext->data + btf_ext->data_size < info + ext_sec->len) {
3047 static int btf_ext_parse_hdr(__u8 *data, __u32 data_size)
3049 const struct btf_ext_header *hdr = (struct btf_ext_header *)data;
3076 pr_debug("BTF.ext has no data\n");
3090 free(btf_ext->data);
3094 struct btf_ext *btf_ext__new(const __u8 *data, __u32 size)
3104 btf_ext->data = malloc(size);
3105 if (!btf_ext->data) {
3109 memcpy(btf_ext->data, data, size);
3111 err = btf_ext_parse_hdr(btf_ext->data, size);
3147 return btf_ext->data;
3167 * section with all BTF type descriptors and string data. It overwrites that
3173 * If function returns with error, type/string data might be garbled and should
3189 * BTF type descriptor, greatly reducing resulting size of BTF data.
3191 * Compilation unit isolation and subsequent duplication of data is not the only
3228 * In case of CU #1, BTF data will know only that `struct B` exist (but no
3282 * information into (while resolving FWDs), as it discovers it from data in
3628 /* replace BTF string data and hash with deduped ones */
5027 * data out of it to use for target BTF.