libsysprof-analyze: make summary augmentation optional

That way the descendant graphs can generate the self values but ignore the
summary augmentation (as that would mess up the generated values).

This fixes it so that showing the descendants tree keeps proper Total
and Self values.
This commit is contained in:
Christian Hergert
2023-06-13 10:31:42 -07:00
parent 662cc65bb9
commit 6ab28ff641
6 changed files with 22 additions and 12 deletions

View File

@ -54,10 +54,7 @@ struct _SysprofCallgraphViewClass
GtkWidgetClass parent_class;
gsize augment_size;
void (*augment_func) (SysprofCallgraph *callgraph,
SysprofCallgraphNode *node,
SysprofDocumentFrame *frame,
gpointer user_data);
SysprofAugmentationFunc augment_func;
void (*load) (SysprofCallgraphView *self,
SysprofCallgraph *callgraph);

View File

@ -61,6 +61,7 @@ static void
augment_weight (SysprofCallgraph *callgraph,
SysprofCallgraphNode *node,
SysprofDocumentFrame *frame,
gboolean summarize,
gpointer user_data)
{
AugmentWeight *cur;
@ -75,9 +76,12 @@ augment_weight (SysprofCallgraph *callgraph,
cur->size += 1;
cur->total += 1;
sum = sysprof_callgraph_get_summary_augment (callgraph, node);
sum->size += 1;
sum->total += 1;
if (summarize)
{
sum = sysprof_callgraph_get_summary_augment (callgraph, node);
sum->size += 1;
sum->total += 1;
}
for (node = sysprof_callgraph_node_parent (node);
node != NULL;
@ -86,8 +90,11 @@ augment_weight (SysprofCallgraph *callgraph,
cur = sysprof_callgraph_get_augment (callgraph, node);
cur->total += 1;
sum = sysprof_callgraph_get_summary_augment (callgraph, node);
sum->total += 1;
if (summarize)
{
sum = sysprof_callgraph_get_summary_augment (callgraph, node);
sum->total += 1;
}
}
}