Lines Matching refs:strs

1399 	void *hdr, *types, *strs, *strs_end, *s;  in btf_ensure_modifiable()  local
1413 strs = malloc(btf->hdr->str_len); in btf_ensure_modifiable()
1414 if (!hdr || !types || !strs) in btf_ensure_modifiable()
1419 memcpy(strs, btf->strs_data, btf->hdr->str_len); in btf_ensure_modifiable()
1429 strs_end = strs + btf->hdr->str_len; in btf_ensure_modifiable()
1430 for (off = 0, s = strs; s < strs_end; off += strlen(s) + 1, s = strs + off) { in btf_ensure_modifiable()
1445 btf->strs_data = strs; in btf_ensure_modifiable()
1462 free(strs); in btf_ensure_modifiable()
3132 struct btf_str_ptrs *strs; in btf_str_mark_as_used() local
3138 strs = ctx; in btf_str_mark_as_used()
3139 s = bsearch(strs->data + *str_off_ptr, strs->ptrs, strs->cnt, in btf_str_mark_as_used()
3149 struct btf_str_ptrs *strs; in btf_str_remap_offset() local
3155 strs = ctx; in btf_str_remap_offset()
3156 s = bsearch(strs->data + *str_off_ptr, strs->ptrs, strs->cnt, in btf_str_remap_offset()
3180 struct btf_str_ptrs strs = { in btf_dedup_strings() local
3194 if (strs.cnt + 1 > strs.cap) { in btf_dedup_strings()
3197 strs.cap += max(strs.cnt / 2, 16U); in btf_dedup_strings()
3198 new_ptrs = libbpf_reallocarray(strs.ptrs, strs.cap, sizeof(strs.ptrs[0])); in btf_dedup_strings()
3203 strs.ptrs = new_ptrs; in btf_dedup_strings()
3206 strs.ptrs[strs.cnt].str = p; in btf_dedup_strings()
3207 strs.ptrs[strs.cnt].used = false; in btf_dedup_strings()
3210 strs.cnt++; in btf_dedup_strings()
3221 strs.ptrs[0].used = true; in btf_dedup_strings()
3222 err = btf_for_each_str_off(d, btf_str_mark_as_used, &strs); in btf_dedup_strings()
3227 qsort(strs.ptrs, strs.cnt, sizeof(strs.ptrs[0]), str_sort_by_content); in btf_dedup_strings()
3235 grp_used = strs.ptrs[0].used; in btf_dedup_strings()
3237 for (i = 1; i <= strs.cnt; i++) { in btf_dedup_strings()
3243 if (i < strs.cnt && in btf_dedup_strings()
3244 !strcmp(strs.ptrs[i].str, strs.ptrs[grp_idx].str)) { in btf_dedup_strings()
3245 grp_used = grp_used || strs.ptrs[i].used; in btf_dedup_strings()
3256 __u32 len = strlen(strs.ptrs[grp_idx].str); in btf_dedup_strings()
3258 memmove(p, strs.ptrs[grp_idx].str, len + 1); in btf_dedup_strings()
3260 strs.ptrs[j].new_off = new_off; in btf_dedup_strings()
3264 if (i < strs.cnt) { in btf_dedup_strings()
3266 grp_used = strs.ptrs[i].used; in btf_dedup_strings()
3276 qsort(strs.ptrs, strs.cnt, sizeof(strs.ptrs[0]), str_sort_by_offset); in btf_dedup_strings()
3279 err = btf_for_each_str_off(d, btf_str_remap_offset, &strs); in btf_dedup_strings()
3288 free(strs.ptrs); in btf_dedup_strings()