Commit Graph

2789 Commits

Author SHA1 Message Date
b2a48fe38d libsysprof-analyze: kallsyms constructor with provided file
This allows parsing a kallsyms file that is provided by the application.
Such use could be necessary if a capture did not embed /proc/kallsyms.gz.
2023-05-23 11:03:34 -07:00
fd69b1051c libsysprof-analyze: add fallback Kernel symbols
If we fail to load a /proc/kallsyms.gz from the capture file, we can still
provide an "In Kernel+address" symbol. I prefer this to force loading the
kallsyms from the current system because that:

 1. Requires privileged access and therefore means potentially an
    authorization dialog.
 2. May not even be from the same system that the capture was recorded
    leading to incorrect symbolization.
2023-05-23 10:57:26 -07:00
c3f67eb988 libsysprof-analyze: allow specifying external debug dirs from test 2023-05-23 10:47:42 -07:00
bc482f628b libsysprof-analyze: bridge debug dirs to ELF loader 2023-05-23 10:44:03 -07:00
f2a7aa94a2 libsysprof-analyze: add support for external debug dirs
The ELF loader can use a set of external debug dirs which will be used to
resolve .gnu_debuglink symbols.
2023-05-23 10:35:33 -07:00
e8eaae3eca libsysprof-analyze: process SysprofElfLoader:debug-dirs
This needs to process the debug-dirs as if they're within the mount
namespace of the target process.

We still need to do external-debug-dirs, but that will be slightly
difference as it does not need further translation.
2023-05-23 10:24:32 -07:00
ab29afd2b1 libsysprof-analyze: add overlay mountinfo parsing test
This just ensures that we can parse the contents of the superblock options
that we get for "overlay" mounts via toolbox/podman. These still need to
be handled from SysprofMountNamespace when translating though.

Additionally, this stuff seems very brittle for parsing, unless it is
getting escaped somewhere I'm missing currently.
2023-05-22 21:13:08 -07:00
44b1297a1b libsysprof-analyze: remove duplicates in address layout
And use a GPtrArray for them instead of gsequence, as it makes it nicer
to remove duplicates using a bitset.
2023-05-22 20:52:10 -07:00
e38eae7aa7 libsysprof-analyze: sanitize address ranges
That way we are clamped to what the mapping actually provides. This only
seems to get messed up with glibc, but not clear why and it's barely off
so perhaps it has some special mapping tricks it does.

I still notice some non-reproducible runs, but that appears to be related
to duplicate address mapping entries for [stack] which we need to clear
up by removing the duplicate (short) entry.
2023-05-22 20:06:12 -07:00
5cc55117c3 libsysprof-analyze: check cached ELF for build-id/file-inode
Just because it's cached doesn't mean we should just trust it. It could
have gotten added to the cache previously even though we didn't match.
2023-05-22 19:53:38 -07:00
839695dcd1 libsysprof-analyze: fix SysprofElf:build-id property 2023-05-22 19:49:27 -07:00
a32e82e70c libsysprof-analyze: add jitmap symbol cache test 2023-05-22 19:24:01 -07:00
59a6f852a0 libsysprof-analyze: always ignore jitmap from elf symbolizer 2023-05-22 19:05:41 -07:00
05d5bc6c77 libsysprof-analyze: fix format to match other use 2023-05-22 19:05:25 -07:00
04797587e6 libsysprof-analyze: sort overlays before non-overlays
We still need to support mounts that do not include overlay frames, but
this fixes some of the cases for captures we already generate.
2023-05-22 18:56:30 -07:00
26d81f0737 libsysprof-analyze: print more elf loading information 2023-05-22 18:55:59 -07:00
47538244f3 libsysprof-analyze: actually walk through paths 2023-05-22 18:55:42 -07:00
1469e8691a libsysprof-analyze: treat overlay as SysprofMount
This creates a synthesized SysprofMount for the overlays so that we can
process them as we walk the other mounts.
2023-05-22 18:39:00 -07:00
754e5df789 libsysprof: only record process from perf, not threads
Otherwise we'll get additional SysprofCaptureProcess frames that relate
to the threads instead of just the processes.
2023-05-22 18:35:35 -07:00
c2c4495e3c libsysprof-analyze: add --silent option for test
This allows testing loading without the print overhead.
2023-05-22 17:16:48 -07:00
309f60e263 libsysprof-analyze: read double value for counter 2023-05-22 17:10:10 -07:00
7c31a45f7d libsysprof-analyze: include number of values in counter info 2023-05-22 17:09:54 -07:00
40e9e32030 libsysprof-analyze: cleanup ctrset value retrieval 2023-05-22 17:09:37 -07:00
da3e04df04 tools: include counter type in dump 2023-05-22 16:51:44 -07:00
816d0bf33f libsysprof-analyze: warn in invalid type 2023-05-22 16:51:31 -07:00
d510dd50da libsysprof-analyze: add support for getting counter values 2023-05-22 16:46:36 -07:00
227362ea09 libsysprof-analyze: load counter values with document 2023-05-22 16:04:29 -07:00
9d2f7d3767 libsysprof-analyze: add SysprofDocumentCtrset
This represents the SysprofCaptureCtrset and allows fetching the raw values
for a given counter. These are raw because they may not be endian swapped
and that is the responsibility of the consumer.

