Commit Graph

10 Commits

Author SHA1 Message Date
1833fabd62 libsysprof-analyze: include inode when creating ELF
We want to know the inode of the FD that was mmaped so that we can check
the requested inode when processing the address map from a particular
process.
2023-05-19 15:44:26 -07:00
f1f0261486 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.
2023-05-19 15:33:53 -07:00
c59bb4ca15 libsysprof-analyze: implement ELF debuglink loading 2023-05-19 14:53:06 -07:00
d48f2763e0 libsysprof-analyze: cache negative lookups
If we fail to parse something as an ELF, then make sure we can skip it the
next time we see it.
2023-05-19 13:58:25 -07:00
269a8ea658 libsysprof-analyze: insert and lookup ELF from cache
We do need to at least translate the path to what we would want to see
from the host system before inserting/resolving, so that we don't risk
collisions in the cache.
2023-05-19 13:51:25 -07:00
cb74b88b1b libsysprof-analyze: try /var/run/host in flatpak/podman
In podman (at least with toolbox) it appears to give access to home via
/var/run/host/home/ so we don't need to translate home paths at all.

However, Flatpak does not give you home access via that path so we just
have to hope that we have access to $HOME from whatever application
mount namespace we're running from. That means to do symbolizing in a
Flatpak app you'd likely need --filesystem=host to be useful.
2023-05-19 13:33:41 -07:00
aa829f8665 libsysprof-analyze: load ElfParser for GMappedFile 2023-05-19 10:41:00 -07:00
5c1802d77f libsysprof-analyze: add scaffolding for ELF loading 2023-05-18 15:44:36 -07:00
ed19b3d2b6 libsysprof-analyze: add missing SysprofElfLoader ctor 2023-05-18 13:11:08 -07:00
19c5a21ac0 libsysprof-analyze: give shape to ELF loading APIs
We need to separate a number of concerns here, such as debug-dirs within
the process namespace vs global debug-dirs (external symbols on a developer
workstation vs IoT/Laptop/VM/alternate-device).

That means we need to be able to resolve paths via the mount namespace of
the process as it was seen in the capture file.

Additionally, we need to follow .gnu_debuglink section headers so that we
can associate the version with symbols with the ELF that is loaded from
the processes SysprofAddressLayout.
2023-05-18 12:00:25 -07:00