mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
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:
@ -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);
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user