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

@ -24,6 +24,8 @@
#include <sysprof-capture.h>
#include "sysprof-symbol.h"
G_BEGIN_DECLS
#define SYSPROF_TYPE_CALLGRAPH_FRAME (sysprof_callgraph_frame_get_type())
@ -31,4 +33,9 @@ G_BEGIN_DECLS
SYSPROF_AVAILABLE_IN_ALL
G_DECLARE_FINAL_TYPE (SysprofCallgraphFrame, sysprof_callgraph_frame, SYSPROF, CALLGRAPH_FRAME, GObject)
SYSPROF_AVAILABLE_IN_ALL
SysprofSymbol *sysprof_callgraph_frame_get_symbol (SysprofCallgraphFrame *self);
SYSPROF_AVAILABLE_IN_ALL
gpointer sysprof_callgraph_frame_get_augment (SysprofCallgraphFrame *self);
G_END_DECLS