Commit Graph

45 Commits

Author SHA1 Message Date
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
12e497891f libsysprof-analyze: add SysprofDocumentOverlay
This maps to the SysprofCaptureOverlay data frames. We need them currently
to be able to locate files from various podman/toolbox rootless containers.
2023-05-19 16:51:15 -07:00
19c5a21ac0 libsysprof-analyze: give shape to ELF loading APIs
We need to separate a number of concerns here, such as debug-dirs within
the process namespace vs global debug-dirs (external symbols on a developer
workstation vs IoT/Laptop/VM/alternate-device).

That means we need to be able to resolve paths via the mount namespace of
the process as it was seen in the capture file.

Additionally, we need to follow .gnu_debuglink section headers so that we
can associate the version with symbols with the ELF that is loaded from
the processes SysprofAddressLayout.
2023-05-18 12:00:25 -07:00
09b8c1f737 libsysprof-analyze: leave some notes on elf symbolizing 2023-05-15 16:49:40 -07:00
140bc1d384 libsysprof-analyze: add scaffolding for elf symbol resolver 2023-05-15 15:03:25 -07:00
00ecc41209 libsysprof-analyze: make SysprofDocumentSymbols private
This instead moves to a public API on the document to symbolize now
that we've gotten much of the necessary bits private in loading the
document. This commit ensures that we only do loading via the loader
now (and removes the incorrect use from the tests so they too go
through the loader).

We check for NoSymbolizer in document symbols so that we can skip any
decoding. That keeps various use cases fast where you don't want to
waste time on symbolizing if you don't need to look at symbols.

There is plenty more we can do to batch decode symbols with some more
API changes, but that will come after we have kernel/userland decoding
integrated from this library.

We may still want to get all symbols into a single symbol cache, but
given that we have address ranges associated with them, that may not
be very useful beyond the hashtable to pid-specific cache we have now.

If symbols were shared between processes, that'd make more sense, but
we aren't doing that (albeit strings are shared between symbol
instances to reduce that overhead).
2023-05-15 10:56:09 -07:00
0e95fd3841 libsysprof-analyze: add SysprofNoSymbolizer
A symbolizer that will never symbolize. We can use this later internally
to short-circuit various symoblization steps during loading.
2023-05-15 10:56:09 -07:00
a27f700c06 libsysprof-analyze: add scaffolding for kallsyms parsing
We will want to start embedding this content in the capture file (but
after gzipping it as it's otherwise quite large). This will get things in
place so that we can parse that .gz file into the address ranges and
decode symbols found within the capture file.
2023-05-14 18:45:03 -07:00
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
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
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
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
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
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
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
fd6256e68f libsysprof-analyze: start on object to represent a mount 2023-05-09 20:46:10 -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
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
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
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
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
d2331c888c libsysprof-analyze: fix link dep 2023-05-04 10:14:19 -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
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
976fb93a83 libsysprof-analyze: start on symbols API via document 2023-05-03 14:21:17 -07:00
f7374f3252 libsysprof-analyze: add minimal symbolizer API
This exposes the types and hierarchy but won't expose the API details that
we need internally. The idea here is that we can keep that private so we
can adjust how it is used should we need to since the public interface
would be the SysprofDocumentSymbols, not the SysprofSymbolizer which does
decoding directly via address/context state.
2023-05-03 14:16:31 -07:00
793740b20f libsysprof-analyze: add SysprofSymbol
The goal here is to get an object to represent a symbol so that we can
more easily extend things in the future. We'll still use those pointers
as unique in the stackstash in the future.
2023-05-02 13:31:22 -07:00
a27d626187 libsysprof-analyze: install libsysprof-analyze-6.so 2023-04-28 16:52:19 -07:00
7a3f90e8f5 libsysprof-analyze: add process list model
This is not yet functional, but gets the scaffolding in place that we'll
use to filter out processes and turn them into something more useful such
as their execution lifetime.
2023-04-28 16:49:52 -07:00
fe4b6ee812 libsysprof-analyze: add interface for stracetrace types
Currently, this would need to be implemented by SysprofDocumentSample and
SysprofDocumentAllocation. But we could potentially start allowing many
types to attach a trace if we modifier the capture format to allow it.
2023-04-28 12:14:17 -07:00
86561c0c4f libyssprof-analyze: add document type for allocations 2023-04-28 11:44:30 -07:00
6b762ef64a libsysprof-analyze: add document type for fork 2023-04-28 10:36:17 -07:00
72c0ba731c libsysprof-analyze: add document type for metadata 2023-04-27 17:58:23 -07:00
d878fbf372 libsysprof-analyze: add document type for task exit
We don't have any extra data here currently, but it can be nice to be able
to check a gtype when consuming frames.
2023-04-27 17:50:28 -07:00
24d0d4af52 libsysprof-analyze: add document type for processes
Generally this is all the processes at startup, but can also be a process
that is executed while the capture is running. Useful to pair with an
Exit frame for pid/tid duration.
2023-04-27 17:45:04 -07:00
6031233cc3 libsysprof-analyze: add document type for marks 2023-04-27 17:22:44 -07:00
92950f4b6b libsysprof-analyze: add document type for log messages 2023-04-27 17:15:35 -07:00
c1d00db0fb libsysprof-analyze: add document type for memory maps 2023-04-27 17:00:18 -07:00
ca83cd6b40 libsysprof-analyze: add document type for samples 2023-04-25 17:10:12 -07:00
31003c519c libsysprof-analyze: rename to SysprofDocumentFrame
We will eventually be adding sub-types for the various frame types, and
use this as a common ancestor for item inflation.
2023-04-25 15:32:55 -07:00
ed01673a5e libsysprof-analyzer: rename model to SysprofDocument
This will provide better namespacing for the objects inflated from the
document for various frame types. By creating real objects with real
properties we give ourselves quite a bit of flexibility in the data
filtering language coming forth.
2023-04-25 15:26:06 -07:00
efab045006 libsysprof-analyze: start on sysprof-analyze library
The goal here is to break up libsysprof into a library for recording
profiles (using libsysprof-capture) and a library for analyzing profiles
(both used by the sysprof UI).
2023-04-25 11:57:26 -07:00