Commit Graph

2684 Commits

Author SHA1 Message Date
3350ad61eb libsysprof-analyze: introduce SysprofDocumentLoader
and thereby make a bunch of the exposed API on SysprofDocument private.
Instead we'll push some of that to the loader but for now the tests can
keep doing what their doing using the private API.

The goal here is to not expose a SysprofDocument pointer until the document
has been loaded and symbolized via the loader API. Then we can lookup
symbols directly from the document w/o intermediary objects.
2023-05-12 15:41:48 -07:00
9f6e16e373 libsysprof-analyze: take depth from translation func 2023-05-12 14:29:16 -07:00
59044bd813 libsysprof-analyze: remove implementation debugging code 2023-05-12 14:15:18 -07:00
81c384a974 libsysprof-analyze: use interval tree for symbol cache
This uses an augmented red-black tree to create an interval tree with
non-interval lookups. That amounts to storing address ranges within the
red-black tree, but looking up by single address.
2023-05-12 14:13:40 -07:00
379db77349 libsysprof-analyze: add sys/tree.h
This pulls in the venerable sys/tree.h so that we may use it in some
upcoming cache code.
2023-05-12 14:12:33 -07:00
3a8471906f libsysprof-analyze: build static library for testing internals
Otherwise we can't test our private API which very much will need it to
ensure correctness.
2023-05-12 14:11:17 -07:00
582986f5c9 libsysprof-capture: free deduplicated array entries 2023-05-12 14:09:43 -07:00
dc99b46254 libsysprof-capture: fix leak of mapped ring buffer structure 2023-05-12 14:02:46 -07:00
8c17830522 libsysprof-analyze: resolve via symbol cache for pid 2023-05-11 15:48:13 -07:00
c0bc3c047a libsysprof-analyze: get stack addresses as group 2023-05-11 15:38:14 -07:00
2d1bf107e5 libsysprof-analyze: handle section edge better 2023-05-11 15:37:59 -07:00
ff1b4d00bd libsysprof-analyze: implement key/value superblock option API
This currently gets used in libsysprof to try to cross mount namespaces to
somewhere we can access a binary on the same subvolume.
2023-05-11 15:21:36 -07:00
35f87b6121 libsysprof-analyze: add superblock-options property
This lets you get the full string that was parsed from the mountinfo
rather than having to go through our yet-to-be-implemented specific
option API.
2023-05-11 15:13:23 -07:00
1f9d37837d libsysprof-analyze: use pid list to load mountinfo 2023-05-11 15:02:52 -07:00
971166a82f libsysprof-analyze: keep bitset of known pids
This can be handy for iterating all the pids we know we've seen during
process loading.
2023-05-11 15:02:32 -07:00
7c37120edf libsysprof-analyze: make SysprofMount public API
And expose it via sysprof_document_process_list_mounts() so that when
inspecting processes we can see what binaries were mapped as well as what
the filesystem looked like to locate those mapped paths.
2023-05-11 14:37:02 -07:00
352fa617c0 libsysprof-analyze: fix transfer ownership of refstring 2023-05-11 14:05:07 -07:00
a393dd9acd libsysprof-analyze: parse various data from mountinfo
We still need to parse optional fields for filesystem type and what not
so that we can resolve btrfs subvolumes and more.
2023-05-11 13:58:34 -07:00
f914580675 libsysprof-analyze: remove process list
This is done with a GtkBitset index and so we can drop this unused list
model wrapper.
2023-05-11 13:15:28 -07:00
9e01216945 libsysprof-analyze: remove unused code
We went a different route for this, so we can just drop the unused code.
2023-05-11 13:14:19 -07:00
5d5f0a5085 libsysprof-analyze: plumb access to string pooling
We want various subsystems to start using this, but we need to plumb it
to the symbolizers to take advantage of it.
2023-05-11 13:09:50 -07:00
5abad47160 libsysprof-analyze: give access to memory maps from process
And add it to test tool to ensure it works.
2023-05-11 12:32:32 -07:00
9b5e25037b libsysprof-analyze: add SysprofProcessInfo
This internal type is used to collect things about a process like the
memory maps, address layout, and symbol cache. This can persist once
parsed at startup, then applied to objects created on demand such as the
SysprofDocumentProcess or used by symbolizers internally rather than
complicated function arguments.
2023-05-11 12:21:32 -07:00
ccd790fef5 libsysprof-analyze: make AddressLayout a ListModel 2023-05-11 11:41:17 -07:00
8f4fa95663 libsysprof-analyze: use mountnamespace/addresslayout in symbolize 2023-05-10 16:51:05 -07:00
c72955e7d4 libsysprof-analyze: add address layout to contain mmap regions 2023-05-10 16:48:48 -07:00
b3a4c295c3 libsysprof-analyze: add basic symbol cache
This relies on begin/end range for the symbols to create something akin to
an interval tree, albeit with GSequence. If performance needs to be
addressed, can probably augment SysprofSymbol for an interval rbtree.
2023-05-10 15:14:09 -07:00
0b0fe9f903 libsysprof-analyze: give mount access to strings in ctor 2023-05-10 12:55:30 -07:00
7118c38b2b libsysprof-analyze: break out string helper
We'll want strings to be deduplicated a bunch, and may need to pass this
around to make that a bit easier to ensure.
2023-05-10 12:42:28 -07:00
fa39a3291a libsysprof-analyze: start plumbing mounts into namespaces 2023-05-09 21:03:13 -07:00
fd6256e68f libsysprof-analyze: start on object to represent a mount 2023-05-09 20:46:10 -07:00
a9f615cff0 libsysprof-analyze: add scaffolding for mountinfo parsing
I want to do this differently than we did in libsysprof, which is going
to require a bit of thinking on how we should represent something like
a SysprofMount within the mount namespace.
2023-05-09 17:51:38 -07:00
6290a1736d libsysprof-analyze: parse core mount namespace devices
We want to track the core mount namespace, for which the namespace we
use for processes will derive (to be done).
2023-05-09 17:20:00 -07:00
f01346da90 libsysprof-analyze: add missing constructor 2023-05-09 17:19:23 -07:00
a22eb8c435 libsysprof-analyze: add inlined line reader
This is a bit nicer than the allocating form we have elsewhere.
2023-05-09 17:18:44 -07:00
f220484746 libsysprof-analyze: index memory maps by pid
We will want to use this when loading processes along with the system
mounts so that we can locate files by buildid/inode/etc.
2023-05-09 16:57:10 -07:00
1003372324 libsysprof-analyze: add listmodel of processes
This is handy to be able to show a list of processes that were contained
within a particular capture file.
2023-05-09 15:57:29 -07:00
6f0f8c980a libsysprof-analyze: mark refstring in prototypes 2023-05-09 15:44:09 -07:00
dd710329e5 libsysprof-analyze: keey gbytes around for decoded access 2023-05-09 13:39:21 -07:00
30a30524fe libsysprof-analyze: implement multi-symbolizer symbolize 2023-05-09 13:34:35 -07:00
e83011c85d libysysprof-analyze: make ref string transfer full
No reason to have extra unref's by the caller for these.
2023-05-09 13:30:15 -07:00
b625fec454 libsysprof-analyze: add basic symbolize API
This isn't what it will look like in final form, just get the minimum
there for us to use it with the bundled decoder (copied from libsysprof
with adaptations).
2023-05-09 13:29:52 -07:00
d8d787c871 libsysprof-analyze: add test to dump embedded file contents 2023-05-09 12:49:07 -07:00
e0e1791b2d libsysprof-analyze: make lookup_file synchronous
Now that we have a lot of this indexed, it's fast enough to do on the
calling thread.

