summaryrefslogtreecommitdiff
path: root/profile.c
diff options
context:
space:
mode:
authorSoren Sandmann <sandmann@daimi.au.dk>2006-10-12 03:45:21 +0000
committerSøren Sandmann Pedersen <ssp@src.gnome.org>2006-10-12 03:45:21 +0000
commit5eb19d00faa73bba7e609300d7d38575b038de2e (patch)
tree6b78e033ee3baf2184feb71f439663ecd566c8fe /profile.c
parentdf07f715397c2aafb25fcd2ead69d9c609f1622c (diff)
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.
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/profile.c b/profile.c
index 519dc10..531ea64 100644
--- a/profile.c
+++ b/profile.c
@@ -376,23 +376,23 @@ profile_list_callers (Profile *profile,
for (node = callees; node != NULL; node = node->next)
{
- gpointer name;
+ if (!node->parent)
+ continue;
- if (node->parent)
- name = node->parent->address;
- else
- name = NULL;
-
- if (!g_hash_table_lookup (callers_by_name, name))
+ ProfileCaller *caller =
+ g_hash_table_lookup (callers_by_name, node->parent->address);
+
+ if (!caller)
{
- ProfileCaller *caller = profile_caller_new ();
- caller->name = name;
- caller->next = result;
+ caller = profile_caller_new ();
+ caller->name = node->parent->address;
caller->total = 0;
caller->self = 0;
-
- g_hash_table_insert (callers_by_name, name, caller);
+
+ caller->next = result;
result = caller;
+
+ g_hash_table_insert (callers_by_name, node->parent->address, caller);
}
}
@@ -403,6 +403,9 @@ profile_list_callers (Profile *profile,
StackNode *n;
ProfileCaller *caller;
+ if (!node->parent)
+ continue;
+
for (n = node; n && n->parent; n = n->parent)
{
if (n->address == node->address &&
@@ -413,18 +416,15 @@ profile_list_callers (Profile *profile,
}
}
- if (node->parent)
- caller = g_hash_table_lookup (callers_by_name, node->parent->address);
- else
- caller = g_hash_table_lookup (callers_by_name, NULL);
+ caller = g_hash_table_lookup (callers_by_name, node->parent->address);
if (!g_hash_table_lookup (processed_callers, top_caller))
{
caller->total += top_callee->total;
-
+
g_hash_table_insert (processed_callers, top_caller, top_caller);
}
-
+
caller->self += node->size;
}