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

@ -1,3 +1,10 @@
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.
2008-04-30 Owen Taylor <otaylor@redhat.com>
* module/sysprof-module.c: Reorder the tests for

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)

View File

@ -3,7 +3,7 @@
* Copyright 2003, 2004, Red Hat, Inc.
*
* Sysprof -- Sampling, systemwide CPU profiler
* Copyright 2004, 2005, Soeren Sandmann
* Copyright 2004, 2005, 2006, 2007, 2008 Soeren Sandmann
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -32,10 +32,10 @@ typedef struct
} SortInfo;
static void
set_sort_info (GtkTreeView *view,
GtkTreeViewColumn *column,
int model_column,
GtkSortType default_order)
set_sort_info (GtkTreeView *view,
GtkTreeViewColumn *column,
int model_column,
GtkSortType default_order)
{
SortInfo *info;
@ -56,7 +56,8 @@ get_sort_info (GtkTreeViewColumn *column)
}
static GtkTreeViewColumn *
find_column_by_model_column (GtkTreeView *view, int model_column)
find_column_by_model_column (GtkTreeView *view,
int model_column)
{
GList *columns = gtk_tree_view_get_columns (view);
GList *list;
@ -78,8 +79,8 @@ find_column_by_model_column (GtkTreeView *view, int model_column)
void
tree_view_set_sort_column (GtkTreeView *view,
int model_column,
int sort_type)
int model_column,
int sort_type)
{
GList *columns, *list;
GtkTreeSortable *sortable;