libsysprof-analyze: cleanup walking to root

This commit is contained in:
Christian Hergert
2023-06-09 15:57:52 -07:00
parent 2511e79cae
commit 3f34c4625b

View File

@ -198,18 +198,21 @@ sysprof_callgraph_populate_callers (SysprofCallgraph *self,
g_assert (node != NULL); g_assert (node != NULL);
for (const SysprofCallgraphNode *iter = node; for (const SysprofCallgraphNode *iter = node;
iter != NULL && iter->parent != NULL; iter != NULL;
iter = iter->parent) iter = iter->parent)
{
egg_bitset_add (iter->summary->traceables, list_model_index);
if (iter->parent != NULL)
{ {
SysprofSymbol *parent_symbol = iter->parent->summary->symbol; SysprofSymbol *parent_symbol = iter->parent->summary->symbol;
guint pos; guint pos;
egg_bitset_add (iter->summary->traceables, list_model_index);
if (!g_ptr_array_find (iter->summary->callers, parent_symbol, &pos)) if (!g_ptr_array_find (iter->summary->callers, parent_symbol, &pos))
g_ptr_array_add (iter->summary->callers, parent_symbol); g_ptr_array_add (iter->summary->callers, parent_symbol);
} }
} }
}
static SysprofCallgraphNode * static SysprofCallgraphNode *
sysprof_callgraph_add_trace (SysprofCallgraph *self, sysprof_callgraph_add_trace (SysprofCallgraph *self,