# Conflicts:
#	src/libsysprof-analyze/sysprof-document.c
#	src/libsysprof-analyze/sysprof-document.h
2023-05-09 12:36:59 -07:00
938a1bbb4a libsysprof-analyze: add listmodel of embedded files
This also indexes the first position of a file by filename so that we can
skip items in the capture file. Generally, embedded files are a single
frame so that will only be one frame to look at. But even when it is a
few frames, they are generally sequential so this vastly reduces how many
frames we'll need to look at for files.
2023-05-09 12:34:03 -07:00
9fe0ae5306 libsysprof-analyze: add type to represent an embedded file
We have "chunks" within the capture file, this object will represent the
collection of those chunks which is easier for applications to deal with
if they want to view the contents.
2023-05-09 12:33:12 -07:00
689599ef43 libsysprof-analyze: add note about symbolizing work 2023-05-08 16:16:09 -07:00
6daff5ac6e libsysprof-analyze: return symbols for context switches 2023-05-08 15:49:42 -07:00
7c57da2440 libsysprof-analyze: add build-id to SysprofDocumentMmap
In anticipation of getting PERF_EVENT_MMAP2 events, assume we tack on the
build-id in hex after the filename like "filename\0@build-id\0" so that we
can use it when decoding frames. That will allow us to avoid doing inode
checks (which breaks when moving files between computers anyway) as well
as potentially supporting debuginfod in the future via build-id.
2023-05-08 14:25:27 -07:00
dc57721699 libsysprof-analyze: add some dummy symbolize example
We still need the document symbols to do the right thing, which we will
get to after we have access to mount namespace and file loading.
2023-05-08 14:01:17 -07:00