mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
Skip nodes that don't have a parent.
2006-10-11 Soren Sandmann <sandmann@daimi.au.dk> * profile.c (profile_list_callers): Skip nodes that don't have a parent.
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
df07f71539
commit
5eb19d00fa
@ -1,3 +1,8 @@
|
|||||||
|
2006-10-11 Soren Sandmann <sandmann@daimi.au.dk>
|
||||||
|
|
||||||
|
* profile.c (profile_list_callers): Skip nodes that don't have a
|
||||||
|
parent.
|
||||||
|
|
||||||
2006-10-09 Soren Sandmann <sandmann@daimi.au.dk>
|
2006-10-09 Soren Sandmann <sandmann@daimi.au.dk>
|
||||||
|
|
||||||
* profile.c (profile_list_callers): Make this function return a
|
* profile.c (profile_list_callers): Make this function return a
|
||||||
|
|||||||
28
profile.c
28
profile.c
@ -376,23 +376,23 @@ profile_list_callers (Profile *profile,
|
|||||||
|
|
||||||
for (node = callees; node != NULL; node = node->next)
|
for (node = callees; node != NULL; node = node->next)
|
||||||
{
|
{
|
||||||
gpointer name;
|
if (!node->parent)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (node->parent)
|
ProfileCaller *caller =
|
||||||
name = node->parent->address;
|
g_hash_table_lookup (callers_by_name, node->parent->address);
|
||||||
else
|
|
||||||
name = NULL;
|
|
||||||
|
|
||||||
if (!g_hash_table_lookup (callers_by_name, name))
|
if (!caller)
|
||||||
{
|
{
|
||||||
ProfileCaller *caller = profile_caller_new ();
|
caller = profile_caller_new ();
|
||||||
caller->name = name;
|
caller->name = node->parent->address;
|
||||||
caller->next = result;
|
|
||||||
caller->total = 0;
|
caller->total = 0;
|
||||||
caller->self = 0;
|
caller->self = 0;
|
||||||
|
|
||||||
g_hash_table_insert (callers_by_name, name, caller);
|
caller->next = result;
|
||||||
result = caller;
|
result = caller;
|
||||||
|
|
||||||
|
g_hash_table_insert (callers_by_name, node->parent->address, caller);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -403,6 +403,9 @@ profile_list_callers (Profile *profile,
|
|||||||
StackNode *n;
|
StackNode *n;
|
||||||
ProfileCaller *caller;
|
ProfileCaller *caller;
|
||||||
|
|
||||||
|
if (!node->parent)
|
||||||
|
continue;
|
||||||
|
|
||||||
for (n = node; n && n->parent; n = n->parent)
|
for (n = node; n && n->parent; n = n->parent)
|
||||||
{
|
{
|
||||||
if (n->address == node->address &&
|
if (n->address == node->address &&
|
||||||
@ -413,10 +416,7 @@ profile_list_callers (Profile *profile,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node->parent)
|
caller = g_hash_table_lookup (callers_by_name, node->parent->address);
|
||||||
caller = g_hash_table_lookup (callers_by_name, node->parent->address);
|
|
||||||
else
|
|
||||||
caller = g_hash_table_lookup (callers_by_name, NULL);
|
|
||||||
|
|
||||||
if (!g_hash_table_lookup (processed_callers, top_caller))
|
if (!g_hash_table_lookup (processed_callers, top_caller))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user