From 503d3decca07a815f2205e947131cd13791dc09b Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Thu, 25 May 2023 14:33:08 -0700 Subject: [PATCH] libsysprof-analyze: track nodes that were toplevel That way when we want to get a list of stack traces, we could know to yield a trace stopping at this node. --- src/libsysprof-analyze/tests/test-callgraph.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libsysprof-analyze/tests/test-callgraph.c b/src/libsysprof-analyze/tests/test-callgraph.c index ece89b8d..03479b2c 100644 --- a/src/libsysprof-analyze/tests/test-callgraph.c +++ b/src/libsysprof-analyze/tests/test-callgraph.c @@ -27,8 +27,9 @@ typedef struct _Augment { - guint32 size; - guint32 total; + guint64 toplevel : 1; + guint64 size : 31; + guint32 total : 32; } Augment; static char *kallsyms_path; @@ -99,6 +100,9 @@ augment_cb (SysprofCallgraph *callgraph, g_assert (SYSPROF_IS_DOCUMENT_SAMPLE (frame)); g_assert (user_data == NULL); + aug = sysprof_callgraph_get_augment (callgraph, node); + aug->toplevel = TRUE; + for (; node ; node = sysprof_callgraph_node_parent (node)) { aug = sysprof_callgraph_get_augment (callgraph, node);