libsysprof: always increment count for callgraph nodes

This shouldn't affect categorizing because that only uses the value if
is_toplevel. But with this added, we can use the count for weights in
other tooling w/o needing augmentation.
This commit is contained in:
Christian Hergert
2023-08-23 14:32:04 -07:00
parent fd618ccb4b
commit b80c8b8b5b
2 changed files with 4 additions and 2 deletions

View File

@ -247,6 +247,7 @@ sysprof_callgraph_add_trace (SysprofCallgraph *self,
if (_sysprof_symbol_equal (iter->summary->symbol, symbol))
{
node = iter;
node->count++;
goto next_symbol;
}
}
@ -256,6 +257,7 @@ sysprof_callgraph_add_trace (SysprofCallgraph *self,
node->summary = sysprof_callgraph_get_summary (self, symbol);
node->parent = parent;
node->next = parent->children;
node->count = 1;
if (parent->children)
parent->children->prev = node;
parent->children = node;
@ -431,7 +433,6 @@ sysprof_callgraph_add_traceable (SysprofCallgraph *self,
!!(self->flags & SYSPROF_CALLGRAPH_FLAGS_HIDE_SYSTEM_LIBRARIES));
node->is_toplevel = TRUE;
node->count++;
if (node && self->augment_func)
self->augment_func (self,

View File

@ -129,6 +129,7 @@ sysprof_descendants_model_add_trace (SysprofDescendantsModel *self,
if (_sysprof_symbol_equal (iter->summary->symbol, symbol))
{
node = iter;
node->count++;
goto next_symbol;
}
}
@ -144,6 +145,7 @@ sysprof_descendants_model_add_trace (SysprofDescendantsModel *self,
node->summary = summary;
node->parent = parent;
node->next = parent->children;
node->count = 1;
if (parent->children)
parent->children->prev = node;
parent->children = node;
@ -211,7 +213,6 @@ 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,