mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof: implement category inheretance
and remove template type, just keep that with layout.
This commit is contained in:
@ -316,16 +316,36 @@ sysprof_callgraph_categorize (SysprofCallgraph *self,
|
||||
case SYSPROF_SYMBOL_KIND_USER:
|
||||
node->category = _sysprof_callgraph_node_categorize (node);
|
||||
|
||||
if (node->category > SYSPROF_CALLGRAPH_CATEGORY_UNCATEGORIZED)
|
||||
break;
|
||||
|
||||
G_GNUC_FALLTHROUGH;
|
||||
|
||||
default:
|
||||
if (node->parent)
|
||||
node->category = node->parent->category;
|
||||
else
|
||||
node->category = SYSPROF_CALLGRAPH_CATEGORY_UNCATEGORIZED;
|
||||
break;
|
||||
}
|
||||
{
|
||||
SysprofCallgraphNode *parent = node->parent;
|
||||
|
||||
while (parent != NULL)
|
||||
{
|
||||
/* If we reach an uncategorized, then nothing above
|
||||
* is doing inheritance.
|
||||
*/
|
||||
if (parent->category == SYSPROF_CALLGRAPH_CATEGORY_UNCATEGORIZED)
|
||||
break;
|
||||
|
||||
if (parent->category & SYSPROF_CALLGRAPH_CATEGORY_INHERIT)
|
||||
{
|
||||
node->category = parent->category;
|
||||
return;
|
||||
}
|
||||
|
||||
parent = parent->parent;
|
||||
}
|
||||
|
||||
node->category = SYSPROF_CALLGRAPH_CATEGORY_UNCATEGORIZED;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user