From 79c49fca02384783b492e75cab6cee7e906b824b Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Thu, 20 Jul 2023 16:03:37 -0700 Subject: [PATCH] libsysprof: track which nodes are toplevel We used to do this, and now we have space for it here as we added the categorization field. --- src/libsysprof/sysprof-callgraph-private.h | 3 ++- src/libsysprof/sysprof-callgraph.c | 2 ++ src/libsysprof/sysprof-descendants-model.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libsysprof/sysprof-callgraph-private.h b/src/libsysprof/sysprof-callgraph-private.h index b4d7ad3a..217dd6c2 100644 --- a/src/libsysprof/sysprof-callgraph-private.h +++ b/src/libsysprof/sysprof-callgraph-private.h @@ -47,7 +47,8 @@ struct _SysprofCallgraphNode SysprofCallgraphNode *children; SysprofCallgraphSummary *summary; gpointer augment[2]; - SysprofCallgraphCategory category; + SysprofCallgraphCategory category : 7; + SysprofCallgraphCategory is_toplevel : 7; }; struct _SysprofCallgraph diff --git a/src/libsysprof/sysprof-callgraph.c b/src/libsysprof/sysprof-callgraph.c index 9055f846..ec2bca0f 100644 --- a/src/libsysprof/sysprof-callgraph.c +++ b/src/libsysprof/sysprof-callgraph.c @@ -191,6 +191,8 @@ 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) diff --git a/src/libsysprof/sysprof-descendants-model.c b/src/libsysprof/sysprof-descendants-model.c index e7f6c1f8..3507c2e3 100644 --- a/src/libsysprof/sysprof-descendants-model.c +++ b/src/libsysprof/sysprof-descendants-model.c @@ -210,6 +210,8 @@ sysprof_descendants_model_add_traceable (SysprofDescendantsModel *self, node = sysprof_descendants_model_add_trace (self, symbols, n_symbols); + node->is_toplevel = TRUE; + if (node && self->callgraph->augment_func) self->callgraph->augment_func (self->callgraph, node,