SysprofDocument will use these eventually to store the values for a given
counter and the time of the value shift.
2023-05-22 16:03:46 -07:00
c3a5771da0 libsysprof-analyze: create arrays for counter values
And assign them to the SysprofDocumentCounter so that they can pick them
up once we index/add them during counter loading of ctrset.
2023-05-22 15:32:31 -07:00
8f98af9b12 libsysprof-analyze: index and list counters from capture 2023-05-22 15:22:35 -07:00
aaf7530961 libsysprof-analyze: add value-type for counter 2023-05-22 15:21:42 -07:00
29cfad06ec libsysprof-analyze: add counter define document frames 2023-05-22 14:12:53 -07:00
752393d449 libsysprof-analyze: style cleanup 2023-05-22 13:47:37 -07:00
57e7377c21 libsysprof-analyze: start indexing counter defines
And add a SysprofDocumentCounter that will represent each counter. Still
to do is implementing the ctrdef type and a way to transform those into
the individual counters.
2023-05-22 13:47:32 -07:00
fb80527d22 libsysprof-analyze: bsearch jitmap for matching address 2023-05-22 13:30:04 -07:00
9e5a241fef libsysprof-analyze: add jitmap symbolizer
This symbolizes using the SysprofCaptureJitmap frames within the capture
document. Currently it only implements the fast path which can avoid a
binary search on the jitmap data.
2023-05-22 13:21:06 -07:00
b641e41592 libsysprof-analyze: include elf loader by default 2023-05-22 13:20:08 -07:00
a1f83c8104 libsysprof-analyze: translate address to native endianness 2023-05-22 13:19:50 -07:00
aab4408f73 libsysprof-analyze: index jitmaps for faster access
We want quick access to these for the jitmap symbolizer, so index them
like we do other important types with GtkBitset to get their frame
positions.
2023-05-22 12:25:55 -07:00
8abc55f0e6 libsysprof-analyze: include element type in return comment 2023-05-22 12:23:45 -07:00
77cf99850f libsysprof-analyze: use switch/jumptable 2023-05-22 12:21:51 -07:00
1e6fc6e668 libsysprof-analyze: sort headers 2023-05-22 12:19:16 -07:00
d28080b9ad libsysprof-analyze: add SysprofDocumentJitmap
This adds a specific frame type for the Jitmap frames in the capture files.
You can iterate them without having to bswap as well, which is why this
does not use the SysprofCaptureJitmapIter (which does require bswap'd
frames).
2023-05-22 12:18:57 -07:00
c7f025d4d3 libsysprof-analyze: allow filtering by pid 2023-05-22 10:59:38 -07:00
d057f69924 libsysprof-analyze: cleanup nicks a bit 2023-05-21 12:13:16 -07:00
052321db7e libsysprof-analyze: add PolicyKit to subsystems 2023-05-20 17:08:20 -07:00
3df434d950 libsysprof-analyze: resolve symbols in ELF in non-symbol areas
If we get an address that doesn't fall within a symbol, we still want to
generate a valid string/address range for it here so that we can get
nick annotations correct. If we hit the fallback path, we won't get that.
2023-05-20 10:37:53 -07:00
9d8096baa6 libsysprof-analyze: pass-through when there are no matches 2023-05-19 17:30:03 -07:00
f1d0d71ee5 libsysprof-analyze: ensure mounts are sorted by length
This matches what we did previously so that we find the closest mount
match first.
2023-05-19 17:07:29 -07:00
39e6be47fb libsysprof-analyze: add plumbing to track overlays
This just gets the plumbing into place, we'll still need to use it to do
the path translations.
2023-05-19 17:03:35 -07:00