Commit Graph

78 Commits

Author SHA1 Message Date
1a94b60fbf libsysprof-analyze: only extend timespan for data types 2023-06-15 16:51:08 -07:00
d4da036f73 libsysprof-analyze: move timespan to analyze library
That way we can use it for the document itself, and have it update the
timespan of the recording in case it didn't get updated due to ctrl+c or
something prematurely stopping.
2023-06-15 16:43:17 -07:00
6dcb5e5fdd libsysprof-analyze: include time as fractions for marks
This allows more easily calculating the horizontal position of marks and
their duration from charts.
2023-06-15 16:14:32 -07:00
b572b7426e libsysprof-analyze: pre-sort marks from hashtable 2023-06-15 13:27:27 -07:00
1455876835 libsysprof-analyze: make mark catalog work with sections
This allows us more flexibility with creating sections usin the flatten
list model as the rows need to contain the data for the headers.
2023-06-15 13:19:18 -07:00
9a762fa1d4 libsysprof-analyze: add mark catalog kind
We can use this to separate catalogs for names vs groups when building
tree models of them.
2023-06-15 11:52:15 -07:00
8b4ab761ab libsysprof-analyze: add mark information during index pass 2023-06-15 11:44:36 -07:00
80dac7c0cd libsysprof-analyze: create mark catalogs from hashtable
We still need to insert these when parsing the mmap'd capture on the
first pass of data.
2023-06-15 10:35:16 -07:00
51ce85b399 libsysprof-analyze: add scaffolding for listing marks by name/group 2023-06-15 09:36:18 -07:00
72be9f240f libsysprof-analyze: add sysprof_document_list_marks() 2023-06-14 16:59:20 -07:00
5b929b8d5d libsysprof-analyze: add callgraph flags for thread-ids
This allows you to set a flag to show the thread id of what was recorded.

Use this to help disassociate similar threads in a process to figure out
which thread is consuming a majority of the Total time of that process.
2023-06-14 15:11:56 -07:00
2a65bf30af libsysprof-analyze: add symbol kind property for symbols
Additionally, add the pid as the binary nick for processes so that we can
show them in the callgraph with the process name.
2023-06-14 12:08:23 -07:00
ddfa3f57ab libsysprof-analyze: add sysprof_document_list_symbols_in_traceable()
This function will list the symbols in a traceable in a way that is
suitable for showing in a GtkListView or GtkColumnView. For example, that
requires creating copies of the symbols so that duplicates do not cause
hickups with GtkListItemManager.
2023-06-12 16:41:30 -07:00
63b42c2319 libsysprof-analyze: track relative offset for frame
This is handy so that we don't have to keep multiple objects around to
handle this request. Otherwise we'd need to keep references to the
document and that is a bit annoying.

This of course has a limit of about an hour (in tv_nsec), but that is
far longer than we can realistically record anyway.
2023-06-12 15:41:29 -07:00
0529cfb2f0 libsysprof-analyze: add helper to get clock start time 2023-06-12 15:11:42 -07:00
f701e028b4 libsysprof-analyze: add some flags for internal state
This can help us to avoid various work items when processing symbols.
2023-06-12 14:15:08 -07:00
663ae8746a libsysprof-analyze: add list model index for allocation records 2023-06-06 16:45:27 -07:00
9cba99d894 libsysprof-analyze: handle pid == -1
This can happen from Perf sometimes so be explicit about remapping it to
process 0, which is our sort of catchall for kernel stuff.
2023-06-05 16:45:07 -07:00
1e8e1adb73 libsysprof-analyze: automatically handle compressed streams
If we want /proc/kallsyms and we discover /proc/kallsyms.gz, then use the
/proc/kallsyms.gz instead and transparently decompress it. Also, list the
file in sysprof_document_list_files() as /proc/kallsyms instead of
/proc/kallsyms.gz as that is really the intention (but mark the compressed
bit for decoding the chunks).
2023-05-30 12:46:42 -07:00
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