The /sysroot/ convention is something we see on OSTree-based systems
such as Silverblue or CoreOS which contains the running image. We can
skip that part of the path so that symbol resolving continues as normal.
We are starting to come into a situation where we need more advanced
path translations because we keep having to do things like this. Until
Linux figures out file-system namespaces at a higher level at least.
Really what we want to deal with here is tracking an overlay that we may
need to be able to decode after the fact (in case processes exit or we
need to do post-processing symbol resolution).
For the podman case, that is $some_path mapped to root (/), generally
speaking. For flatpak though, that would have two mappings, one for
/app and another for /usr (possibly more).
We want to know the location of our root if it was specified in the
capture file. Such is useful for decoding symbols that may not be
reported right from perf tooling.
This allows us to try to translate maps for processes in containers.
For processes we find in a podman container, we can sniff the libpod
cgroup scope. Using that we can translate into the podman layer that
contains the files.
With that, future work could find the proper .so when resolving based on
alternate roots for the process.
This helps some annoying cases where we keep checking over and over for
each CPU, procfile, etc during startup.
It makes the tool less useful on systems without D-Bus, but let's be
honest, profiling is a Linux only game for Sysprof.
When dealing with Btrfs subvolumes, we might need to translate the src
directory to the proper subvolume. This isn't exactly perfect, as I could
imagine some scenarios that might break things here, but it seems to be
good enough to get decoding working on Fedora 33 with a default btrfs
installation.
If you have more creative setups, I'd be happy to see some testing there.
You can use ./src/tests/test-mountinfo /proc/self/mountinfo /some/path.so
to get information on what was resolved.
Fixes#34
This fix error when gio is a subproject, when there is pc file
assotiated for objects in libraries_private meson automatically promote
them to requires.
Also remove some values that are already the default.
This allows Meson to associate the pkg-config module with the "main"
library that it represents, in an unambiguous way.
Signed-off-by: Simon McVittie <smcv@debian.org>
This avoids making the project depend on all its dependencies, some of
which are optional, when being built as a Meson subproject.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Some minor changes were necessary so that we could change the ABI in
libsysprof-capture to be free from GLib (and therefore used by GLib).
This also adds some wrappers for capture API in libsysprof so that we
can continue to use GError from UI code.