libsysprof: keep count in callgraph node

I don't want this to overlap with augmentation data, or be augmentation
data specific, so just keep our own private copy of this data in the
node to do the sort of things we want with it (such as summaries).
This commit is contained in:
Christian Hergert
2023-07-20 17:02:34 -07:00
parent a75429241e
commit 0f70dd1d68
3 changed files with 7 additions and 4 deletions

View File

@ -47,8 +47,9 @@ struct _SysprofCallgraphNode
SysprofCallgraphNode *children;
SysprofCallgraphSummary *summary;
gpointer augment[2];
SysprofCallgraphCategory category : 7;
SysprofCallgraphCategory is_toplevel : 7;
guint category : 7;
guint is_toplevel : 1;
guint count : 24;
};
struct _SysprofCallgraph

View File

@ -191,8 +191,6 @@ sysprof_callgraph_populate_callers (SysprofCallgraph *self,
g_assert (SYSPROF_IS_CALLGRAPH (self));
g_assert (node != NULL);
node->is_toplevel = TRUE;
for (const SysprofCallgraphNode *iter = node;
iter != NULL;
iter = iter->parent)
@ -431,6 +429,9 @@ sysprof_callgraph_add_traceable (SysprofCallgraph *self,
list_model_index,
!!(self->flags & SYSPROF_CALLGRAPH_FLAGS_HIDE_SYSTEM_LIBRARIES));
node->is_toplevel = TRUE;
node->count++;
if (node && self->augment_func)
self->augment_func (self,
node,

View File

@ -211,6 +211,7 @@ sysprof_descendants_model_add_traceable (SysprofDescendantsModel *self,
node = sysprof_descendants_model_add_trace (self, symbols, n_symbols);
node->is_toplevel = TRUE;
node->count++;
if (node && self->callgraph->augment_func)
self->callgraph->augment_func (self->callgraph,