libsysprof-analyze: add summary augmentation capabilities

This allows us to have augmentation at the summary level so that things
like the weighted callgraph or memprof callgraph can add their respective
summary data up the chain of function calls.
This commit is contained in:
Christian Hergert
2023-06-09 11:19:40 -07:00
parent 900c39c0d8
commit 814c25d45a
4 changed files with 79 additions and 39 deletions

View File

@ -176,7 +176,7 @@ sysprof_callgraph_frame_get_symbol (SysprofCallgraphFrame *self)
if (self->callgraph == NULL)
return NULL;
return self->node->symbol;
return self->node->summary->symbol;
}
/**
@ -197,3 +197,23 @@ sysprof_callgraph_frame_get_augment (SysprofCallgraphFrame *self)
return sysprof_callgraph_get_augment (self->callgraph, self->node);
}
/**
* sysprof_callgraph_frame_get_summary_augment: (skip)
* @self: a #SysprofCallgraphFrame
*
* Gets the augmentation that was attached to the summary for
* the callgraph node's symbol.
*
* Returns: (nullable) (transfer none): the augmentation data
*/
gpointer
sysprof_callgraph_frame_get_summary_augment (SysprofCallgraphFrame *self)
{
g_return_val_if_fail (SYSPROF_IS_CALLGRAPH_FRAME (self), NULL);
if (self->callgraph == NULL)
return NULL;
return sysprof_callgraph_get_summary_augment (self->callgraph, self->node);
}