Do not fold recursions for symbols starting with "In file".

Sun Jun  1 23:03:06 2008  Søren Sandmann  <sandmann@redhat.com>

	* profile.c (add_trace_to_tree): Do not fold recursions for
	symbols starting with "In file".

	* treeviewutils.c: Update copyright. Various formatting fixes.


svn path=/trunk/; revision=427
This commit is contained in:
Søren Sandmann
2008-06-02 03:17:27 +00:00
committed by Søren Sandmann Pedersen
parent 5b6c578c1a
commit 736806aaa6
3 changed files with 34 additions and 10 deletions

View File

@ -232,6 +232,22 @@ profile_new (StackStash *stash)
return profile;
}
static gboolean
fold_recursion (gpointer address)
{
/* This is a hack.
*
* The correct way to do it would be to have the address
* be a pointer to more information about the symbol; that
* way we could also do things like change the font.
*
* The problem with that is that we can't compatibly add
* this information to saved files, and we can't compute it
* without access to the processes who generated it.
*/
return strncmp (address, "In file", 7) != 0;
}
static void
add_trace_to_tree (GList *trace, gint size, gpointer data)
{
@ -244,7 +260,7 @@ add_trace_to_tree (GList *trace, gint size, gpointer data)
gpointer address = list->data;
ProfileDescendant *prev = NULL;
ProfileDescendant *match = NULL;
for (match = *tree; match != NULL; prev = match, match = match->siblings)
{
if (match->name == address)
@ -260,7 +276,7 @@ add_trace_to_tree (GList *trace, gint size, gpointer data)
}
}
if (!match)
if (!match && fold_recursion (address))
{
/* Have we seen this object further up the tree? */
for (match = parent; match != NULL; match = match->parent)