Commit Graph

969 Commits

Author SHA1 Message Date
5a7d79f0b4 sysprof: cleanup version naming 2021-09-21 16:41:37 -07:00
3eca1ff409 symbol-resolver: remove unused function 2021-09-21 16:37:46 -07:00
d641856317 proc: ignore inode from podman processes
They never appear to be right anyway, so they just get in the way of
decoding anything (for which we might get right with a CRC check later).
2021-09-21 16:16:30 -07:00
468b45b086 tests: fix inode check
We care about the event, not what we read.
2021-09-21 16:05:00 -07:00
a0de244f7e elf: add note about zero inodes 2021-09-21 16:03:58 -07:00
f09e378ca0 tests: ignore zero inode 2021-09-21 16:03:48 -07:00
b0812681b2 tests: style cleanup 2021-09-21 15:40:42 -07:00
5b6377ee78 tests: make resolving path match elf resolver
Just use the ev->filename if we didn't translate the path (so we can avoid
extra string copies).
2021-09-21 15:39:47 -07:00
e62d6a07a2 podman: include image layers in overlay
We want the image layers so we can find the files in the base image
correctly.
2021-09-21 15:36:18 -07:00
5caebd29f4 podman: fix typo 2021-09-21 15:35:45 -07:00
bf8a851a57 elf: fix pid usage
We want the pid from the event.
2021-09-21 15:35:37 -07:00
11ae2fa395 build: fix write length 2021-09-21 13:12:02 -07:00
0fd7ea3f80 tests: cleanup addr decode output 2021-09-21 11:50:34 -07:00
09360c5cb9 tests: add test to dump translated maps 2021-09-21 11:50:22 -07:00
4c6912e804 elf: add helpers for test utilities to verify decoding 2021-09-21 11:50:03 -07:00
fb33d382cc extract instance data from .flatpak-info 2021-09-17 17:16:44 -07:00
728c5081d1 more work on resolver kinds 2021-09-17 17:11:06 -07:00
5f43a57ab0 tests: add util to extract build-id
Easier to remember than readelf stuff and tests the same code paths.
2021-09-16 22:59:28 -07:00
4d12f9eea7 build: use static library for tests 2021-09-16 22:58:51 -07:00
5f352abc86 do delayed path resolving of files containing symbols
we still need to teach this to locate debug dirs relative to the
process paths.
2021-09-15 17:52:58 -07:00
3e7e677419 start cleaning up proc source for delayed maps 2021-09-14 22:20:03 -07:00
e02785ba23 start on new resolver for paths 2021-09-14 19:53:46 -07:00
1d2c00b120 tests: make test tool system independent
We don't want to rely on host /proc/mounts or we cannot really test this
on machines other than the target failure.
2021-08-30 15:25:24 -07:00
5f255403aa libsysprof: remove /sysroot/ workaround
This isnt really need anymore now that we have other ways of resolving this.
It fixes an issue with resolving some symbols on systems like GNOME OS.
2021-08-26 17:12:37 -07:00
bcda9694c6 profiler: fix typo in mutable calculation
Fixes #65
2021-06-03 13:57:38 -07:00
6f11fcf510 sysprofd: fix warning 2021-03-22 14:55:04 -07:00
2c0ea406fd elf: use strncmp for comparison
We expect strncmp available on systems we build ELF parsers.
2021-03-17 13:01:02 -07:00
605cdfc3f1 elf: skip past /sysroot/ when symbol resolving
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.
2021-03-17 12:56:38 -07:00
d1a43dc4a8 libsysprof-ui: Fix a typo in a label 2021-03-08 15:27:27 -08:00
7e92b3e14b elf: use overlays to resolve library paths 2021-02-25 14:09:15 -08:00
43d2b0b019 proc: track overlays for flatpak /app and /usr 2021-02-25 13:44:58 -08:00
14139232d5 capture: rename PidRoot to Overlay and add src/dst
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).
2021-02-25 13:43:09 -08:00
8b0f3f4682 proc: fix capture of application id 2021-02-25 13:03:46 -08:00
7a8f1d9d2e flatpak: add stubs to extra flatpak cgroup information
The goal here is to discover the app and runtime paths so that we can
create a path mapping when resolving addresses.
2021-02-25 12:15:15 -08:00
9e823c57ce elf: use discovered root when decoding symbols 2021-02-24 19:05:43 -08:00
bd8a8ada26 elf: track pid root when building lookaside buffers
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.
2021-02-24 18:59:35 -08:00
b22899474d proc: discover filesystem root for podman 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.
2021-02-24 18:40:41 -08:00
b5790be7ad helpers: add ability to read /proc/$pid/cgroup file 2021-02-24 17:57:03 -08:00
4758fb42ce capture: add pid-root frame type
While I'm not thrilled to add new frame types for every sort of thing, I
think having this will be relatively useful so we can improve decoding
operations.

This adds SysprofCapturePidRoot which lets us specify a root directory
on the host system for which is the real root (/) of the PID. This can
be useful when reconstructing overlays for containers and you need to
direct access to alternate roots.

The layer gives us some ability to try to deal with overlayfs, albeit at
a very rudimentary level. In most cases I anticipate we just deal with
the main root and ignore overlays until necessary.
2021-02-24 17:56:37 -08:00
ff22417de9 build: add missing 3.40 version macros 2021-02-24 17:41:20 -08:00
afafeacc70 tests: avoid use of file that changes in test case
It turns out that /proc/cpuinfo changes out from under us rather frequently
and that makes it a bad use-case for a unit test. This uses meson.build
which presumably wont change while running the tests.
2021-02-24 17:41:09 -08:00
937e162472 tests: fix environment for running tests
These should not be in quotes so that we can build actual file paths
from them.
2021-02-24 17:39:35 -08:00
e7d1458428 sysprof: shorten default height of window 2021-02-24 14:20:23 -08:00
c93286cf9a libsysprof-ui: remove GTK aid
This isn't needed anymore now that we have the Control FD source which is
used to pass data between processes.
2021-02-24 14:20:17 -08:00
61934a1c02 libsysprof: make perf_event_paranoid failure softer
We can survive this being at 2, but we can keep it a debug info bit for
now to be less annoying on the console.
2021-02-24 14:03:51 -08:00
143554c68e profiler: preroll authorization before starting
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.
2021-02-24 14:01:01 -08:00
4777e74862 sysprofd: ftruncate() when overwriting files
This is really only used for proc like files which are generally a single
page, but might as well start from zero.
2021-02-24 13:03:24 -08:00
86fb061899 governor: always disable paranoid status
This allows us to always attempt to disable the perf_event_paranoid
setting to -1 while we profile.
2021-02-24 12:19:36 -08:00
6d3398f258 libsysprof-ui: always setup governor source on Linux
We need this for disabling paranoid perf event.
2021-02-24 12:19:08 -08:00
7ca4acc30d sysprof-cli: always create governor source
But also disable it unless we're on Linux.
2021-02-24 11:59:34 -08:00