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.
This commit is contained in:
Christian Hergert
2023-05-24 17:11:30 -07:00
parent 5e9f745f38
commit 3ae108464d
10 changed files with 552 additions and 92 deletions

View File

@ -57,11 +57,15 @@ guint sysprof_document_symbolize_traceable (SysprofDocument
SysprofSymbol **symbols,
guint n_symbols);
SYSPROF_AVAILABLE_IN_ALL
void sysprof_document_callgraph_async (SysprofDocument *self,
GListModel *traceables,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
void sysprof_document_callgraph_async (SysprofDocument *self,
GListModel *traceables,
gsize augment_size,
SysprofAugmentationFunc augment_func,
gpointer augment_func_data,
GDestroyNotify augment_func_data_destroy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
SYSPROF_AVAILABLE_IN_ALL
SysprofCallgraph *sysprof_document_callgraph_finish (SysprofDocument *self,
GAsyncResult *result,