Commit Graph

21 Commits

Author SHA1 Message Date
03652e1a44 proc: fix capture of mapped pathnames
pathnames are listed unescaped in /proc/[pid]/maps, so using %s as the
conversion specifier cuts pathnames off at space characters. Use %[^\n]
instead, to read everything until the end of the line.

Also, the scanf manpage states: "String input conversions store a
terminating null byte ('\0') to mark the end of the input; the maximum
field width does not include this terminator". So set the maximum field
width to 511 instead of 512, to leave one free byte in the buffer for
the terminating null byte.

Fixes #70
2021-11-23 14:41:31 +01: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
11ae2fa395 build: fix write length 2021-09-21 13:12:02 -07:00
728c5081d1 more work on resolver kinds 2021-09-17 17:11:06 -07:00
3e7e677419 start cleaning up proc source for delayed maps 2021-09-14 22:20:03 -07: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
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
0a529b7670 proc: authorize before starting source 2020-08-21 13:15:38 -07:00
620f1f0ff0 build: fix build warnigns with Clang 2020-08-14 12:57:50 -07:00
ba725d1599 libsysprof: use mountinfo helper for path translations 2019-08-02 13:10:28 -07:00
1f91bc77ed libsysprof: avoid kallsyms in capture file
The kallsyms is huge (like 12Mb) and we want to avoid adding anything we
don't need. Instead, we can rely on the symbols source to decode the
symbols immediately and add them to supplemental.
2019-05-29 15:13:01 -07:00
b8c30e3285 libsysprof: add kallsyms to capture file
This can be used by the kernel symbol resolver to resolve symbols on a
different machine than where the capture is performed.
2019-05-29 15:13:01 -07:00
cfab4b2d73 libsysprof: skip when no writer is available 2019-05-29 15:13:01 -07:00
16bc6f970e libsysprof: remove dead code 2019-05-29 15:13:00 -07:00
df1217bbb8 libsysprof: use helpers to get proc info from host 2019-05-29 15:13:00 -07:00
2f5de2a499 libsysprof: whitespace 2019-05-29 15:13:00 -07:00
a361c66085 proc: use helpers for proc access 2019-05-29 15:13:00 -07:00
53c718b708 build: rename all symbols to use sysprof_ as prefix
As we gain in usage, we need to be more careful about using a prefix
that will not collide with other symbols. So version 3 of our ABI will
change to using Sysprof/SYSPROF/sysprof as the various prefixes.

The soname/api version bump will happen later on this branch so that
things are easier to test up until then.
2019-05-29 15:12:59 -07:00