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:
Soren Sandmann
2006-10-12 03:45:21 +00:00
committed by Søren Sandmann Pedersen
parent df07f71539
commit 5eb19d00fa
2 changed files with 23 additions and 18 deletions

View File

@ -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

View File

@ -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))
{ {