Commit Graph

59 Commits

Author SHA1 Message Date
ff41633abc libsysprof-analyze: use EggBitset instead of GTK
This uses the newly brought in EggBitset instead of GtkBitset so that we
can drop our GTK dependency in the libsysprof-analyze library.
2023-05-25 15:16:13 -07:00
6f90a552e7 libsysprof-analyze: include final address context
We may need to know the final address context so we can inject symbols as
necessary into the top of the callgraph. We know it when generating the
symbols, so just yield it to the caller too.
2023-05-25 11:15:07 -07:00
1b0434c854 libsysprof-analyze: add private API to get the kernel symbol
We may need to inject "- - Kernel - -" in some stack traces.
2023-05-25 11:13:57 -07:00
3ae108464d libsysprof-analyze: implement augmented callgraph
This creates a SysprofCallgraph object which is a GListModel of
SysprofCallgraphFrame. The SysprofCallgraphFrame is also a GListModel of
SysprofCallgraphFrame so that we can map this all into a GtkListView in
the future for tree-like visibility.

The augmentation allows for the same callgraph code to be used for multiple
scenarios such as CPU sampling as well as memory allocation tracking.

If your augmentation size is <=sizeof(void*) then you do not occur an extra
allocation and you can use the inline augmentation space.

The test-callgraph clearly shows that we still need to do the shuffling
of -- Kernel -- and -- User -- like the old callgraph code did. But that
will come soon enough.
2023-05-24 17:11:30 -07:00
ca2b008547 libsysprof-analyze: skip symbols we failed to symbolize 2023-05-24 17:08:09 -07:00
d723e41683 libsysprof-analyze: wrap processes in [] like previously 2023-05-24 17:07:52 -07:00
f12f2b760c libsysprof-analyze: add API to get symbol to represent process
And include a fallback in case we never got an actual Process frame which
will contain the cmdline for the process. We need to hold onto the fallback
too so that we can keep symbols lightweight by not having to reference them
so long as the document is alive.
2023-05-24 15:19:44 -07:00
5b00127d7d libsysprof-analyze: add API to get only samples
We'll probably want this for allocations too at some point.
2023-05-24 14:30:13 -07:00
8348f7fe2c libsysprof-analyze: start on scaffolding for callgraph API 2023-05-24 13:00:47 -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
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
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
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
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
3ff5312c2e libsysprof-analyze: index overlay frames
We will want these to process mount namespaces.
2023-05-19 16:57:47 -07:00
e1da2d4f70 libsysprof-analyze: use GRefString for SysprofMountDevice
We will end up creating a lot of these, and it's nice to at least be able
to share the strings even if we can't always share the objects themselves.
2023-05-19 10:11:48 -07:00
7db4540f9a libsysprof-analyze: rename mount-path to mount-point
We want to be consistent with SysprofMount in naming.
2023-05-19 10:01:02 -07:00
d448519c29 libsysprof-analyze: prefix private API with _ 2023-05-18 16:23:12 -07:00
a90b9a2fc7 libsysprof-analyze: use separate cache for kernel symbols
Additionally this reduces some GHashTable lookup costs by doing it once
for the process-info per-traceable rather than one per instruction pointer
per traceable.
2023-05-15 14:30:06 -07:00
fa55594e23 libsysprof-analyze: make return type GRefString 2023-05-15 12:46:46 -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
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
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
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
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
8f4fa95663 libsysprof-analyze: use mountnamespace/addresslayout in symbolize 2023-05-10 16:51:05 -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
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
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
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
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
f5a97fa945 libsysprof-analyze: ignore zero length data 2023-05-05 16:35:53 -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
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
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