Commit Graph

2654 Commits

Author SHA1 Message Date
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
7f6191a3dd libsysprof-analyze: add stub for symbol lookup 2023-05-08 14:00:09 -07:00
f2479912e6 libsysprof-analyze: cleanup some helper code for symbolize 2023-05-08 12:24:44 -07:00
c18b401ab6 libsysprof-analyze: add listmodel of traceables
It can be handy to iterate through the traceables and we already have a
bitset index for that. Use the new bitset index listmodel to provide that
filtered list externally without having to inflate every object in the
underlying listmodel, as GtkFilterListModel would have to do.
2023-05-08 12:24:26 -07:00
7720f690e0 libsysprof-analyze: add bitset index
This is meant to be a simple index helper where we already have a bitset
created for a low-cardinality index. We can reuse the read-only bitset
and filter on the document itself.

This index will keep a reference on the document so it's lifetime persists.
2023-05-08 12:23:14 -07:00
f5a97fa945 libsysprof-analyze: ignore zero length data 2023-05-05 16:35:53 -07:00
e6ff4e838c libsysprof-analyze: print info about file chunks 2023-05-05 16:35:16 -07:00
634a32bdfa libsysprof-analyze: allow zero length embedded files 2023-05-05 16:35:10 -07:00
83a61dd9ef libsysprof-analyze: simplify sysprof_document_lookup_file_async()
Instead of walking the listmodel for every object which might be a file
chunk, and treating it as possibly non-native-endianness, this uses the
new index of file chunks and accesses their frame as an object. That
object will do endianness conversions for us.

The extra overhead of creating the GObject is lessened by avoiding looking
at many of the frames in the model.
2023-05-05 13:38:57 -07:00
e763cc14bb libsysprof-analyze: index locations of file chunks
Create a roaring bitmap of list model positions that contain file chunks.
We can use this in the future to avoid iterating the whole listmodel for
matching file chunks to just the index positions containing file chunks.
2023-05-05 13:37:03 -07:00
235dd98621 libsysprof-analyze: add SysprofDocumentFileChunk
This object will represent frames in the list model which are file chunks.
2023-05-05 13:34:53 -07:00
1c75c4c548 libsysprof-analyze: rename samples to traceables
This includes all current traceables, not just samples, so make the name
a bit more clear which it is.
2023-05-05 13:03:03 -07:00
ee957ed1d4 libsysprof-analyze: start on mount namespace APIs
The goal here is that we can try to reproduce to some degree the mount
namespace as the PID saw it, but also convert that to paths where we can
find the files on the host system.
2023-05-05 12:44:31 -07:00
17eaa7a610 libsysprof-analyze: add various docs
These functions have some transfer semantics, so even though they are
private API, make sure that we document it for the future.
2023-05-04 14:32:33 -07:00
89fb7329a8 libsysprof-analyze: add memory map and builder objects
The goal here is to have a memory map for each of our processes so that we
can translate a memory address into an offset within a file.

We will then use an upcoming SysprofMountNamespace as a view into a process
file system layout to convert the mapped filename into something we can
access from the current process (be it on the host, or via flatpak, etc).
2023-05-04 14:30:02 -07:00
16d03ed630 libsysprof-analyze: add object to represent a mapped file 2023-05-04 13:58:20 -07:00
377e8e26c6 libsysprof-analyze: print some basic info for debugging 2023-05-04 10:14:43 -07:00
d2331c888c libsysprof-analyze: fix link dep 2023-05-04 10:14:19 -07:00
c282b54d41 libsysprof-analyze: fetch the decoded addresses onto the stack 2023-05-04 10:03:05 -07:00
e8531ebe58 libsysprof-analyze: add batch getter for stack addresses
This allows caching the interface vfunc to reduce the overhead of accessing
each instruction pointer in the array.
2023-05-04 10:02:53 -07:00
00d8081bfe libsysprof-analyze: break out helper to for adding traceable 2023-05-03 17:50:51 -07:00
10c332d5d2 libsysprof-analyze: index traceables for faster access
This allows us to skip past all the nodes we don't care about with
relatively low overhead once the document has been generated.
2023-05-03 17:44:15 -07:00
b72eda6be2 libsysprof-analyze: prepare symbolizers before decoding 2023-05-03 17:22:37 -07:00
5d255bcb80 libsysprof-analyze: add simple test for symbolizer API 2023-05-03 17:09:18 -07:00
284d0d1f09 libsysprof-analyzer: make multi symbolizer transfer ownership 2023-05-03 17:09:03 -07:00
354eb39676 libsysprof-analyze: add API for bundled symbolizer
This, once completed, will use __symbols__ embedded within a capture file
to decode symbols rather than querying ELF files directly.
2023-05-03 17:08:50 -07:00
95325cc26f libsysprof-analyze: add API to load embedded file as gbytes 2023-05-03 17:07:47 -07:00
c0ade7da01 libsysprof-analyze: add helper for native byte order 2023-05-03 17:07:19 -07:00
f550394b62 libsysprof-analyze: add prepare vfunc for symbolizers
This will allow them to pre-process the document and extract whatever
information they need out of it to do symbolizing.
2023-05-03 15:31:56 -07:00
426aaad781 libsysprof-analyze: add plumbing for symbolization
This gets the worker thread going and the state passed to eventually do
symbolization through the new symbolizer API.
2023-05-03 14:59:46 -07:00
976fb93a83 libsysprof-analyze: start on symbols API via document 2023-05-03 14:21:17 -07:00