libsysprof-analyze: check if ELF matches inode/build-id

We still want to load it into the cache as it could get used by other
symbols/mmap regions, but don't return the ELF if it won't match an inode
or build-id check. Rely on other fallbacks to create fallback symbols
for those use cases.
This commit is contained in:
Christian Hergert
2023-05-19 15:33:53 -07:00
parent c59bb4ca15
commit f1f0261486
5 changed files with 49 additions and 4 deletions

View File

@ -69,7 +69,8 @@ main (int argc,
g_autoptr(SysprofDocumentMmap) memory_map = g_list_model_get_item (memory_maps, j);
const char *file = sysprof_document_mmap_get_file (memory_map);
const char *build_id = sysprof_document_mmap_get_build_id (memory_map);
g_autoptr(SysprofElf) elf = sysprof_elf_loader_load (elf_loader, info->mount_namespace, file, build_id, &error);
guint64 file_inode = sysprof_document_mmap_get_file_inode (memory_map);
g_autoptr(SysprofElf) elf = sysprof_elf_loader_load (elf_loader, info->mount_namespace, file, build_id, file_inode, &error);
if (elf == NULL)
g_print ("%u: %s [unresolved]\n", info->pid, file);