Lines Matching +full:data +full:- +full:size
1 // SPDX-License-Identifier: GPL-2.0
16 #include "bpf-event.h"
17 #include "bpf-utils.h"
34 #include "annotate-data.h"
66 if (dso == NULL || dso->symtab_type == DSO_BINARY_TYPE__NOT_FOUND) in dso__symtab_origin()
68 return origin[dso->symtab_type]; in dso__symtab_origin()
73 switch (dso->binary_type) { in dso__is_object_file()
106 char *root_dir, char *filename, size_t size) in dso__read_binary_type_filename() argument
120 len = __symbol__join_symfs(filename, size, dso->long_name); in dso__read_binary_type_filename()
123 last_slash--; in dso__read_binary_type_filename()
125 strncpy(dso_dir, filename, last_slash - filename); in dso__read_binary_type_filename()
126 dso_dir[last_slash-filename] = '\0'; in dso__read_binary_type_filename()
129 ret = -1; in dso__read_binary_type_filename()
138 ret = -1; in dso__read_binary_type_filename()
140 snprintf(filename, size, in dso__read_binary_type_filename()
151 if (dso__build_id_filename(dso, filename, size, false) == NULL) in dso__read_binary_type_filename()
152 ret = -1; in dso__read_binary_type_filename()
156 if (dso__build_id_filename(dso, filename, size, true) == NULL) in dso__read_binary_type_filename()
157 ret = -1; in dso__read_binary_type_filename()
161 len = __symbol__join_symfs(filename, size, "/usr/lib/debug"); in dso__read_binary_type_filename()
162 snprintf(filename + len, size - len, "%s.debug", dso->long_name); in dso__read_binary_type_filename()
166 len = __symbol__join_symfs(filename, size, "/usr/lib/debug"); in dso__read_binary_type_filename()
167 snprintf(filename + len, size - len, "%s", dso->long_name); in dso__read_binary_type_filename()
176 if (strlen(dso->long_name) < 9 || in dso__read_binary_type_filename()
177 strncmp(dso->long_name, "/usr/lib/", 9)) { in dso__read_binary_type_filename()
178 ret = -1; in dso__read_binary_type_filename()
181 len = __symbol__join_symfs(filename, size, "/usr/lib/debug"); in dso__read_binary_type_filename()
182 snprintf(filename + len, size - len, "%s", dso->long_name + 4); in dso__read_binary_type_filename()
190 last_slash = dso->long_name + dso->long_name_len; in dso__read_binary_type_filename()
191 while (last_slash != dso->long_name && *last_slash != '/') in dso__read_binary_type_filename()
192 last_slash--; in dso__read_binary_type_filename()
194 len = __symbol__join_symfs(filename, size, ""); in dso__read_binary_type_filename()
195 dir_size = last_slash - dso->long_name + 2; in dso__read_binary_type_filename()
196 if (dir_size > (size - len)) { in dso__read_binary_type_filename()
197 ret = -1; in dso__read_binary_type_filename()
200 len += scnprintf(filename + len, dir_size, "%s", dso->long_name); in dso__read_binary_type_filename()
201 len += scnprintf(filename + len , size - len, ".debug%s", in dso__read_binary_type_filename()
207 if (!dso->has_build_id) { in dso__read_binary_type_filename()
208 ret = -1; in dso__read_binary_type_filename()
212 build_id__sprintf(&dso->bid, build_id_hex); in dso__read_binary_type_filename()
213 len = __symbol__join_symfs(filename, size, "/usr/lib/debug/.build-id/"); in dso__read_binary_type_filename()
214 snprintf(filename + len, size - len, "%.2s/%s.debug", in dso__read_binary_type_filename()
221 __symbol__join_symfs(filename, size, dso->long_name); in dso__read_binary_type_filename()
226 path__join3(filename, size, symbol_conf.symfs, in dso__read_binary_type_filename()
227 root_dir, dso->long_name); in dso__read_binary_type_filename()
232 __symbol__join_symfs(filename, size, dso->long_name); in dso__read_binary_type_filename()
237 snprintf(filename, size, "%s", dso->long_name); in dso__read_binary_type_filename()
248 ret = -1; in dso__read_binary_type_filename()
313 return dso->symtab_type == DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP || in dso__needs_decompress()
314 dso->symtab_type == DSO_BINARY_TYPE__GUEST_KMODULE_COMP; in dso__needs_decompress()
321 int fd = -1; in filename__decompress()
329 * data. So even if the DSO is represented by 'krava.xz' module, in filename__decompress()
342 return -1; in filename__decompress()
348 fd = -1; in filename__decompress()
364 return -1; in decompress_kmodule()
366 if (dso->comp == COMP_ID__NONE) in decompress_kmodule()
367 return -1; in decompress_kmodule()
369 return filename__decompress(name, pathname, len, dso->comp, in decompress_kmodule()
370 &dso->load_errno); in decompress_kmodule()
384 return fd >= 0 ? 0 : -1; in dso__decompress_kmodule_path()
391 * @comp - true if @path contains supported compression suffix,
393 * @kmod - true if @path contains '.ko' suffix in right position,
395 * @name - if (@alloc_name && @kmod) is true, it contains strdup-ed base name
396 * of the kernel module without suffixes, otherwise strudup-ed
398 * @ext - if (@alloc_ext && @comp) is true, it contains strdup-ed string
401 * Returns 0 if there's no strdup error, -ENOMEM otherwise.
429 m->kmod = false; in __kmod_path__parse()
432 m->kmod = true; in __kmod_path__parse()
438 m->name = strdup(name); in __kmod_path__parse()
439 return m->name ? 0 : -ENOMEM; in __kmod_path__parse()
444 m->comp = is_supported_compression(ext + 1); in __kmod_path__parse()
445 if (m->comp > COMP_ID__NONE) in __kmod_path__parse()
446 ext -= 3; in __kmod_path__parse()
450 m->kmod = !strncmp(ext, ".ko", 3); in __kmod_path__parse()
453 if (m->kmod) { in __kmod_path__parse()
454 if (asprintf(&m->name, "[%.*s]", (int) (ext - name), name) == -1) in __kmod_path__parse()
455 return -ENOMEM; in __kmod_path__parse()
457 if (asprintf(&m->name, "%s", name) == -1) in __kmod_path__parse()
458 return -ENOMEM; in __kmod_path__parse()
461 strreplace(m->name, '-', '_'); in __kmod_path__parse()
471 dso->symtab_type = DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE; in dso__set_module_info()
473 dso->symtab_type = DSO_BINARY_TYPE__GUEST_KMODULE; in dso__set_module_info()
476 if (m->kmod && m->comp) { in dso__set_module_info()
477 dso->symtab_type++; in dso__set_module_info()
478 dso->comp = m->comp; in dso__set_module_info()
481 dso->is_kmod = 1; in dso__set_module_info()
482 dso__set_short_name(dso, strdup(m->name), true); in dso__set_module_info()
494 list_add_tail(&dso->data.open_entry, &dso__data_open); in dso__list_add()
500 list_del_init(&dso->data.open_entry); in dso__list_del()
502 "DSO data fd counter out of bounds."); in dso__list_del()
503 dso__data_open_cnt--; in dso__list_del()
526 return -1; in do_open()
531 return filename_with_chroot(nsinfo__pid(dso->nsinfo), filename); in dso__filename_with_chroot()
536 int fd = -EINVAL; in __open_dso()
542 return -ENOMEM; in __open_dso()
544 mutex_lock(&dso->lock); in __open_dso()
546 root_dir = machine->root_dir; in __open_dso()
548 if (dso__read_binary_type_filename(dso, dso->binary_type, in __open_dso()
555 if (errno != ENOENT || dso->nsinfo == NULL) in __open_dso()
571 fd = -dso->load_errno; in __open_dso()
585 mutex_unlock(&dso->lock); in __open_dso()
593 * dso_close - Open DSO data file
596 * Open @dso's data file descriptor and updates
604 if (dso->binary_type != DSO_BINARY_TYPE__BUILD_ID_CACHE) { in open_dso()
605 mutex_lock(&dso->lock); in open_dso()
606 nsinfo__mountns_enter(dso->nsinfo, &nsc); in open_dso()
607 mutex_unlock(&dso->lock); in open_dso()
610 if (dso->binary_type != DSO_BINARY_TYPE__BUILD_ID_CACHE) in open_dso()
627 if (dso->data.fd >= 0) { in close_data_fd()
628 close(dso->data.fd); in close_data_fd()
629 dso->data.fd = -1; in close_data_fd()
630 dso->data.file_size = 0; in close_data_fd()
636 * dso_close - Close DSO data file
639 * Close @dso's data file descriptor and updates
651 dso = list_first_entry(&dso__data_open, struct dso, data.open_entry); in close_first_dso()
677 * Used only by tests/dso-data.c to reset the environment
711 * dso__data_close - Close DSO data file
714 * External interface to close @dso's data file descriptor.
732 if (dso->data.fd >= 0) in try_to_open_dso()
735 if (dso->binary_type != DSO_BINARY_TYPE__NOT_FOUND) { in try_to_open_dso()
736 dso->data.fd = open_dso(dso, machine); in try_to_open_dso()
741 dso->binary_type = binary_type_data[i++]; in try_to_open_dso()
743 dso->data.fd = open_dso(dso, machine); in try_to_open_dso()
744 if (dso->data.fd >= 0) in try_to_open_dso()
747 } while (dso->binary_type != DSO_BINARY_TYPE__NOT_FOUND); in try_to_open_dso()
749 if (dso->data.fd >= 0) in try_to_open_dso()
750 dso->data.status = DSO_DATA_STATUS_OK; in try_to_open_dso()
752 dso->data.status = DSO_DATA_STATUS_ERROR; in try_to_open_dso()
756 * dso__data_get_fd - Get dso's data file descriptor
762 * dso__data_put_fd() if it returns non-negative value.
766 if (dso->data.status == DSO_DATA_STATUS_ERROR) in dso__data_get_fd()
767 return -1; in dso__data_get_fd()
770 return -1; in dso__data_get_fd()
774 if (dso->data.fd < 0) in dso__data_get_fd()
777 return dso->data.fd; in dso__data_get_fd()
789 if (dso->data.status_seen & flag) in dso__data_status_seen()
792 dso->data.status_seen |= flag; in dso__data_status_seen()
798 static ssize_t bpf_read(struct dso *dso, u64 offset, char *data) in bpf_read() argument
801 ssize_t size = DSO__DATA_CACHE_SIZE; in bpf_read() local
805 node = perf_env__find_bpf_prog_info(dso->bpf_prog.env, dso->bpf_prog.id); in bpf_read()
806 if (!node || !node->info_linear) { in bpf_read()
807 dso->data.status = DSO_DATA_STATUS_ERROR; in bpf_read()
808 return -1; in bpf_read()
811 len = node->info_linear->info.jited_prog_len; in bpf_read()
812 buf = (u8 *)(uintptr_t)node->info_linear->info.jited_prog_insns; in bpf_read()
815 return -1; in bpf_read()
817 size = (ssize_t)min(len - offset, (u64)size); in bpf_read()
818 memcpy(data, buf + offset, size); in bpf_read()
819 return size; in bpf_read()
826 node = perf_env__find_bpf_prog_info(dso->bpf_prog.env, dso->bpf_prog.id); in bpf_size()
827 if (!node || !node->info_linear) { in bpf_size()
828 dso->data.status = DSO_DATA_STATUS_ERROR; in bpf_size()
829 return -1; in bpf_size()
832 dso->data.file_size = node->info_linear->info.jited_prog_len; in bpf_size()
840 struct rb_root *root = &dso->data.cache; in dso_cache__free()
843 mutex_lock(&dso->lock); in dso_cache__free()
848 next = rb_next(&cache->rb_node); in dso_cache__free()
849 rb_erase(&cache->rb_node, root); in dso_cache__free()
852 mutex_unlock(&dso->lock); in dso_cache__free()
857 const struct rb_root *root = &dso->data.cache; in __dso_cache__find()
858 struct rb_node * const *p = &root->rb_node; in __dso_cache__find()
867 end = cache->offset + DSO__DATA_CACHE_SIZE; in __dso_cache__find()
869 if (offset < cache->offset) in __dso_cache__find()
870 p = &(*p)->rb_left; in __dso_cache__find()
872 p = &(*p)->rb_right; in __dso_cache__find()
883 struct rb_root *root = &dso->data.cache; in dso_cache__insert()
884 struct rb_node **p = &root->rb_node; in dso_cache__insert()
887 u64 offset = new->offset; in dso_cache__insert()
889 mutex_lock(&dso->lock); in dso_cache__insert()
895 end = cache->offset + DSO__DATA_CACHE_SIZE; in dso_cache__insert()
897 if (offset < cache->offset) in dso_cache__insert()
898 p = &(*p)->rb_left; in dso_cache__insert()
900 p = &(*p)->rb_right; in dso_cache__insert()
905 rb_link_node(&new->rb_node, parent, p); in dso_cache__insert()
906 rb_insert_color(&new->rb_node, root); in dso_cache__insert()
910 mutex_unlock(&dso->lock); in dso_cache__insert()
914 static ssize_t dso_cache__memcpy(struct dso_cache *cache, u64 offset, u8 *data, in dso_cache__memcpy() argument
915 u64 size, bool out) in dso_cache__memcpy() argument
917 u64 cache_offset = offset - cache->offset; in dso_cache__memcpy()
918 u64 cache_size = min(cache->size - cache_offset, size); in dso_cache__memcpy()
921 memcpy(data, cache->data + cache_offset, cache_size); in dso_cache__memcpy()
923 memcpy(cache->data + cache_offset, data, cache_size); in dso_cache__memcpy()
928 u64 offset, char *data) in file_read() argument
935 * dso->data.fd might be closed if other thread opened another in file_read()
940 if (dso->data.fd < 0) { in file_read()
941 dso->data.status = DSO_DATA_STATUS_ERROR; in file_read()
942 ret = -errno; in file_read()
946 ret = pread(dso->data.fd, data, DSO__DATA_CACHE_SIZE, offset); in file_read()
962 *ret = -ENOMEM; in dso_cache__populate()
966 if (dso->binary_type == DSO_BINARY_TYPE__BPF_PROG_INFO) in dso_cache__populate()
967 *ret = bpf_read(dso, cache_offset, cache->data); in dso_cache__populate()
970 if (dso->binary_type == DSO_BINARY_TYPE__OOL) in dso_cache__populate()
973 *ret = file_read(dso, machine, cache_offset, cache->data); in dso_cache__populate()
980 cache->offset = cache_offset; in dso_cache__populate()
981 cache->size = *ret; in dso_cache__populate()
1004 u64 offset, u8 *data, ssize_t size, bool out) in dso_cache_io() argument
1013 return dso_cache__memcpy(cache, offset, data, size, out); in dso_cache_io()
1017 * Reads and caches dso data DSO__DATA_CACHE_SIZE size chunks
1018 * in the rb_tree. Any read to already cached data is served
1019 * by cached data. Writes update the cache only, not the backing file.
1022 u64 offset, u8 *data, ssize_t size, bool out) in cached_io() argument
1025 u8 *p = data; in cached_io()
1030 ret = dso_cache_io(dso, machine, offset, p, size, out); in cached_io()
1038 BUG_ON(ret > size); in cached_io()
1043 size -= ret; in cached_io()
1045 } while (size); in cached_io()
1059 * dso->data.fd might be closed if other thread opened another in file_size()
1064 if (dso->data.fd < 0) { in file_size()
1065 ret = -errno; in file_size()
1066 dso->data.status = DSO_DATA_STATUS_ERROR; in file_size()
1070 if (fstat(dso->data.fd, &st) < 0) { in file_size()
1071 ret = -errno; in file_size()
1074 dso->data.status = DSO_DATA_STATUS_ERROR; in file_size()
1077 dso->data.file_size = st.st_size; in file_size()
1086 if (dso->data.file_size) in dso__data_file_size()
1089 if (dso->data.status == DSO_DATA_STATUS_ERROR) in dso__data_file_size()
1090 return -1; in dso__data_file_size()
1092 if (dso->binary_type == DSO_BINARY_TYPE__BPF_PROG_INFO) in dso__data_file_size()
1099 * dso__data_size - Return dso data size
1103 * Return: dso data size
1108 return -1; in dso__data_size()
1110 /* For now just estimate dso data size is close to file size */ in dso__data_size()
1111 return dso->data.file_size; in dso__data_size()
1115 u64 offset, u8 *data, ssize_t size, in data_read_write_offset() argument
1119 return -1; in data_read_write_offset()
1122 if (offset > dso->data.file_size) in data_read_write_offset()
1123 return -1; in data_read_write_offset()
1125 if (offset + size < offset) in data_read_write_offset()
1126 return -1; in data_read_write_offset()
1128 return cached_io(dso, machine, offset, data, size, out); in data_read_write_offset()
1132 * dso__data_read_offset - Read data from dso file offset
1136 * @data: buffer to store data
1137 * @size: size of the @data buffer
1139 * External interface to read data from dso file offset. Open
1140 * dso data file and use cached_read to get the data.
1143 u64 offset, u8 *data, ssize_t size) in dso__data_read_offset() argument
1145 if (dso->data.status == DSO_DATA_STATUS_ERROR) in dso__data_read_offset()
1146 return -1; in dso__data_read_offset()
1148 return data_read_write_offset(dso, machine, offset, data, size, true); in dso__data_read_offset()
1152 * dso__data_read_addr - Read data from dso address
1156 * @data: buffer to store data
1157 * @size: size of the @data buffer
1159 * External interface to read data from dso address.
1163 u8 *data, ssize_t size) in dso__data_read_addr() argument
1167 return dso__data_read_offset(dso, machine, offset, data, size); in dso__data_read_addr()
1171 * dso__data_write_cache_offs - Write data to dso data cache at file offset
1175 * @data: buffer to write
1176 * @size: size of the @data buffer
1178 * Write into the dso file data cache, but do not change the file itself.
1181 u64 offset, const u8 *data_in, ssize_t size) in dso__data_write_cache_offs() argument
1183 u8 *data = (u8 *)data_in; /* cast away const to use same fns for r/w */ in dso__data_write_cache_offs() local
1185 if (dso->data.status == DSO_DATA_STATUS_ERROR) in dso__data_write_cache_offs()
1186 return -1; in dso__data_write_cache_offs()
1188 return data_read_write_offset(dso, machine, offset, data, size, false); in dso__data_write_cache_offs()
1192 * dso__data_write_cache_addr - Write data to dso data cache at dso address
1196 * @data: buffer to write
1197 * @size: size of the @data buffer
1199 * External interface to write into the dso file data cache, but do not change
1204 const u8 *data, ssize_t size) in dso__data_write_cache_addr() argument
1208 return dso__data_write_cache_offs(dso, machine, offset, data, size); in dso__data_write_cache_addr()
1238 dso->kernel = dso_type; in machine__findnew_kernel()
1246 struct rb_root *root = dso->root; in dso__set_long_name_id()
1251 if (dso->long_name_allocated) in dso__set_long_name_id()
1252 free((char *)dso->long_name); in dso__set_long_name_id()
1255 rb_erase(&dso->rb_node, root); in dso__set_long_name_id()
1260 RB_CLEAR_NODE(&dso->rb_node); in dso__set_long_name_id()
1261 dso->root = NULL; in dso__set_long_name_id()
1264 dso->long_name = name; in dso__set_long_name_id()
1265 dso->long_name_len = strlen(name); in dso__set_long_name_id()
1266 dso->long_name_allocated = name_allocated; in dso__set_long_name_id()
1282 if (dso->short_name_allocated) in dso__set_short_name()
1283 free((char *)dso->short_name); in dso__set_short_name()
1285 dso->short_name = name; in dso__set_short_name()
1286 dso->short_name_len = strlen(name); in dso__set_short_name()
1287 dso->short_name_allocated = name_allocated; in dso__set_short_name()
1295 return dso->long_name_len; in dso__name_len()
1297 return dso->short_name_len; in dso__name_len()
1302 return dso->loaded; in dso__loaded()
1307 return dso->sorted_by_name; in dso__sorted_by_name()
1312 dso->sorted_by_name = true; in dso__set_sorted_by_name()
1320 strcpy(dso->name, name); in dso__new_id()
1322 dso->id = *id; in dso__new_id()
1323 dso__set_long_name_id(dso, dso->name, id, false); in dso__new_id()
1324 dso__set_short_name(dso, dso->name, false); in dso__new_id()
1325 dso->symbols = RB_ROOT_CACHED; in dso__new_id()
1326 dso->symbol_names = NULL; in dso__new_id()
1327 dso->symbol_names_len = 0; in dso__new_id()
1328 dso->data.cache = RB_ROOT; in dso__new_id()
1329 dso->inlined_nodes = RB_ROOT_CACHED; in dso__new_id()
1330 dso->srclines = RB_ROOT_CACHED; in dso__new_id()
1331 dso->data_types = RB_ROOT; in dso__new_id()
1332 dso->data.fd = -1; in dso__new_id()
1333 dso->data.status = DSO_DATA_STATUS_UNKNOWN; in dso__new_id()
1334 dso->symtab_type = DSO_BINARY_TYPE__NOT_FOUND; in dso__new_id()
1335 dso->binary_type = DSO_BINARY_TYPE__NOT_FOUND; in dso__new_id()
1336 dso->is_64_bit = (sizeof(void *) == 8); in dso__new_id()
1337 dso->loaded = 0; in dso__new_id()
1338 dso->rel = 0; in dso__new_id()
1339 dso->sorted_by_name = 0; in dso__new_id()
1340 dso->has_build_id = 0; in dso__new_id()
1341 dso->has_srcline = 1; in dso__new_id()
1342 dso->a2l_fails = 1; in dso__new_id()
1343 dso->kernel = DSO_SPACE__USER; in dso__new_id()
1344 dso->is_kmod = 0; in dso__new_id()
1345 dso->needs_swap = DSO_SWAP__UNSET; in dso__new_id()
1346 dso->comp = COMP_ID__NONE; in dso__new_id()
1347 RB_CLEAR_NODE(&dso->rb_node); in dso__new_id()
1348 dso->root = NULL; in dso__new_id()
1349 INIT_LIST_HEAD(&dso->node); in dso__new_id()
1350 INIT_LIST_HEAD(&dso->data.open_entry); in dso__new_id()
1351 mutex_init(&dso->lock); in dso__new_id()
1352 refcount_set(&dso->refcnt, 1); in dso__new_id()
1365 if (!RB_EMPTY_NODE(&dso->rb_node)) in dso__delete()
1367 dso->long_name); in dso__delete()
1370 inlines__tree_delete(&dso->inlined_nodes); in dso__delete()
1371 srcline__tree_delete(&dso->srclines); in dso__delete()
1372 symbols__delete(&dso->symbols); in dso__delete()
1373 dso->symbol_names_len = 0; in dso__delete()
1374 zfree(&dso->symbol_names); in dso__delete()
1375 annotated_data_type__tree_delete(&dso->data_types); in dso__delete()
1377 if (dso->short_name_allocated) { in dso__delete()
1378 zfree((char **)&dso->short_name); in dso__delete()
1379 dso->short_name_allocated = false; in dso__delete()
1382 if (dso->long_name_allocated) { in dso__delete()
1383 zfree((char **)&dso->long_name); in dso__delete()
1384 dso->long_name_allocated = false; in dso__delete()
1388 auxtrace_cache__free(dso->auxtrace_cache); in dso__delete()
1391 zfree(&dso->symsrc_filename); in dso__delete()
1392 nsinfo__zput(dso->nsinfo); in dso__delete()
1393 mutex_destroy(&dso->lock); in dso__delete()
1400 refcount_inc(&dso->refcnt); in dso__get()
1406 if (dso && refcount_dec_and_test(&dso->refcnt)) in dso__put()
1412 dso->bid = *bid; in dso__set_build_id()
1413 dso->has_build_id = 1; in dso__set_build_id()
1418 if (dso->bid.size > bid->size && dso->bid.size == BUILD_ID_SIZE) { in dso__build_id_equal()
1420 * For the backward compatibility, it allows a build-id has in dso__build_id_equal()
1423 return !memcmp(dso->bid.data, bid->data, bid->size) && in dso__build_id_equal()
1424 !memchr_inv(&dso->bid.data[bid->size], 0, in dso__build_id_equal()
1425 dso->bid.size - bid->size); in dso__build_id_equal()
1428 return dso->bid.size == bid->size && in dso__build_id_equal()
1429 memcmp(dso->bid.data, bid->data, dso->bid.size) == 0; in dso__build_id_equal()
1438 sprintf(path, "%s/sys/kernel/notes", machine->root_dir); in dso__read_running_kernel_build_id()
1439 if (sysfs__read_build_id(path, &dso->bid) == 0) in dso__read_running_kernel_build_id()
1440 dso->has_build_id = true; in dso__read_running_kernel_build_id()
1451 const char *name = dso->short_name + 1; in dso__kernel_module_get_build_id()
1454 "%s/sys/module/%.*s/notes/.note.gnu.build-id", in dso__kernel_module_get_build_id()
1455 root_dir, (int)strlen(name) - 1, name); in dso__kernel_module_get_build_id()
1457 if (sysfs__read_build_id(filename, &dso->bid) == 0) in dso__kernel_module_get_build_id()
1458 dso->has_build_id = true; in dso__kernel_module_get_build_id()
1467 build_id__sprintf(&dso->bid, sbuild_id); in dso__fprintf_buildid()
1474 size_t ret = fprintf(fp, "dso: %s (", dso->short_name); in dso__fprintf()
1476 if (dso->short_name != dso->long_name) in dso__fprintf()
1477 ret += fprintf(fp, "%s, ", dso->long_name); in dso__fprintf()
1481 for (nd = rb_first_cached(&dso->symbols); nd; nd = rb_next(nd)) { in dso__fprintf()
1505 int idx, errnum = dso->load_errno; in dso__strerror_load()
1529 return -1; in dso__strerror_load()
1531 idx = errnum - __DSO_LOAD_ERRNO__START; in dso__strerror_load()