Here is a patch that changes profiling so the list of children becomes a list of descendants. What this means is that for a given function you will see a tree of all functions that it calls, each associated with three numbers: - self: the number of bytes allocated by that descendant itself when called from somewhere inside the function. - non-recursive: the total number of bytes allocated by that descendant, not including recursions, ie., bytes that are already accounted for by functions higher up in the tree. This number is useful for things like estimating the overhead of something. For instance with --profile=cycles the descendant tree of g_signal_emit() will show how many cycles is spent inside g_closure_invoke(), not including recursive calls to g_signal_emit(). This number represents the amount of "useful" work g_signal_emit() does. If you divide the total number of cycles spent in g_signal_emit() by this number, you will get an estimate of the overhead for that function. - total: the total number of bytes allocated somewher inside this child, regardless of recursions. Ie., the number of bytes you would save if you could eliminate the call the function entirely. In addition, this patch includes some other changes: - It changes the layout of the user interface - There is a slightly clearer leak icon - It uses TreeViews for the profiling instead of CLists There is a screenshot of the new layout at http://www.daimi.au.dk/~sandmann/pictures/memprof-shot.png Possible problems: - You need the patch from bug #87556, or you will get warnings and profiling will be really unusably slow. - Profiling is significantly slower than before, even with the patch above. - There is no support for writing profiles to files. Since I rewrote profile.c and profile.h pretty much from scratch, I am attaching these files; the diff doesn't make much sense. Søren
/* MemProf -- memory profiler and leak detector * Copyright 2002, 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*=====*/ #include "profile.h" #include <glib.h> static GList * block_create_stack_list (Block *block, MPProcess *process, GHashTable *skip_hash) { StackElement *element; GList *stack = NULL; for (element = block->stack; !STACK_ELEMENT_IS_ROOT (element); element = element->parent) { Symbol *symbol = process_locate_symbol (process, (guint)element->address); if (symbol && symbol->name && g_hash_table_lookup (skip_hash, symbol->name)) continue; stack = g_list_prepend (stack, element); } return stack; } static void profile_add_stack_trace (Profile *profile, GList *stack, guint size) { GList *list; GPtrArray *roots = profile->roots; ProfileNode *parent = NULL; GHashTable *seen_symbols = g_hash_table_new (g_direct_hash, g_direct_equal); for (list = stack; list != NULL; list = list->next) { StackElement *element = list->data; ProfileNode *match = NULL; Symbol *symbol = process_locate_symbol (profile->process, (guint)element->address); int i; for (i = 0; i < roots->len; ++i) { ProfileNode *node = roots->pdata[i]; if (node->symbol == symbol) match = node; } if (!match) { ProfileNode *next_node; match = g_new (ProfileNode, 1); match->symbol = symbol; match->total = 0; match->self = 0; if (g_hash_table_lookup (seen_symbols, symbol)) match->toplevel = FALSE; else match->toplevel = TRUE; next_node = g_hash_table_lookup (profile->nodes_by_symbol, symbol); if (next_node) match->next = next_node; else match->next = NULL; g_hash_table_insert (profile->nodes_by_symbol, symbol, match); match->children = g_ptr_array_new (); match->parent = parent; g_ptr_array_add (roots, match); } g_hash_table_insert (seen_symbols, symbol, GINT_TO_POINTER (1)); match->total += size; if (!list->next) match->self += size; parent = match; roots = match->children; } g_hash_table_destroy (seen_symbols); } static void profile_build_tree (Profile *profile, GList *blocks, GSList *skip_funcs) { GHashTable *skip_hash = g_hash_table_new (g_str_hash, g_str_equal); GList *list; GSList *slist; for (slist = skip_funcs; slist != NULL; slist = slist->next) g_hash_table_insert (skip_hash, slist->data, ""); for (list = blocks; list != NULL; list = list->next) { Block *block = list->data; GList *stack = block_create_stack_list (block, profile->process, skip_hash); profile_add_stack_trace (profile, stack, block->size); g_list_free (stack); } g_hash_table_destroy (skip_hash); } static void add_function (gpointer key, gpointer value, gpointer data) { ProfileFunc *func; ProfileNode *node; Profile *profile = data; node = value; func = g_new (ProfileFunc, 1); func->node = node; func->total = 0; func->self = 0; while (node) { func->self += node->self; if (node->toplevel) func->total += node->total; node = node->next; } g_ptr_array_add (profile->functions, func); } static void add_block_to_list (Block *block, gpointer data) { GList **blocks = data; *blocks = g_list_prepend (*blocks, block); } Profile * profile_create (MPProcess *process, GSList *skip_funcs) { Profile *profile; GList *blocks = NULL; GList *list; process_block_foreach (process, add_block_to_list, &blocks); profile = g_new (Profile, 1); profile->roots = g_ptr_array_new (); profile->functions = g_ptr_array_new (); profile->n_bytes = 0; profile->process = process; profile->nodes_by_symbol = g_hash_table_new (g_direct_hash, g_direct_equal); profile_build_tree (profile, blocks, skip_funcs); for (list = blocks; list != NULL; list = list->next) { Block *block = list->data; profile->n_bytes += block->size; } g_hash_table_foreach (profile->nodes_by_symbol, add_function, profile); g_list_free (blocks); return profile; } static void profile_node_free (ProfileNode *node) { int i; for (i = 0; i < node->children->len; ++i) profile_node_free (node->children->pdata[i]); g_ptr_array_free (node->children, TRUE); g_free (node); } void profile_free (Profile *profile) { int i; for (i = 0; i < profile->roots->len; ++i) profile_node_free (profile->roots->pdata[i]); g_ptr_array_free (profile->roots, TRUE); for (i = 0; i < profile->functions->len; ++i) g_free (profile->functions->pdata[i]); g_ptr_array_free (profile->functions, TRUE); g_hash_table_destroy (profile->nodes_by_symbol); g_free (profile); } static void node_list_leaves (ProfileNode *node, GList **leaves) { int i; if (node->self > 0) *leaves = g_list_prepend (*leaves, node); for (i = 0; i < node->children->len; ++i) node_list_leaves (node->children->pdata[i], leaves); } static void add_trace_to_tree (GPtrArray *roots, GList *trace, guint size) { GList *list; GList *nodes_to_unmark = NULL; GList *nodes_to_unmark_recursive = NULL; ProfileDescendantTreeNode *parent = NULL; GHashTable *seen_symbols = g_hash_table_new (g_direct_hash, g_direct_equal); for (list = trace; list != NULL; list = list->next) { int i; ProfileNode *node = list->data; ProfileDescendantTreeNode *match = NULL; for (i = 0; i < roots->len; ++i) { ProfileDescendantTreeNode *tree_node = roots->pdata[i]; if (tree_node->symbol == node->symbol) match = tree_node; } if (!match) { ProfileDescendantTreeNode *seen_tree_node; seen_tree_node = g_hash_table_lookup (seen_symbols, node->symbol); if (seen_tree_node) { ProfileDescendantTreeNode *node; g_assert (parent); for (node = parent; node != seen_tree_node->parent; node = node->parent) { node->non_recursion -= size; --node->marked_non_recursive; } match = seen_tree_node; g_hash_table_destroy (seen_symbols); seen_symbols = g_hash_table_new (g_direct_hash, g_direct_equal); for (node = match; node != NULL; node = node->parent) g_hash_table_insert (seen_symbols, node->symbol, node); } } if (!match) { match = g_new (ProfileDescendantTreeNode, 1); match->symbol = node->symbol; match->non_recursion = 0; match->total = 0; match->self = 0; match->children = g_ptr_array_new (); match->marked_non_recursive = 0; match->marked_total = FALSE; match->parent = parent; g_ptr_array_add (roots, match); } if (!match->marked_non_recursive) { nodes_to_unmark = g_list_prepend (nodes_to_unmark, match); match->non_recursion += size; ++match->marked_non_recursive; } if (!match->marked_total) { nodes_to_unmark_recursive = g_list_prepend ( nodes_to_unmark_recursive, match); match->total += size; match->marked_total = TRUE; } if (!list->next) match->self += size; g_hash_table_insert (seen_symbols, node->symbol, match); roots = match->children; parent = match; } g_hash_table_destroy (seen_symbols); for (list = nodes_to_unmark; list != NULL; list = list->next) { ProfileDescendantTreeNode *tree_node = list->data; tree_node->marked_non_recursive = 0; } for (list = nodes_to_unmark_recursive; list != NULL; list = list->next) { ProfileDescendantTreeNode *tree_node = list->data; tree_node->marked_total = FALSE; } g_list_free (nodes_to_unmark); } static void add_leaf_to_tree (ProfileDescendantTree *tree, ProfileNode *leaf, ProfileNode *top) { ProfileNode *node; GList *trace = NULL; for (node = leaf; node != top->parent; node = node->parent) trace = g_list_prepend (trace, node); add_trace_to_tree (tree->roots, trace, leaf->self); g_list_free (trace); } ProfileDescendantTree * profile_func_create_descendant_tree (ProfileFunc *func) { ProfileDescendantTree *tree = g_new (ProfileDescendantTree, 1); ProfileNode *node; tree->roots = g_ptr_array_new (); for (node = func->node; node != NULL; node = node->next) if (node->toplevel) { GList *leaves = NULL; GList *list; node_list_leaves (node, &leaves); for (list = leaves; list != NULL; list = list->next) add_leaf_to_tree (tree, list->data, node); g_list_free (leaves); } return tree; } static void profile_descendant_tree_node_free (ProfileDescendantTreeNode *node) { int i; for (i = 0; i < node->children->len; ++i) { ProfileDescendantTreeNode *child = node->children->pdata[i]; profile_descendant_tree_node_free (child); } g_ptr_array_free (node->children, TRUE); g_free (node); } void profile_descendant_tree_free (ProfileDescendantTree *descendant_tree) { int i; for (i = 0; i < descendant_tree->roots->len; ++i) { ProfileDescendantTreeNode *node = descendant_tree->roots->pdata[i]; profile_descendant_tree_node_free (node); } g_ptr_array_free (descendant_tree->roots, TRUE); g_free (descendant_tree); } GPtrArray * profile_func_create_caller_list (ProfileFunc *func) { GPtrArray *result = g_ptr_array_new (); GHashTable *callers_by_symbol = g_hash_table_new (g_direct_hash, g_direct_equal); GHashTable *marked_callers = g_hash_table_new (g_direct_hash, g_direct_equal); ProfileFunc *spontaneous = NULL; ProfileNode *node; for (node = func->node; node != NULL; node = node->next) { if (node->parent) { if (!g_hash_table_lookup (callers_by_symbol, node->parent->symbol)) { ProfileFunc *caller = g_new (ProfileFunc, 1); caller->total = 0; caller->self = 0; caller->node = node->parent; g_hash_table_insert (callers_by_symbol, node->parent->symbol, caller); g_ptr_array_add (result, caller); } } else { if (!spontaneous) { spontaneous = g_new (ProfileFunc, 1); spontaneous->total = 0; spontaneous->self = 0; spontaneous->node = NULL; g_ptr_array_add (result, spontaneous); } } } for (node = func->node; node != NULL; node = node->next) { ProfileNode *top_caller_node; ProfileNode *top_callee_node; ProfileFunc *caller; ProfileNode *n; if (!node->parent) { g_assert (spontaneous); caller = spontaneous; } else caller = g_hash_table_lookup (callers_by_symbol, node->parent->symbol); /* find topmost node/parent pair identical to this node/parent */ top_caller_node = node->parent; top_callee_node = node; for (n = node->parent; n && n->parent != NULL; n = n->parent) { if (n->symbol == node->symbol && n->parent->symbol == top_caller_node->symbol) { top_caller_node = n->parent; top_callee_node = n; } } if (!g_hash_table_lookup (marked_callers, top_caller_node)) { caller->total += top_callee_node->total; g_hash_table_insert (marked_callers, top_caller_node, GINT_TO_POINTER (1)); } if (node->self > 0) caller->self += node->self; } g_hash_table_destroy (marked_callers); g_hash_table_destroy (callers_by_symbol); return result; } void profile_caller_list_free (GPtrArray *caller_list) { int i; for (i = 0; i < caller_list->len; ++i) g_free (caller_list->pdata[i]); g_ptr_array_free (caller_list, TRUE); } void profile_write (Profile *profile, const gchar *outfile) { /* FIXME */ }
/* MemProf -- memory profiler and leak detector * Copyright 2002, Soeren Sandmann (sandmann daimi au dk) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*====*/ #include "memprof.h" #include "process.h" #include <glib.h> typedef struct ProfileNode ProfileNode; typedef struct Profile Profile; typedef struct ProfileFunc ProfileFunc; typedef struct ProfileDescendantTree ProfileDescendantTree; typedef struct ProfileDescendantTreeNode ProfileDescendantTreeNode; struct ProfileNode { Symbol * symbol; guint total; guint self; gboolean toplevel; ProfileNode * next; GPtrArray * children; ProfileNode * parent; }; struct ProfileDescendantTreeNode { Symbol * symbol; guint self; guint non_recursion; guint total; GPtrArray * children; ProfileDescendantTreeNode *parent; gint marked_non_recursive; gboolean marked_total; }; struct ProfileDescendantTree { GPtrArray * roots; }; struct ProfileFunc { guint total; /* sum of all toplevel totals */ guint self; /* sum of all selfs */ ProfileNode *node; }; struct Profile { GPtrArray * roots; /* root nodes of call tree */ GPtrArray * functions; guint n_bytes; /* total number of bytes profiled */ /* private */ MPProcess * process; GHashTable *nodes_by_symbol; }; Profile * profile_create (MPProcess *process, GSList *skip_funcs); void profile_free (Profile *profile); ProfileDescendantTree *profile_func_create_descendant_tree (ProfileFunc *func); void profile_descendant_tree_free (ProfileDescendantTree *descendant_tree); GPtrArray * profile_func_create_caller_list (ProfileFunc *func); void profile_caller_list_free (GPtrArray *caller_list);
? asdf ? asdf.glade ? autom4te.cache ? callgraph.h ? calltree.h ? fest.c ? memintercept-time.ssp.c ? memprof-new-profile.patch ? memprof-time.patch ? memprof.gladep ? memprofdiff ? oldprofile.c ? oldprofile.h ? pixmaps ? plan ? profile-total.patch ? timer.c ? totalpatch Index: Makefile.am =================================================================== RCS file: /cvs/gnome/memprof/Makefile.am,v retrieving revision 1.20 diff -u -p -u -r1.20 Makefile.am --- Makefile.am 5 Sep 2002 19:16:38 -0000 1.20 +++ Makefile.am 3 Jan 2003 00:56:59 -0000 @@ -2,7 +2,7 @@ SUBDIRS = po bin_PROGRAMS = memprof noinst_PROGRAMS = testmemprof -pkgdata_DATA = memprof.glade leak.xpm memprof.png +pkgdata_DATA = memprof.glade leak.xpm leak.png memprof.png pkglib_LTLIBRARIES = libmemintercept.la libspeedintercept.la Index: leak.png =================================================================== RCS file: /cvs/gnome/memprof/leak.png,v retrieving revision 1.1.1.1 diff -u -p -u -r1.1.1.1 leak.png Binary files /tmp/cvs8w7YUX and leak.png differ Index: main.c =================================================================== RCS file: /cvs/gnome/memprof/main.c,v retrieving revision 1.26 diff -u -p -u -r1.26 main.c --- main.c 16 Nov 2002 10:25:00 -0000 1.26 +++ main.c 3 Jan 2003 00:57:00 -0000 @@ -3,6 +3,7 @@ /* MemProf -- memory profiler and leak detector * Copyright 1999, 2000, 2001, Red Hat, Inc. * Copyright 2002, Kristian Rietveld + * Copyright 2002, Soeren Sandmann (sandmann daimi au dk) * * 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,7 +33,6 @@ #include <signal.h> #include <glade/glade.h> -#include <gnome.h> #include <gconf/gconf-client.h> @@ -44,6 +44,7 @@ #include "process.h" #include "profile.h" #include "server.h" +#include <gnome.h> struct _ProcessWindow { MPProcess *process; @@ -53,12 +54,25 @@ struct _ProcessWindow { GtkWidget *main_window; GtkWidget *main_notebook; GtkWidget *n_allocations_label; + GtkWidget *profile_status_label; GtkWidget *bytes_per_label; GtkWidget *total_bytes_label; - GtkWidget *profile_func_clist; - GtkWidget *profile_caller_clist; - GtkWidget *profile_child_clist; + GtkWidget *profile_func_tree_view; + GtkTreeViewColumn *profile_func_column0; + GtkTreeViewColumn *profile_func_column1; + GtkTreeViewColumn *profile_func_column2; + + GtkWidget *profile_caller_tree_view; + GtkTreeViewColumn *profile_caller_column0; + GtkTreeViewColumn *profile_caller_column1; + GtkTreeViewColumn *profile_caller_column2; + + GtkWidget *profile_descendants_tree_view; + GtkTreeViewColumn *profile_descendants_column0; + GtkTreeViewColumn *profile_descendants_column1; + GtkTreeViewColumn *profile_descendants_column2; + GtkTreeViewColumn *profile_descendants_column3; GtkWidget *leak_block_clist; GtkWidget *leak_stack_clist; @@ -146,6 +160,10 @@ update_status (gpointer data) gtk_label_set_text (GTK_LABEL (pwin->n_allocations_label), tmp); g_free (tmp); + tmp = g_strdup_printf ("%d samples", pwin->process->n_allocations); + gtk_label_set_text (GTK_LABEL (pwin->profile_status_label), tmp); + g_free (tmp); + if (pwin->process->n_allocations == 0) tmp = g_strdup("-"); else @@ -201,159 +219,235 @@ usage_canvas_size_allocate (GtkWidget * GUI for profiles ************************************************************/ -static gint -profile_compare_name (GtkCList *clist, - gconstpointer ptr1, - gconstpointer ptr2) +static void +profile_func_list_goto_symbol (ProcessWindow *pwin, Symbol *symbol) { - ProfileFunc *func1 = ((const GtkCListRow *)ptr1)->data; - ProfileFunc *func2 = ((const GtkCListRow *)ptr2)->data; + GtkTreeModel *function_list; + GtkTreeIter iter; + gboolean found = FALSE; - return strcmp (func1->symbol->name, func2->symbol->name); -} - -static gint -profile_compare_self (GtkCList *clist, - gconstpointer ptr1, - gconstpointer ptr2) -{ - ProfileFunc *func1 = ((const GtkCListRow *)ptr1)->data; - ProfileFunc *func2 = ((const GtkCListRow *)ptr2)->data; + function_list = gtk_tree_view_get_model ( + GTK_TREE_VIEW (pwin->profile_func_tree_view)); + + if (gtk_tree_model_get_iter_first (function_list, &iter)) { + do { + ProfileFunc *func; + + gtk_tree_model_get (function_list, &iter, + 3, &func, + -1); + + if (func->node->symbol == symbol) { + found = TRUE; + break; + } + } while (gtk_tree_model_iter_next (function_list, &iter)); + } + + if (found) { + GtkTreePath *path = + gtk_tree_model_get_path (function_list, &iter); - return func1->self < func2->self ? 1 : - (func1->self > func2->self ? -1 : 0); + gtk_tree_view_set_cursor ( + GTK_TREE_VIEW (pwin->profile_func_tree_view), path, 0, FALSE); + } + gtk_widget_grab_focus (GTK_WIDGET (pwin->profile_func_tree_view)); } - -static gint -profile_compare_total (GtkCList *clist, - gconstpointer ptr1, - gconstpointer ptr2) + +static void +profile_descendants_row_activated (GtkTreeView *treeview, + GtkTreePath *path, + GtkTreeViewColumn *column, + gpointer data) { - ProfileFunc *func1 = ((const GtkCListRow *)ptr1)->data; - ProfileFunc *func2 = ((const GtkCListRow *)ptr2)->data; + GtkTreeModel *descendants_store; + ProcessWindow *pwin = data; + GtkTreeIter iter; + Symbol *desc_symbol; + + descendants_store = gtk_tree_view_get_model (treeview); + if (!gtk_tree_model_get_iter (descendants_store, &iter, path)) + return; + + gtk_tree_model_get (descendants_store, &iter, 4, &desc_symbol, -1); - return func1->total < func2->total ? 1 : - (func1->total > func2->total ? -1 : 0); + profile_func_list_goto_symbol (pwin, desc_symbol); } static void -profile_func_click_column (GtkWidget *clist, gint column) +profile_caller_row_activated (GtkTreeView *treeview, + GtkTreePath *path, + GtkTreeViewColumn *column, + gpointer data) { - static const GtkCListCompareFunc compare_funcs[] = { - profile_compare_name, - profile_compare_self, - profile_compare_total - }; + GtkTreeModel *caller_list; + ProcessWindow *pwin = data; + GtkTreeIter iter; + Symbol *caller_symbol; - g_return_if_fail (column >= 0 && column < 3); + caller_list = gtk_tree_view_get_model (treeview); + if (!gtk_tree_model_get_iter (caller_list, &iter, path)) + return; + + gtk_tree_model_get (caller_list, &iter, 3, &caller_symbol, -1); - gtk_clist_set_compare_func (GTK_CLIST (clist), compare_funcs[column]); - gtk_clist_sort (GTK_CLIST (clist)); + if (caller_symbol != GINT_TO_POINTER (-1)) + profile_func_list_goto_symbol (pwin, caller_symbol); } - + static void -profile_fill_ref_clist (GtkWidget *clist, GList *refs) +add_node (GtkTreeStore *store, const GtkTreeIter *parent, ProfileDescendantTreeNode *node) { - gint row; - GList *tmp_list; + GtkTreeIter iter; + gchar *name; + int i; - gtk_clist_clear (GTK_CLIST (clist)); - tmp_list = refs; - while (tmp_list) { - char *data[2]; - char buf[32]; - - ProfileFuncRef *ref = tmp_list->data; + gtk_tree_store_insert (store, &iter, (GtkTreeIter *)parent, 0); - data[0] = ref->function->symbol->name; - g_snprintf(buf, 32, "%d", ref->bytes); - data[1] = buf; + if (node->symbol) + name = node->symbol->name; + else + name = "???"; - row = gtk_clist_append (GTK_CLIST (clist), data); - gtk_clist_set_row_data (GTK_CLIST (clist), row, ref); + gtk_tree_store_set (store, &iter, + 0, name, + 1, node->self, + 2, node->non_recursion, + 3, node->total, + 4, node->symbol, + -1); - tmp_list = tmp_list->next; - } + for (i = 0; i < node->children->len; ++i) + add_node (store, &iter, node->children->pdata[i]); } static void -profile_func_select_row (GtkWidget *widget, - gint row, - gint column, - GdkEvent *event, - ProcessWindow *pwin) +profile_selection_changed (GtkTreeSelection *selection, ProcessWindow *pwin) { - ProfileFunc *function = gtk_clist_get_row_data (GTK_CLIST (widget), row); + GtkListStore *store; + GtkTreeIter selected; + ProfileFunc *func; + GtkTreeStore *tree_store; + GtkListStore *list_store; + GPtrArray *caller_list; + ProfileDescendantTree *descendant_tree; + int i; - if (function == NULL) - return; + gtk_tree_selection_get_selected (selection, (GtkTreeModel **)&store, &selected); - profile_fill_ref_clist (pwin->profile_child_clist, function->children); - profile_fill_ref_clist (pwin->profile_caller_clist, function->inherited); -} + gtk_tree_model_get (GTK_TREE_MODEL (store), &selected, + 3, &func, + -1); -static gboolean -profile_ref_button_press (GtkWidget *widget, - GdkEventButton *event, - ProcessWindow *pwin) -{ - if (event->window == GTK_CLIST (widget)->clist_window && - event->type == GDK_2BUTTON_PRESS) { - int my_row, function_row; + /* fill descendants tree */ + tree_store = gtk_tree_store_new ( + 5, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_POINTER); - if (!gtk_clist_get_selection_info (GTK_CLIST (widget), - event->x, event->y, - &my_row, NULL)) - return FALSE; + descendant_tree = profile_func_create_descendant_tree (func); - if (my_row != -1) { - ProfileFuncRef *ref; - ref = gtk_clist_get_row_data (GTK_CLIST (widget), my_row); + add_node (tree_store, NULL, descendant_tree->roots->pdata[0]); + + gtk_widget_set_sensitive (GTK_WIDGET (pwin->profile_descendants_tree_view), TRUE); - function_row = gtk_clist_find_row_from_data (GTK_CLIST (pwin->profile_func_clist), ref->function); + gtk_tree_view_set_model (GTK_TREE_VIEW (pwin->profile_descendants_tree_view), + GTK_TREE_MODEL (tree_store)); + g_object_unref (G_OBJECT (tree_store)); + profile_descendant_tree_free (descendant_tree); - if (function_row != -1) { - gtk_clist_select_row (GTK_CLIST (pwin->profile_func_clist), function_row, 0); - gtk_clist_moveto (GTK_CLIST (pwin->profile_func_clist), - function_row, -1, 0.5, 0.0); - } - } + /* fill caller tree */ + list_store = gtk_list_store_new (4, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_POINTER); - g_signal_stop_emission_by_name (G_OBJECT (widget), "button_press_event"); - return TRUE; + gtk_tree_view_column_set_sort_column_id (pwin->profile_caller_column0, -1); + gtk_tree_view_column_set_sort_column_id (pwin->profile_caller_column1, -1); + gtk_tree_view_column_set_sort_column_id (pwin->profile_caller_column2, -1); + + caller_list = profile_func_create_caller_list (func); + + for (i = 0; i < caller_list->len; ++i) { + GtkTreeIter iter; + gchar *name; + ProfileFunc *caller = caller_list->pdata[i]; + + if (caller->node) { + if (caller->node->symbol) + name = caller->node->symbol->name; + else + name = "???"; + } + else + name = "<spontaneous>"; + + gtk_list_store_append (list_store, &iter); + gtk_list_store_set (list_store, &iter, + 0, name, + 1, caller->self, + 2, caller->total, + 3, caller->node? caller->node->symbol : GINT_TO_POINTER (-1), + -1); } + profile_caller_list_free (caller_list); + + gtk_tree_view_column_set_sort_column_id (pwin->profile_caller_column0, 0); + gtk_tree_view_column_set_sort_column_id (pwin->profile_caller_column1, 1); + gtk_tree_view_column_set_sort_column_id (pwin->profile_caller_column2, 2); + + gtk_tree_view_set_model (GTK_TREE_VIEW (pwin->profile_caller_tree_view), + GTK_TREE_MODEL (list_store)); + + g_object_unref (G_OBJECT (list_store)); - return FALSE; + gtk_widget_set_sensitive (GTK_WIDGET (pwin->profile_caller_tree_view), TRUE); } static void -profile_fill (ProcessWindow *pwin, GtkCList *clist) +profile_fill (ProcessWindow *pwin) { - int i, row; + GtkListStore *store; + + int i; + + gtk_tree_view_set_model (GTK_TREE_VIEW (pwin->profile_func_tree_view), NULL); + store = gtk_list_store_new (4, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_POINTER); - gtk_clist_clear (clist); - for (i=0; i<pwin->profile->n_functions; i++) { - ProfileFunc *function = pwin->profile->functions[i]; - char *data[3]; - char buf[32]; - - data[0] = function->symbol->name; - g_snprintf(buf, 32, "%u", function->self); - data[1] = g_strdup (buf); + gtk_tree_view_set_model ( + GTK_TREE_VIEW (pwin->profile_func_tree_view), + GTK_TREE_MODEL (store)); - g_snprintf(buf, 32, "%u", function->total); - data[2] = g_strdup (buf); + /* inserting in a ListStore is O(n) when sorting ... */ + gtk_tree_view_column_set_sort_column_id (pwin->profile_func_column0, -1); + gtk_tree_view_column_set_sort_column_id (pwin->profile_func_column1, -1); + gtk_tree_view_column_set_sort_column_id (pwin->profile_func_column2, -1); - row = gtk_clist_append (clist, data); + for (i = 0; i < pwin->profile->functions->len; ++i) { + GtkTreeIter iter; + gchar *name; + + ProfileFunc *func = pwin->profile->functions->pdata[i]; - g_free (data[1]); - g_free (data[2]); + gtk_list_store_append (store, &iter); - gtk_clist_set_row_data (clist, row, function); + g_assert (func); + + if (func->node->symbol) + name = func->node->symbol->name; + else + name = "???"; + + gtk_list_store_set (store, &iter, + 0, name, + 1, func->self, + 2, func->total, + 3, func, + -1); } + + gtk_tree_view_column_set_sort_column_id (pwin->profile_func_column0, 0); + gtk_tree_view_column_set_sort_column_id (pwin->profile_func_column1, 1); + gtk_tree_view_column_set_sort_column_id (pwin->profile_func_column2, 2); - if (clist->rows > 0) - profile_func_select_row (GTK_WIDGET (clist), 0, 0, NULL, pwin); + gtk_widget_set_sensitive (GTK_WIDGET (pwin->profile_func_tree_view), TRUE); + + g_object_unref (G_OBJECT (store)); } @@ -712,6 +806,7 @@ status_changed_cb (MPProcess *process, P char *cmdline = process_get_cmdline (process); char *title = g_strdup_printf ("%s - %s (%d) - %s", _("MemProf"), cmdline, process->pid, status); gtk_window_set_title (GTK_WINDOW (pwin->main_window), title); + g_free (title); g_free (status); g_free (cmdline); @@ -724,16 +819,24 @@ process_window_reset (ProcessWindow *pwi if (pwin->profile) { profile_free (pwin->profile); pwin->profile = NULL; - gtk_clist_clear (GTK_CLIST (pwin->profile_func_clist)); - gtk_clist_clear (GTK_CLIST (pwin->profile_caller_clist)); - gtk_clist_clear (GTK_CLIST (pwin->profile_child_clist)); + + gtk_tree_view_set_model ( + GTK_TREE_VIEW (pwin->profile_func_tree_view), NULL); + gtk_tree_view_set_model ( + GTK_TREE_VIEW (pwin->profile_caller_tree_view), NULL); + gtk_tree_view_set_model ( + GTK_TREE_VIEW (pwin->profile_descendants_tree_view), NULL); + + gtk_widget_set_sensitive (GTK_WIDGET (pwin->profile_func_tree_view), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (pwin->profile_caller_tree_view), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (pwin->profile_descendants_tree_view), FALSE); } if (pwin->leaks) { - g_slist_free (pwin->leaks); - pwin->leaks = NULL; - gtk_clist_clear (GTK_CLIST (pwin->leak_block_clist)); - gtk_clist_clear (GTK_CLIST (pwin->leak_stack_clist)); + g_slist_free (pwin->leaks); + pwin->leaks = NULL; + gtk_clist_clear (GTK_CLIST (pwin->leak_block_clist)); + gtk_clist_clear (GTK_CLIST (pwin->leak_stack_clist)); } pwin->usage_max = 32*1024; @@ -906,6 +1009,10 @@ save_leak_cb (GtkWidget *widget) void save_profile_cb (GtkWidget *widget) { + show_error (pwin_from_widget (widget)->main_window, + ERROR_WARNING, _("Saving is disabled at the moment")); + +#if 0 static gchar *suggestion = NULL; gchar *filename; @@ -921,6 +1028,7 @@ save_profile_cb (GtkWidget *widget) profile_write (pwin->profile, filename); } } +#endif } void @@ -975,13 +1083,14 @@ generate_profile_cb (GtkWidget *widget) process_stop_input (pwin->process); if (pwin->profile) { + g_print ("hello\n"); profile_free (pwin->profile); pwin->profile = NULL; } pwin->profile = profile_create (pwin->process, skip_funcs); process_start_input (pwin->process); - profile_fill (pwin, GTK_CLIST (pwin->profile_func_clist)); + profile_fill (pwin); gtk_notebook_set_page (GTK_NOTEBOOK (pwin->main_notebook), 0); } @@ -1469,140 +1578,265 @@ process_window_destroy (ProcessWindow *p static ProcessWindow * process_window_new (void) { - gchar *fullfilename; - GladeXML *xml; - GtkWidget *vpaned; - ProcessWindow *pwin; - GtkWidget *menuitem; - - pwin = g_new0 (ProcessWindow, 1); - process_windows = g_slist_prepend (process_windows, pwin); - - pwin->process = NULL; - pwin->profile = NULL; - pwin->leaks = NULL; - - pwin->usage_max = 32*1024; - pwin->usage_high = 0; - pwin->usage_leaked = 0; - - xml = glade_xml_new (glade_file, "MainWindow", NULL); - - pwin->main_window = glade_xml_get_widget (xml, "MainWindow"); - fullfilename = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_PIXMAP, "memprof.png", FALSE, NULL); - gnome_window_icon_set_from_file (GTK_WINDOW (pwin->main_window), - fullfilename); - g_free (fullfilename); - - gtk_signal_connect (GTK_OBJECT (pwin->main_window), "delete_event", - GTK_SIGNAL_FUNC (hide_and_check_quit), pwin); - - - gtk_window_set_default_size (GTK_WINDOW (pwin->main_window), 400, 600); - - gtk_object_set_data_full (GTK_OBJECT (pwin->main_window), - "process-window", - pwin, (GDestroyNotify)process_window_free); - - pwin->main_notebook = glade_xml_get_widget (xml, "main-notebook"); - - pwin->follow_fork = default_follow_fork; - pwin->follow_exec = default_follow_exec; - - menuitem = glade_xml_get_widget (xml, "follow-fork"); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), pwin->follow_fork); - menuitem = glade_xml_get_widget (xml, "follow-exec"); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), pwin->follow_exec); - - pwin->n_allocations_label = glade_xml_get_widget (xml, "n-allocations-label"); - pwin->bytes_per_label = glade_xml_get_widget (xml, "bytes-per-label"); - pwin->total_bytes_label = glade_xml_get_widget (xml, "total-bytes-label"); - - pwin->profile_func_clist = glade_xml_get_widget (xml, "profile-func-clist"); - pwin->profile_child_clist = glade_xml_get_widget (xml, "profile-child-clist"); - pwin->profile_caller_clist = glade_xml_get_widget (xml, "profile-caller-clist"); - - gtk_clist_set_column_width (GTK_CLIST (pwin->profile_func_clist), 0, 250); - gtk_clist_set_column_width (GTK_CLIST (pwin->profile_child_clist), 0, 250); - gtk_clist_set_column_width (GTK_CLIST (pwin->profile_caller_clist), 0, 250); - - gtk_signal_connect (GTK_OBJECT (pwin->profile_func_clist), "select_row", - GTK_SIGNAL_FUNC (profile_func_select_row), pwin); - gtk_signal_connect (GTK_OBJECT (pwin->profile_func_clist), "click_column", - GTK_SIGNAL_FUNC (profile_func_click_column), NULL); - - gtk_signal_connect (GTK_OBJECT (pwin->profile_caller_clist), "button_press_event", - GTK_SIGNAL_FUNC (profile_ref_button_press), pwin); - gtk_signal_connect (GTK_OBJECT (pwin->profile_child_clist), "button_press_event", - GTK_SIGNAL_FUNC (profile_ref_button_press), pwin); - - pwin->leak_block_clist = glade_xml_get_widget (xml, "leak-block-clist"); - pwin->leak_stack_clist = glade_xml_get_widget (xml, "leak-stack-clist"); - - gtk_clist_set_column_width (GTK_CLIST (pwin->leak_stack_clist), 0, 250); - gtk_clist_set_column_width (GTK_CLIST (pwin->leak_stack_clist), 2, 500); - - gtk_signal_connect (GTK_OBJECT (pwin->leak_block_clist), "select_row", - GTK_SIGNAL_FUNC (leak_block_select_row), pwin); - gtk_signal_connect (GTK_OBJECT (pwin->leak_stack_clist), "button_press_event", - GTK_SIGNAL_FUNC (leak_stack_button_press), pwin); - - pwin->usage_max_label = glade_xml_get_widget (xml, "usage-max-label"); - pwin->usage_canvas = glade_xml_get_widget (xml, "usage-canvas"); - - set_white_bg (pwin->usage_canvas); - gtk_signal_connect (GTK_OBJECT (pwin->usage_canvas), "size_allocate", - GTK_SIGNAL_FUNC (usage_canvas_size_allocate), pwin); - - pwin->usage_high_bar = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (pwin->usage_canvas)), - gnome_canvas_rect_get_type (), - "x1", 0.0, - "y1", 0.0, - "outline_color", "black", - "fill_color", "blue", - NULL); - pwin->usage_current_bar = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (pwin->usage_canvas)), - gnome_canvas_rect_get_type (), - "x1", 0.0, - "y1", 0.0, - "outline_color", "black", - "fill_color", "yellow", - NULL); - pwin->usage_leak_bar = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (pwin->usage_canvas)), - gnome_canvas_rect_get_type (), - "x1", 0.0, - "y1", 0.0, - "outline_color", "black", - "fill_color", "red", - NULL); - pwin->usage_frame = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (pwin->usage_canvas)), - gnome_canvas_rect_get_type (), - "x1", 0.0, - "y1", 0.0, - "outline_color", "black", - "fill_color", NULL, - NULL); - - vpaned = glade_xml_get_widget (xml, "profile-vpaned"); - gtk_paned_set_position (GTK_PANED (vpaned), 150); - - vpaned = glade_xml_get_widget (xml, "leaks-vpaned"); - gtk_paned_set_position (GTK_PANED (vpaned), 150); - - /* If profiling time, not memory, hide all GUI related to leak - * detection. - */ - if (profile_type != MP_PROFILE_MEMORY) { - gtk_widget_hide (glade_xml_get_widget (xml, "leaks-vpaned")); - gtk_widget_hide (glade_xml_get_widget (xml, "toolbar-leaks-button")); - gtk_widget_hide (glade_xml_get_widget (xml, "save-leak-info")); - gtk_widget_hide (glade_xml_get_widget (xml, "generate-leak-report")); - } - - glade_xml_signal_autoconnect (xml); - g_object_unref (G_OBJECT (xml)); + gchar *fullfilename; + GladeXML *xml; + GtkWidget *vpaned; + GtkWidget *hpaned; + ProcessWindow *pwin; + GtkWidget *menuitem; + GtkCellRenderer *renderer; + + pwin = g_new0 (ProcessWindow, 1); + process_windows = g_slist_prepend (process_windows, pwin); + + pwin->process = NULL; + pwin->profile = NULL; + pwin->leaks = NULL; + + pwin->usage_max = 32*1024; + pwin->usage_high = 0; + pwin->usage_leaked = 0; + + xml = glade_xml_new (glade_file, "MainWindow", NULL); + + pwin->main_window = glade_xml_get_widget (xml, "MainWindow"); + fullfilename = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_PIXMAP, "memprof.png", FALSE, NULL); + gnome_window_icon_set_from_file (GTK_WINDOW (pwin->main_window), + fullfilename); + g_free (fullfilename); + + gtk_signal_connect (GTK_OBJECT (pwin->main_window), "delete_event", + GTK_SIGNAL_FUNC (hide_and_check_quit), pwin); + + + gtk_window_set_default_size (GTK_WINDOW (pwin->main_window), 500, 400); + + gtk_object_set_data_full (GTK_OBJECT (pwin->main_window), + "process-window", + pwin, (GDestroyNotify)process_window_free); + + pwin->main_notebook = glade_xml_get_widget (xml, "main-notebook"); + + pwin->follow_fork = default_follow_fork; + pwin->follow_exec = default_follow_exec; + + menuitem = glade_xml_get_widget (xml, "follow-fork"); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), pwin->follow_fork); + menuitem = glade_xml_get_widget (xml, "follow-exec"); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), pwin->follow_exec); + + pwin->n_allocations_label = glade_xml_get_widget (xml, "n-allocations-label"); + pwin->bytes_per_label = glade_xml_get_widget (xml, "bytes-per-label"); + pwin->total_bytes_label = glade_xml_get_widget (xml, "total-bytes-label"); + + pwin->profile_status_label = glade_xml_get_widget (xml, "profile-status-label"); + + /* profile function list */ + pwin->profile_func_tree_view = glade_xml_get_widget (xml, "profile-func-tree-view"); + + renderer = gtk_cell_renderer_text_new (); + pwin->profile_func_column0 = + gtk_tree_view_column_new_with_attributes ("Name", + renderer, + "text", 0, + NULL); + gtk_tree_view_column_set_resizable (pwin->profile_func_column0, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW (pwin->profile_func_tree_view), + pwin->profile_func_column0); + + renderer = gtk_cell_renderer_text_new (); + pwin->profile_func_column1 = + gtk_tree_view_column_new_with_attributes ("Self", + renderer, + "text", 1, + NULL); + gtk_tree_view_column_set_resizable (pwin->profile_func_column1, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW (pwin->profile_func_tree_view), + pwin->profile_func_column1); + + renderer = gtk_cell_renderer_text_new (); + pwin->profile_func_column2 = + gtk_tree_view_column_new_with_attributes ("Total", + renderer, + "text", 2, + NULL); + gtk_tree_view_column_set_resizable (pwin->profile_func_column2, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW (pwin->profile_func_tree_view), + pwin->profile_func_column2); + + gtk_tree_view_column_set_sort_column_id (pwin->profile_func_column0, 0); + gtk_tree_view_column_set_sort_column_id (pwin->profile_func_column1, 1); + gtk_tree_view_column_set_sort_column_id (pwin->profile_func_column2, 2); + + g_signal_connect (G_OBJECT (gtk_tree_view_get_selection ( + GTK_TREE_VIEW (pwin->profile_func_tree_view))), + "changed", G_CALLBACK (profile_selection_changed), pwin); + + gtk_widget_set_sensitive (GTK_WIDGET (pwin->profile_func_tree_view), FALSE); + + /* profile descendants view */ + pwin->profile_descendants_tree_view = + glade_xml_get_widget (xml, "profile-descendants-tree-view"); + + renderer = gtk_cell_renderer_text_new (); + pwin->profile_descendants_column0 = + gtk_tree_view_column_new_with_attributes ("Name", + renderer, + "text", 0, + NULL); + gtk_tree_view_column_set_resizable (pwin->profile_descendants_column0, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW (pwin->profile_descendants_tree_view), + pwin->profile_descendants_column0); + + renderer = gtk_cell_renderer_text_new (); + pwin->profile_descendants_column1 = + gtk_tree_view_column_new_with_attributes ("Self", + renderer, + "text", 1, + NULL); + gtk_tree_view_column_set_resizable (pwin->profile_descendants_column1, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW (pwin->profile_descendants_tree_view), + pwin->profile_descendants_column1); + + renderer = gtk_cell_renderer_text_new (); + pwin->profile_descendants_column2 = + gtk_tree_view_column_new_with_attributes ("Non-recursive", + renderer, + "text", 2, + NULL); + gtk_tree_view_column_set_resizable (pwin->profile_descendants_column2, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW (pwin->profile_descendants_tree_view), + pwin->profile_descendants_column2); + + renderer = gtk_cell_renderer_text_new (); + pwin->profile_descendants_column3 = + gtk_tree_view_column_new_with_attributes ("Total", + renderer, + "text", 3, + NULL); + gtk_tree_view_column_set_resizable (pwin->profile_descendants_column3, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW (pwin->profile_descendants_tree_view), + pwin->profile_descendants_column3); + + gtk_widget_set_sensitive (GTK_WIDGET (pwin->profile_descendants_tree_view), FALSE); + + g_signal_connect (G_OBJECT (pwin->profile_descendants_tree_view), "row-activated", + G_CALLBACK (profile_descendants_row_activated), pwin); + + /* profile caller view */ + pwin->profile_caller_tree_view = glade_xml_get_widget (xml, "profile-caller-tree-view"); + + renderer = gtk_cell_renderer_text_new (); + pwin->profile_caller_column0 = + gtk_tree_view_column_new_with_attributes ("Name", + renderer, + "text", 0, + NULL); + gtk_tree_view_column_set_resizable (pwin->profile_caller_column0, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW (pwin->profile_caller_tree_view), + pwin->profile_caller_column0); + + renderer = gtk_cell_renderer_text_new (); + pwin->profile_caller_column1 = + gtk_tree_view_column_new_with_attributes ("Self", + renderer, + "text", 1, + NULL); + gtk_tree_view_column_set_resizable (pwin->profile_caller_column1, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW (pwin->profile_caller_tree_view), + pwin->profile_caller_column1); + + renderer = gtk_cell_renderer_text_new (); + pwin->profile_caller_column2 = + gtk_tree_view_column_new_with_attributes ("Total", + renderer, + "text", 2, + NULL); + gtk_tree_view_column_set_resizable (pwin->profile_caller_column2, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW (pwin->profile_caller_tree_view), + pwin->profile_caller_column2); + + gtk_widget_set_sensitive (GTK_WIDGET (pwin->profile_caller_tree_view), FALSE); + g_signal_connect (G_OBJECT (pwin->profile_caller_tree_view), "row-activated", + G_CALLBACK (profile_caller_row_activated), pwin); + + /* leak clists */ + pwin->leak_block_clist = glade_xml_get_widget (xml, "leak-block-clist"); + pwin->leak_stack_clist = glade_xml_get_widget (xml, "leak-stack-clist"); + + gtk_clist_set_column_width (GTK_CLIST (pwin->leak_stack_clist), 0, 250); + gtk_clist_set_column_width (GTK_CLIST (pwin->leak_stack_clist), 2, 500); + + gtk_signal_connect (GTK_OBJECT (pwin->leak_block_clist), "select_row", + GTK_SIGNAL_FUNC (leak_block_select_row), pwin); + gtk_signal_connect (GTK_OBJECT (pwin->leak_stack_clist), "button_press_event", + GTK_SIGNAL_FUNC (leak_stack_button_press), pwin); + + pwin->usage_max_label = glade_xml_get_widget (xml, "usage-max-label"); + pwin->usage_canvas = glade_xml_get_widget (xml, "usage-canvas"); + + set_white_bg (pwin->usage_canvas); + gtk_signal_connect (GTK_OBJECT (pwin->usage_canvas), "size_allocate", + GTK_SIGNAL_FUNC (usage_canvas_size_allocate), pwin); + + pwin->usage_high_bar = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (pwin->usage_canvas)), + gnome_canvas_rect_get_type (), + "x1", 0.0, + "y1", 0.0, + "outline_color", "black", + "fill_color", "blue", + NULL); + pwin->usage_current_bar = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (pwin->usage_canvas)), + gnome_canvas_rect_get_type (), + "x1", 0.0, + "y1", 0.0, + "outline_color", "black", + "fill_color", "yellow", + NULL); + pwin->usage_leak_bar = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (pwin->usage_canvas)), + gnome_canvas_rect_get_type (), + "x1", 0.0, + "y1", 0.0, + "outline_color", "black", + "fill_color", "red", + NULL); + pwin->usage_frame = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (pwin->usage_canvas)), + gnome_canvas_rect_get_type (), + "x1", 0.0, + "y1", 0.0, + "outline_color", "black", + "fill_color", NULL, + NULL); + + vpaned = glade_xml_get_widget (xml, "profile-vpaned"); + gtk_paned_set_position (GTK_PANED (vpaned), 150); - return pwin; + hpaned = glade_xml_get_widget (xml, "profile-hpaned"); + gtk_paned_set_position (GTK_PANED (hpaned), 150); + + vpaned = glade_xml_get_widget (xml, "leaks-vpaned"); + gtk_paned_set_position (GTK_PANED (vpaned), 150); + + /* If profiling time, not memory, hide all GUI related to leak + * detection. + */ + if (profile_type != MP_PROFILE_MEMORY) { + gtk_widget_hide (glade_xml_get_widget (xml, "leaks-vpaned")); + gtk_widget_hide (glade_xml_get_widget (xml, "toolbar-leaks-button")); + gtk_widget_hide (glade_xml_get_widget (xml, "save-leak-info")); + gtk_widget_hide (glade_xml_get_widget (xml, "generate-leak-report")); + gtk_widget_hide (glade_xml_get_widget (xml, "allocation-bar")); + gtk_notebook_set_show_tabs ( + GTK_NOTEBOOK (glade_xml_get_widget (xml, "main-notebook")), FALSE); + } + else { + gtk_widget_hide (glade_xml_get_widget (xml, "profile-status-label")); + } + + glade_xml_signal_autoconnect (xml); + g_object_unref (G_OBJECT (xml)); + + return pwin; } Index: memprof.glade =================================================================== RCS file: /cvs/gnome/memprof/memprof.glade,v retrieving revision 1.17 diff -u -p -u -r1.17 memprof.glade --- memprof.glade 5 Sep 2002 19:16:38 -0000 1.17 +++ memprof.glade 3 Jan 2003 00:57:00 -0000 @@ -1,2066 +1,2079 @@ <?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd" > +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> <glade-interface> - <requires lib="gnome" /> - <requires lib="bonobo" /> - <requires lib="canvas" /> - - <widget class="GnomeApp" id="MainWindow"> - <property name="visible">no</property> - <property name="title" translatable="yes">MemProf</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="modal">no</property> - <property name="default_width">300</property> - <property name="default_height">400</property> - <property name="allow_shrink">no</property> - <property name="allow_grow">yes</property> - <property name="enable_layout_config">yes</property> - <property name="window-position">GTK_WIN_POS_NONE</property> - - <child internal-child="dock"> - <widget class="BonoboDock" id="dock1"> - <property name="allow_floating">yes</property> - <property name="visible">yes</property> - - <child> - <widget class="BonoboDockItem" id="dockitem1"> - <property name="border_width">0</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkMenuBar" id="menubar1"> - <property name="visible">yes</property> - - <child> - <widget class="GtkMenuItem" id="file1"> - <property name="visible">yes</property> - <property name="label" translatable="yes">_File</property> - <property name="use_stock">no</property> - <property name="use_underline">yes</property> - - <child> - <widget class="GtkMenu" id="file1_menu"> - <property name="visible">yes</property> - - <child> - <widget class="GtkImageMenuItem" id="run"> - <property name="label" translatable="yes">_Run Program...</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - - <signal name="activate" handler="run_cb" /> - - <child internal-child="image"> - <widget class="GtkImage" id="convertwidget1"> - <property name="stock">gtk-execute</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="separator3"> - <property name="visible">yes</property> - </widget> - </child> - - <child> - <widget class="GtkImageMenuItem" id="save_profile1"> - <property name="label" translatable="yes">Save _Profile...</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - - <signal name="activate" handler="save_profile_cb" /> - - <child internal-child="image"> - <widget class="GtkImage" id="convertwidget2"> - <property name="stock">gtk-save</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkImageMenuItem" id="save-leak-info"> - <property name="label" translatable="yes">Save _Leak Info...</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - - <signal name="activate" handler="save_leak_cb" /> - - <child internal-child="image"> - <widget class="GtkImage" id="convertwidget3"> - <property name="stock">gtk-save</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="separator1"> - <property name="visible">yes</property> - </widget> - </child> - - <child> - <widget class="GtkImageMenuItem" id="close1"> - <property name="visible">yes</property> - <property name="label">gtk-close</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - - <signal name="activate" handler="close_cb" /> - </widget> - </child> - - <child> - <widget class="GtkImageMenuItem" id="exit1"> - <property name="visible">yes</property> - <property name="label">gtk-quit</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - - <signal name="activate" handler="exit_cb" /> - </widget> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="process1"> - <property name="label" translatable="yes">_Process</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - - <child> - <widget class="GtkMenu" id="process1_menu"> - <property name="visible">yes</property> - - <child> - <widget class="GtkImageMenuItem" id="generate_profile1"> - <property name="label" translatable="yes">Generate _Profile</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - - <signal name="activate" handler="generate_profile_cb" /> - <child internal-child="image"> - <widget class="GtkImage" id="convertwidget5"> - <property name="stock">gtk-justify-left</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkImageMenuItem" id="generate-leak-report"> - <property name="label" translatable="yes">Generate _Leak Report</property> - <property name="visible">yes</property> - <property name="use_stock">no</property> - <property name="use_underline">yes</property> - - <signal name="activate" handler="generate_leak_cb" /> - <child internal-child="image"> - <widget class="GtkImage" id="convertwidget4"> - <property name="pixbuf">leak.xpm</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="separator8"> - <property name="visible">yes</property> - </widget> - </child> - - <child> - <widget class="GtkImageMenuItem" id="kill1"> - <property name="label" translatable="yes">_Kill</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - - <signal name="activate" handler="kill_cb" /> - - <child internal-child="image"> - <widget class="GtkImage" id="convertwidget1"> - <property name="stock">gtk-close</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="detach1"> - <property name="label" translatable="yes">_Detach</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - - <signal name="activate" handler="detach_cb" /> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="separator9"> - <property name="visible">yes</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="process_tree1"> - <property name="label" translatable="yes">Process _Tree</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - - <signal name="activate" handler="process_tree_cb" /> - </widget> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="settings1"> - <property name="visible">yes</property> - <property name="label" translatable="yes">_Settings</property> - <property name="use_stock">no</property> - <property name="use_underline">yes</property> - - <child> - <widget class="GtkMenu" id="settings1_menu"> - <property name="visible">yes</property> - - <child> - <widget class="GtkImageMenuItem" id="preferences1"> - <property name="visible">yes</property> - <property name="label">gtk-preferences</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - - <signal name="activate" handler="preferences_cb" /> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="separator5"> - <property name="visible">yes</property> - </widget> - </child> - - <child> - <widget class="GtkCheckMenuItem" id="follow-fork"> - <property name="label" translatable="yes">Follow _fork()</property> - <property name="active">no</property> - <property name="always_show_toggle">yes</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - - <signal name="activate" handler="follow_fork_cb" /> - </widget> - </child> - - <child> - <widget class="GtkCheckMenuItem" id="follow-exec"> - <property name="label" translatable="yes">Follow _exec()</property> - <property name="active">yes</property> - <property name="always_show_toggle">yes</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - - <signal name="activate" handler="follow_exec_cb" /> - </widget> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="help1"> - <property name="visible">yes</property> - <property name="label" translatable="yes">_Help</property> - <property name="use_stock">no</property> - <property name="use_underline">yes</property> - - <child> - <widget class="GtkMenu" id="help1_menu"> - <property name="visible">yes</property> - - <child> - <widget class="GtkImageMenuItem" id="about1"> - <property name="visible">yes</property> - <property name="label">gnome-stock-about</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - - <signal name="activate" handler="about_cb" /> - </widget> - </child> - </widget> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="placement">BONOBO_DOCK_TOP</property> - <property name="band">0</property> - <property name="position">0</property> - <property name="offset">0</property> - <property name="behavior">BONOBO_DOCK_ITEM_BEH_EXCLUSIVE|BONOBO_DOCK_ITEM_BEH_NEVER_VERTICAL</property> - </packing> - </child> - - <child> - <widget class="BonoboDockItem" id="dockitem2"> - <property name="border_width">0</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkToolbar" id="toolbar1"> - <property name="border_width">1</property> - <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property> - <property name="visible">yes</property> - - <child> - <widget class="button" id="button2"> - <property name="tooltip" translatable="yes">Run Program</property> - <property name="label" translatable="yes">Run</property> - <property name="stock_pixmap">gtk-execute</property> - <property name="visible">yes</property> - - <signal name="clicked" handler="run_cb" /> - </widget> - </child> - - <child> - <widget class="button" id="button26"> - <property name="tooltip" translatable="yes">Kill Program</property> - <property name="label" translatable="yes">Kill</property> - <property name="stock_pixmap">gtk-close</property> - <property name="visible">yes</property> - - <signal name="clicked" handler="kill_cb" /> - </widget> - </child> - - <child> - <widget class="button" id="button4"> - <property name="tooltip" translatable="yes">Create Profile</property> - <property name="label" translatable="yes">Profile</property> - <property name="stock_pixmap">gtk-justify-left</property> - <property name="visible">yes</property> - - <signal name="clicked" handler="generate_profile_cb" /> - </widget> - </child> - - <child> - <widget class="button" id="toolbar-leaks-button"> - <property name="tooltip" translatable="yes">Check for Leaks</property> - <property name="label" translatable="yes">Leaks</property> - <property name="icon">leak.xpm</property> - <property name="visible">yes</property> - - <signal name="clicked" handler="generate_leak_cb" /> - </widget> - </child> - - <child> - <widget class="button" id="button3"> - <property name="tooltip" translatable="yes">Save Report</property> - <property name="label" translatable="yes">Save</property> - <property name="stock_pixmap">gtk-save</property> - <property name="visible">yes</property> - - <signal name="clicked" handler="save_current_cb" /> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="placement">BONOBO_DOCK_TOP</property> - <property name="band">1</property> - <property name="position">0</property> - <property name="offset">0</property> - <property name="behavior">BONOBO_DOCK_ITEM_BEH_EXCLUSIVE</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox5"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkVBox" id="vbox6"> - <property name="border_width">4</property> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkHBox" id="hbox8"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label46"> - <property name="label" translatable="yes">0k</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">7.45058e-09</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="usage-max-label"> - <property name="label" translatable="yes">32k</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GnomeCanvas" id="usage-canvas"> - <property name="can_focus">yes</property> - <property name="anti_aliased">no</property> - <property name="scroll_x1">0</property> - <property name="scroll_y1">0</property> - <property name="scroll_x2">100</property> - <property name="scroll_y2">100</property> - <property name="pixels_per_unit">1</property> - <property name="height-request">20</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox4"> - <property name="border_width">4</property> - <property name="homogeneous">yes</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkHBox" id="hbox5"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label30"> - <property name="label" translatable="yes"># of Allocations:</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="n-allocations-label"> - <property name="label" translatable="yes">0</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox6"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label43"> - <property name="label" translatable="yes">Bytes / Allocation:</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="bytes-per-label"> - <property name="label" translatable="yes">0</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">7.45058e-09</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox7"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label45"> - <property name="label" translatable="yes">Total Bytes:</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="total-bytes-label"> - <property name="label" translatable="yes">0</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">7.45058e-09</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkNotebook" id="main-notebook"> - <property name="can_focus">yes</property> - <property name="show_tabs">yes</property> - <property name="show_border">yes</property> - <property name="tab_pos">GTK_POS_TOP</property> - <property name="scrollable">no</property> - <property name="tab_hborder">2</property> - <property name="tab_vborder">2</property> - <property name="enable-popup">no</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkVPaned" id="profile-vpaned"> - <property name="position">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow4"> - <property name="border_width">4</property> - <property name="hscrollbar_policy">GTK_POLICY_NEVER</property> - <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="height-request">30</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkCList" id="profile-func-clist"> - <property name="can_focus">yes</property> - <property name="column_widths">212,134,80</property> - <property name="selection_mode">GTK_SELECTION_BROWSE</property> - <property name="show_titles">yes</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - <property name="n_columns">3</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label27"> - <property name="label" translatable="yes">Function</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label28"> - <property name="label" translatable="yes">Self</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label29"> - <property name="label" translatable="yes">Total</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - </child> - - <child internal-child="hscrollbar"> - <widget class="GtkHScrollbar" id="convertwidget2"> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="visible">yes</property> - </widget> - </child> - - <child internal-child="vscrollbar"> - <widget class="GtkVScrollbar" id="convertwidget3"> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - <packing> - <property name="shrink">no</property> - <property name="resize">no</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox5"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkFrame" id="frame2"> - <property name="border_width">4</property> - <property name="label" translatable="yes">Children</property> - <property name="label_xalign">0</property> - <property name="height-request">30</property> - <property name="shadow">GTK_SHADOW_ETCHED_IN</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow3"> - <property name="hscrollbar_policy">GTK_POLICY_NEVER</property> - <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkCList" id="profile-child-clist"> - <property name="can_focus">yes</property> - <property name="column_widths">142,80</property> - <property name="selection_mode">GTK_SELECTION_BROWSE</property> - <property name="show_titles">yes</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - <property name="n_columns">2</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label23"> - <property name="label" translatable="yes">Function</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label41"> - <property name="label" translatable="yes">Bytes</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - </child> - - <child internal-child="hscrollbar"> - <widget class="GtkHScrollbar" id="convertwidget4"> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="visible">yes</property> - </widget> - </child> - - <child internal-child="vscrollbar"> - <widget class="GtkVScrollbar" id="convertwidget5"> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame3"> - <property name="border_width">4</property> - <property name="label" translatable="yes">Callers</property> - <property name="label_xalign">0</property> - <property name="height-request">30</property> - <property name="shadow">GTK_SHADOW_ETCHED_IN</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow7"> - <property name="hscrollbar_policy">GTK_POLICY_NEVER</property> - <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkCList" id="profile-caller-clist"> - <property name="can_focus">yes</property> - <property name="column_widths">144,80</property> - <property name="selection_mode">GTK_SELECTION_BROWSE</property> - <property name="show_titles">yes</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - <property name="n_columns">2</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label25"> - <property name="label" translatable="yes">Function</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label26"> - <property name="label" translatable="yes">Bytes</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - </child> - - <child internal-child="hscrollbar"> - <widget class="GtkHScrollbar" id="convertwidget6"> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="visible">yes</property> - </widget> - </child> - - <child internal-child="vscrollbar"> - <widget class="GtkVScrollbar" id="convertwidget7"> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <packing> - <property name="shrink">yes</property> - <property name="resize">yes</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label2"> - <property name="label" translatable="yes">Profile</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - - <child> - <widget class="GtkVPaned" id="leaks-vpaned"> - <property name="position">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow5"> - <property name="border_width">4</property> - <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="height-request">30</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkCList" id="leak-block-clist"> - <property name="can_focus">yes</property> - <property name="column_widths">84,80,80</property> - <property name="selection_mode">GTK_SELECTION_BROWSE</property> - <property name="show_titles">yes</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - <property name="n_columns">3</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label4"> - <property name="label" translatable="yes">Address</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label5"> - <property name="label" translatable="yes">Size</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label6"> - <property name="label" translatable="yes">Caller</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - </child> - - <child internal-child="hscrollbar"> - <widget class="GtkHScrollbar" id="convertwidget8"> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="visible">yes</property> - </widget> - </child> - - <child internal-child="vscrollbar"> - <widget class="GtkVScrollbar" id="convertwidget9"> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - <packing> - <property name="shrink">no</property> - <property name="resize">no</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame1"> - <property name="border_width">4</property> - <property name="label" translatable="yes">Stack Trace</property> - <property name="label_xalign">0</property> - <property name="height-request">30</property> - <property name="shadow">GTK_SHADOW_ETCHED_IN</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow1"> - <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkCList" id="leak-stack-clist"> - <property name="can_focus">yes</property> - <property name="column_widths">80,108,80</property> - <property name="selection_mode">GTK_SELECTION_BROWSE</property> - <property name="show_titles">yes</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - <property name="n_columns">3</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label12"> - <property name="label" translatable="yes">Function</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label13"> - <property name="label" translatable="yes">Line</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label14"> - <property name="label" translatable="yes">File</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - </child> - - <child internal-child="hscrollbar"> - <widget class="GtkHScrollbar" id="convertwidget10"> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="visible">yes</property> - </widget> - </child> - - <child internal-child="vscrollbar"> - <widget class="GtkVScrollbar" id="convertwidget11"> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="shrink">no</property> - <property name="resize">yes</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label3"> - <property name="label" translatable="yes">Leaks</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child internal-child="appbar"> - <widget class="GnomeAppBar" id="appbar1"> - <property name="visible">no</property> - <property name="has_progress">no</property> - <property name="has_status">no</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <widget class="GnomeAbout" id="About"> - <property name="visible">no</property> - <property name="logo">memprof.png</property> - <property name="name" translatable="yes">MemProf</property> - <property name="copyright" translatable="yes">Copyright 1999, 2000, 2001, Red Hat, Inc. Copyright 2002, Kristian Rietveld</property> - <property name="authors">Owen Taylor <otaylor redhat com> Kristian Rietveld <kris gtk org> +<requires lib="gnome"/> +<requires lib="canvas"/> +<requires lib="bonobo"/> + +<widget class="GnomeApp" id="MainWindow"> + <property name="title" translatable="yes">MemProf</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="default_width">300</property> + <property name="default_height">400</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="enable_layout_config">True</property> + + <child internal-child="dock"> + <widget class="BonoboDock" id="dock1"> + <property name="visible">True</property> + <property name="allow_floating">True</property> + + <child> + <widget class="BonoboDockItem" id="dockitem1"> + <property name="visible">True</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + + <child> + <widget class="GtkMenuBar" id="menubar1"> + <property name="visible">True</property> + + <child> + <widget class="GtkMenuItem" id="file1"> + <property name="visible">True</property> + <property name="label" translatable="yes">_File</property> + <property name="use_underline">True</property> + + <child> + <widget class="GtkMenu" id="file1_menu"> + + <child> + <widget class="GtkImageMenuItem" id="run"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Run Program...</property> + <property name="use_underline">True</property> + <signal name="activate" handler="run_cb"/> + + <child internal-child="image"> + <widget class="GtkImage" id="image50"> + <property name="visible">True</property> + <property name="stock">gtk-execute</property> + <property name="icon_size">1</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkMenuItem" id="separator3"> + <property name="visible">True</property> + </widget> + </child> + + <child> + <widget class="GtkImageMenuItem" id="save_profile1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Save _Profile...</property> + <property name="use_underline">True</property> + <signal name="activate" handler="save_profile_cb"/> + + <child internal-child="image"> + <widget class="GtkImage" id="image51"> + <property name="visible">True</property> + <property name="stock">gtk-save</property> + <property name="icon_size">1</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkImageMenuItem" id="save-leak-info"> + <property name="visible">True</property> + <property name="label" translatable="yes">Save _Leak Info...</property> + <property name="use_underline">True</property> + <signal name="activate" handler="save_leak_cb"/> + + <child internal-child="image"> + <widget class="GtkImage" id="image52"> + <property name="visible">True</property> + <property name="stock">gtk-save</property> + <property name="icon_size">1</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkMenuItem" id="separator1"> + <property name="visible">True</property> + </widget> + </child> + + <child> + <widget class="GtkImageMenuItem" id="close1"> + <property name="visible">True</property> + <property name="stock_item">GNOMEUIINFO_MENU_CLOSE_ITEM</property> + <signal name="activate" handler="close_cb"/> + </widget> + </child> + + <child> + <widget class="GtkImageMenuItem" id="exit1"> + <property name="visible">True</property> + <property name="stock_item">GNOMEUIINFO_MENU_EXIT_ITEM</property> + <signal name="activate" handler="exit_cb"/> + </widget> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkMenuItem" id="process1"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Process</property> + <property name="use_underline">True</property> + + <child> + <widget class="GtkMenu" id="process1_menu"> + + <child> + <widget class="GtkImageMenuItem" id="generate_profile1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Generate _Profile</property> + <property name="use_underline">True</property> + <signal name="activate" handler="generate_profile_cb"/> + + <child internal-child="image"> + <widget class="GtkImage" id="image53"> + <property name="visible">True</property> + <property name="stock">gtk-justify-left</property> + <property name="icon_size">1</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkImageMenuItem" id="generate-leak-report"> + <property name="visible">True</property> + <property name="label" translatable="yes">Generate _Leak Report</property> + <property name="use_underline">True</property> + <signal name="activate" handler="generate_leak_cb"/> + + <child internal-child="image"> + <widget class="GtkImage" id="image54"> + <property name="visible">True</property> + <property name="pixbuf">leak.png</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkMenuItem" id="separator8"> + <property name="visible">True</property> + </widget> + </child> + + <child> + <widget class="GtkImageMenuItem" id="kill1"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Kill</property> + <property name="use_underline">True</property> + <signal name="activate" handler="kill_cb"/> + + <child internal-child="image"> + <widget class="GtkImage" id="image55"> + <property name="visible">True</property> + <property name="stock">gnome-stock-timer-stop</property> + <property name="icon_size">1</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkMenuItem" id="detach1"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Detach</property> + <property name="use_underline">True</property> + <signal name="activate" handler="detach_cb"/> + </widget> + </child> + + <child> + <widget class="GtkMenuItem" id="separator9"> + <property name="visible">True</property> + </widget> + </child> + + <child> + <widget class="GtkMenuItem" id="process_tree1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Process _Tree</property> + <property name="use_underline">True</property> + <signal name="activate" handler="process_tree_cb"/> + </widget> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkMenuItem" id="settings1"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Settings</property> + <property name="use_underline">True</property> + + <child> + <widget class="GtkMenu" id="settings1_menu"> + + <child> + <widget class="GtkImageMenuItem" id="preferences1"> + <property name="visible">True</property> + <property name="stock_item">GNOMEUIINFO_MENU_PREFERENCES_ITEM</property> + <signal name="activate" handler="preferences_cb"/> + </widget> + </child> + + <child> + <widget class="GtkMenuItem" id="separator5"> + <property name="visible">True</property> + </widget> + </child> + + <child> + <widget class="GtkCheckMenuItem" id="follow-fork"> + <property name="visible">True</property> + <property name="label" translatable="yes">Follow _fork()</property> + <property name="use_underline">True</property> + <property name="active">False</property> + <signal name="activate" handler="follow_fork_cb"/> + </widget> + </child> + + <child> + <widget class="GtkCheckMenuItem" id="follow-exec"> + <property name="visible">True</property> + <property name="label" translatable="yes">Follow _exec()</property> + <property name="use_underline">True</property> + <property name="active">True</property> + <signal name="activate" handler="follow_exec_cb"/> + </widget> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkMenuItem" id="help1"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Help</property> + <property name="use_underline">True</property> + + <child> + <widget class="GtkMenu" id="help1_menu"> + + <child> + <widget class="GtkImageMenuItem" id="about1"> + <property name="visible">True</property> + <property name="stock_item">GNOMEUIINFO_MENU_ABOUT_ITEM</property> + <signal name="activate" handler="about_cb"/> + </widget> + </child> + </widget> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="placement">BONOBO_DOCK_TOP</property> + <property name="band">0</property> + <property name="position">0</property> + <property name="offset">0</property> + <property name="behavior">BONOBO_DOCK_ITEM_BEH_EXCLUSIVE|BONOBO_DOCK_ITEM_BEH_NEVER_VERTICAL</property> + </packing> + </child> + + <child> + <widget class="BonoboDockItem" id="dockitem2"> + <property name="visible">True</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + + <child> + <widget class="GtkToolbar" id="toolbar1"> + <property name="border_width">1</property> + <property name="visible">True</property> + <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property> + <property name="toolbar_style">GTK_TOOLBAR_BOTH</property> + <property name="tooltips">True</property> + + <child> + <widget class="button" id="button2"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Run Program</property> + <property name="label" translatable="yes">Run</property> + <property name="use_underline">True</property> + <property name="stock_pixmap">gtk-execute</property> + <signal name="clicked" handler="run_cb"/> + </widget> + </child> + + <child> + <widget class="button" id="button26"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Kill Program</property> + <property name="label" translatable="yes">Kill</property> + <property name="use_underline">True</property> + <property name="stock_pixmap">gtk-close</property> + <signal name="clicked" handler="kill_cb"/> + </widget> + </child> + + <child> + <widget class="button" id="button4"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Create Profile</property> + <property name="label" translatable="yes">Profile</property> + <property name="use_underline">True</property> + <property name="stock_pixmap">gtk-justify-left</property> + <signal name="clicked" handler="generate_profile_cb"/> + </widget> + </child> + + <child> + <widget class="button" id="toolbar-leaks-button"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Check for Leaks</property> + <property name="label" translatable="yes">Leaks</property> + <property name="use_underline">True</property> + <property name="icon">leak.png</property> + <signal name="clicked" handler="generate_leak_cb"/> + </widget> + </child> + + <child> + <widget class="button" id="button3"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Save Report</property> + <property name="label" translatable="yes">Save</property> + <property name="use_underline">True</property> + <property name="stock_pixmap">gtk-save</property> + <signal name="clicked" handler="save_current_cb"/> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="placement">BONOBO_DOCK_TOP</property> + <property name="band">1</property> + <property name="position">0</property> + <property name="offset">0</property> + <property name="behavior">BONOBO_DOCK_ITEM_BEH_EXCLUSIVE</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox5"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkVBox" id="allocation-bar"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkHBox" id="hbox8"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkLabel" id="label65"> + <property name="visible">True</property> + <property name="label" translatable="yes">0k</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="usage-max-label"> + <property name="visible">True</property> + <property name="label" translatable="yes">32k</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GnomeCanvas" id="usage-canvas"> + <property name="height_request">18</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="anti_aliased">False</property> + <property name="scroll_x1">0</property> + <property name="scroll_y1">0</property> + <property name="scroll_x2">100</property> + <property name="scroll_y2">100</property> + <property name="pixels_per_unit">1</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox4"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="homogeneous">True</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkHBox" id="hbox5"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkLabel" id="label30"> + <property name="visible">True</property> + <property name="label" translatable="yes"># of Allocations:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="n-allocations-label"> + <property name="visible">True</property> + <property name="label" translatable="yes">0</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox6"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkLabel" id="label43"> + <property name="visible">True</property> + <property name="label" translatable="yes">Bytes / Allocation:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="bytes-per-label"> + <property name="visible">True</property> + <property name="label" translatable="yes">0</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">7.45058e-09</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox7"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkLabel" id="label45"> + <property name="visible">True</property> + <property name="label" translatable="yes">Total Bytes:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="total-bytes-label"> + <property name="visible">True</property> + <property name="label" translatable="yes">0</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">7.45058e-09</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkNotebook" id="main-notebook"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="show_tabs">True</property> + <property name="show_border">True</property> + <property name="tab_pos">GTK_POS_TOP</property> + <property name="scrollable">False</property> + <property name="enable_popup">False</property> + + <child> + <widget class="GtkHPaned" id="profile-hpaned"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="position">0</property> + + <child> + <widget class="GtkVBox" id="vbox21"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkLabel" id="profile-status-label"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">3</property> + <property name="ypad">3</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow4"> + <property name="border_width">3</property> + <property name="visible">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkTreeView" id="profile-func-tree-view"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="headers_visible">True</property> + <property name="rules_hint">True</property> + <property name="reorderable">False</property> + <property name="enable_search">True</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="shrink">True</property> + <property name="resize">False</property> + </packing> + </child> + + <child> + <widget class="GtkVPaned" id="profile-vpaned"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="position">0</property> + + <child> + <widget class="GtkVBox" id="vbox19"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkLabel" id="label64"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Callers</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">3</property> + <property name="ypad">3</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow13"> + <property name="border_width">3</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkTreeView" id="profile-caller-tree-view"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="headers_visible">True</property> + <property name="rules_hint">True</property> + <property name="reorderable">False</property> + <property name="enable_search">True</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="shrink">True</property> + <property name="resize">False</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox20"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkLabel" id="label63"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Descendants</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">3</property> + <property name="ypad">3</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow12"> + <property name="border_width">3</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkTreeView" id="profile-descendants-tree-view"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="headers_visible">True</property> + <property name="rules_hint">True</property> + <property name="reorderable">False</property> + <property name="enable_search">True</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="shrink">True</property> + <property name="resize">True</property> + </packing> + </child> + </widget> + <packing> + <property name="shrink">True</property> + <property name="resize">True</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="label" translatable="yes">Profile</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + + <child> + <widget class="GtkVPaned" id="leaks-vpaned"> + <property name="visible">True</property> + <property name="position">0</property> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow5"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkCList" id="leak-block-clist"> + <property name="width_request">77</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="n_columns">3</property> + <property name="column_widths">84,80,162</property> + <property name="selection_mode">GTK_SELECTION_BROWSE</property> + <property name="show_titles">True</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="label" translatable="yes">Address</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="label" translatable="yes">Size</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="label" translatable="yes">Caller</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="shrink">False</property> + <property name="resize">False</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame1"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow1"> + <property name="visible">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkCList" id="leak-stack-clist"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="n_columns">3</property> + <property name="column_widths">80,108,80</property> + <property name="selection_mode">GTK_SELECTION_BROWSE</property> + <property name="show_titles">True</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkLabel" id="label12"> + <property name="visible">True</property> + <property name="label" translatable="yes">Function</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label13"> + <property name="visible">True</property> + <property name="label" translatable="yes">Line</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label14"> + <property name="visible">True</property> + <property name="label" translatable="yes">File</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label49"> + <property name="visible">True</property> + <property name="label" translatable="yes">Stack Trace</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="shrink">False</property> + <property name="resize">True</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="label" translatable="yes">Leaks</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child internal-child="appbar"> + <widget class="GnomeAppBar" id="appbar1"> + <property name="has_progress">False</property> + <property name="has_status">False</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> +</widget> + +<widget class="GnomeAbout" id="About"> + <property name="destroy_with_parent">False</property> + <property name="logo">memprof.png</property> + <property name="copyright" translatable="yes">Copyright 1999, 2000, 2001, Red Hat, Inc. +Copyright 2002, Kristian Rietveld</property> + <property name="comments" translatable="yes">Memory Profiling Tool</property> + <property name="authors">Owen Taylor <otaylor redhat com> +Kristian Rietveld <kris gtk org> </property> - <property name="comments" translatable="yes">Memory Profiling Tool</property> - </widget> - <widget class="GtkDialog" id="SkipAddDialog"> - <property name="visible">no</property> - <property name="title" translatable="yes">Adding Skip Function</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="modal">no</property> - <property name="allow_shrink">no</property> - <property name="allow_grow">no</property> - <property name="window-position">GTK_WIN_POS_NONE</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="dialog-vbox2"> - <property name="homogeneous">no</property> - <property name="spacing">8</property> - <property name="visible">yes</property> - - <child internal-child="action_area"> - <widget class="GtkHButtonBox" id="dialog-action_area2"> - <property name="layout_style">GTK_BUTTONBOX_END</property> - <property name="spacing">8</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkButton" id="button15"> - <property name="can_default">yes</property> - <property name="can_focus">yes</property> - <property name="visible">yes</property> - <property name="label">gtk-cancel</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - <property name="response_id">0</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="SkipAddDialog-add"> - <property name="can_default">yes</property> - <property name="has_default">yes</property> - <property name="can_focus">yes</property> - <property name="visible">yes</property> - <property name="label">gtk-add</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - <property name="response_id">1</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">yes</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox4"> - <property name="homogeneous">no</property> - <property name="spacing">8</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkHBox" id="hbox2"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkImage" id="pixmap1"> - <property name="stock">gtk-dialog-question</property> - <property name="icon_size">6</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label39"> - <property name="label" translatable="yes">Enter the name of a function to skip when computing profiles</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">yes</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="SkipAddDialog-entry"> - <property name="can_focus">yes</property> - <property name="has_focus">yes</property> - <property name="editable">yes</property> - <property name="text" translatable="yes"></property> - <property name="activates-default">yes</property> - <property name="max-length">0</property> - <property name="visibility">yes</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">4</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <widget class="GtkDialog" id="RunDialog"> - <property name="visible">no</property> - <property name="title" translatable="yes">Run Executable</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="modal">no</property> - <property name="allow_shrink">no</property> - <property name="allow_grow">no</property> - <property name="window-position">GTK_WIN_POS_NONE</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="dialog-vbox4"> - <property name="homogeneous">no</property> - <property name="spacing">8</property> - <property name="visible">yes</property> - - <child internal-child="action_area"> - <widget class="GtkHButtonBox" id="dialog-action_area4"> - <property name="layout_style">GTK_BUTTONBOX_END</property> - <property name="spacing">8</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkButton" id="button21"> - <property name="can_default">yes</property> - <property name="can_focus">yes</property> - <property name="visible">yes</property> - <property name="label">gtk-cancel</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - <property name="response_id">0</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="RunDialog-run"> - <property name="can_default">yes</property> - <property name="has_default">yes</property> - <property name="can_focus">yes</property> - <property name="label">gtk-execute</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - <property name="visible">yes</property> - <property name="response_id">1</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">yes</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox3"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkImage" id="pixmap2"> - <property name="stock">gtk-dialog-question</property> - <property name="icon_size">6</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label40"> - <property name="label" translatable="yes">Enter pathname to an executable</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">yes</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GnomeFileEntry" id="fileentry1"> - <property name="history_id">RunDialog</property> - <property name="modal">yes</property> - <property name="directory_entry">no</property> - <property name="visible">yes</property> - - <child internal-child="entry"> - <widget class="GtkEntry" id="RunDialog-entry"> - <property name="can_focus">yes</property> - <property name="has_focus">yes</property> - <property name="editable">yes</property> - <property name="text" translatable="yes"></property> - <property name="max-length">0</property> - <property name="activates-default">yes</property> - <property name="visibility">yes</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">4</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <widget class="GtkWindow" id="TreeWindow"> - <property name="visible">no</property> - <property name="title" translatable="yes">MemProf - Processes</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="modal">no</property> - <property name="allow_shrink">no</property> - <property name="allow_grow">yes</property> - <property name="window-position">GTK_WIN_POS_NONE</property> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow8"> - <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkCTree" id="TreeWindow-ctree"> - <property name="can_focus">yes</property> - <property name="column_widths">97,179,89</property> - <property name="selection_mode">GTK_SELECTION_BROWSE</property> - <property name="show_titles">yes</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - <property name="n_columns">3</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label50"> - <property name="label" translatable="yes">PID</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label51"> - <property name="label" translatable="yes">Command Line</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label52"> - <property name="label" translatable="yes">Status</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - </child> - - <child internal-child="hscrollbar"> - <widget class="GtkHScrollbar" id="convertwidget12"> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="visible">yes</property> - </widget> - </child> - - <child internal-child="vscrollbar"> - <widget class="GtkVScrollbar" id="convertwidget13"> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - </child> - </widget> - <widget class="GtkDialog" id="SkipRegexesAddDialog"> - <property name="visible">no</property> - <property name="title" translatable="yes">Adding Skip Regular Expression</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="modal">no</property> - <property name="allow_shrink">no</property> - <property name="allow_grow">no</property> - <property name="window-position">GTK_WIN_POS_NONE</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="vbox11"> - <property name="homogeneous">no</property> - <property name="spacing">8</property> - <property name="visible">yes</property> - - <child internal-child="action_area"> - <widget class="GtkHButtonBox" id="hbuttonbox1"> - <property name="layout_style">GTK_BUTTONBOX_END</property> - <property name="spacing">8</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkButton" id="button31"> - <property name="can_default">yes</property> - <property name="can_focus">yes</property> - <property name="visible">yes</property> - <property name="label">gtk-cancel</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - <property name="response_id">0</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="SkipRegexesAddDialog-add"> - <property name="can_default">yes</property> - <property name="has_default">yes</property> - <property name="can_focus">yes</property> - <property name="visible">yes</property> - <property name="label">gtk-add</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - <property name="response_id">1</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">yes</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox12"> - <property name="homogeneous">no</property> - <property name="spacing">8</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkHBox" id="hbox10"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkImage" id="pixmap3"> - <property name="stock">gtk-dialog-question</property> - <property name="icon_size">6</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label55"> - <property name="label" translatable="yes">Enter a regular expression of function names to skip when computing profiles</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">yes</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="SkipRegexesAddDialog-entry"> - <property name="can_focus">yes</property> - <property name="has_focus">yes</property> - <property name="editable">yes</property> - <property name="text" translatable="yes"></property> - <property name="activates-default">yes</property> - <property name="max-length">0</property> - <property name="visibility">yes</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">4</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <widget class="GtkWindow" id="Preferences"> - <property name="title" translatable="yes">Preferences</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="modal">no</property> - <property name="allow_shrink">no</property> - <property name="allow_grow">no</property> - <property name="window-position">GTK_WIN_POS_NONE</property> - <property name="visible">no</property> - - <child> - <widget class="GtkNotebook" id="notebook2"> - <property name="can_focus">yes</property> - <property name="show_tabs">yes</property> - <property name="show_border">yes</property> - <property name="tab_pos">GTK_POS_TOP</property> - <property name="scrollable">no</property> - <property name="tab_hborder">2</property> - <property name="tab_vborder">2</property> - <property name="enable-popup">no</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkVBox" id="vbox13"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkVBox" id="vbox14"> - <property name="border_width">8</property> - <property name="homogeneous">no</property> - <property name="spacing">4</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label56"> - <property name="label" translatable="yes">Functions to Skip:</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox11"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow10"> - <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkCList" id="skip-clist"> - <property name="can_focus">yes</property> - <property name="column_widths">80</property> - <property name="selection_mode">GTK_SELECTION_BROWSE</property> - <property name="show_titles">no</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - <property name="height-request">150</property> - <property name="n_columns">1</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label57"> - <property name="label" translatable="yes">label37</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - </child> - - <child internal-child="hscrollbar"> - <widget class="GtkHScrollbar" id="convertwidget14"> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="visible">yes</property> - </widget> - </child> - - <child internal-child="vscrollbar"> - <widget class="GtkVScrollbar" id="convertwidget15"> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox15"> - <property name="border_width">8</property> - <property name="homogeneous">no</property> - <property name="spacing">4</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkButton" id="skip-add-button"> - <property name="can_focus">yes</property> - <property name="label">gtk-add</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="skip-delete-button"> - <property name="can_focus">yes</property> - <property name="label">gtk-delete</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="skip-defaults-button"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Defaults</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox16"> - <property name="border_width">8</property> - <property name="homogeneous">no</property> - <property name="spacing">4</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label58"> - <property name="label" translatable="yes">Regular expressions to Skip:</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox12"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow11"> - <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkCList" id="skip-regexes-clist"> - <property name="can_focus">yes</property> - <property name="column_widths">80</property> - <property name="selection_mode">GTK_SELECTION_BROWSE</property> - <property name="show_titles">no</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - <property name="height-request">150</property> - <property name="n_columns">1</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label59"> - <property name="label" translatable="yes">label37</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - </child> - - <child internal-child="hscrollbar"> - <widget class="GtkHScrollbar" id="convertwidget16"> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="visible">yes</property> - </widget> - </child> - - <child internal-child="vscrollbar"> - <widget class="GtkVScrollbar" id="convertwidget17"> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox17"> - <property name="border_width">8</property> - <property name="homogeneous">no</property> - <property name="spacing">4</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkButton" id="skip-regexes-add-button"> - <property name="can_focus">yes</property> - <property name="label">gtk-add</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="skip-regexes-delete-button"> - <property name="can_focus">yes</property> - <property name="label">gtk-delete</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="skip-regexes-defaults-button"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Defaults</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label60"> - <property name="label" translatable="yes">Profile Options</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox18"> - <property name="border_width">5</property> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label61"> - <property name="label" translatable="yes">Command to run on double click in stack trace:</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">yes</property> - <property name="xalign">4.47035e-08</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="stack-command-entry"> - <property name="can_focus">yes</property> - <property name="editable">yes</property> - <property name="text" translatable="yes"></property> - <property name="max-length">0</property> - <property name="visibility">yes</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label62"> - <property name="label" translatable="yes">Leak Detection Options</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - </widget> - </child> - </widget> + <property name="translator_credits" translatable="yes">translator_credits</property> +</widget> + +<widget class="GtkDialog" id="SkipAddDialog"> + <property name="title" translatable="yes">Adding Skip Function</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="has_separator">True</property> + + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">8</property> + + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area2"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + + <child> + <widget class="GtkButton" id="button15"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-cancel</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="response_id">0</property> + </widget> + </child> + + <child> + <widget class="GtkButton" id="SkipAddDialog-add"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-add</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="response_id">1</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox4"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">8</property> + + <child> + <widget class="GtkHBox" id="hbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkImage" id="pixmap1"> + <property name="visible">True</property> + <property name="stock">gtk-dialog-question</property> + <property name="icon_size">6</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label39"> + <property name="visible">True</property> + <property name="label" translatable="yes">Enter the name of a function to skip when computing profiles</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="SkipAddDialog-entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="has_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> +</widget> + +<widget class="GtkDialog" id="RunDialog"> + <property name="title" translatable="yes">Run Executable</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="has_separator">True</property> + + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox4"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">8</property> + + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area4"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + + <child> + <widget class="GtkButton" id="button21"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-cancel</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="response_id">0</property> + </widget> + </child> + + <child> + <widget class="GtkButton" id="RunDialog-run"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-execute</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="response_id">1</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox3"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkImage" id="pixmap2"> + <property name="visible">True</property> + <property name="stock">gtk-dialog-question</property> + <property name="icon_size">6</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label40"> + <property name="visible">True</property> + <property name="label" translatable="yes">Enter pathname to an executable</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GnomeFileEntry" id="fileentry1"> + <property name="visible">True</property> + <property name="history_id">RunDialog</property> + <property name="max_saved">10</property> + <property name="directory_entry">False</property> + <property name="modal">True</property> + + <child internal-child="entry"> + <widget class="GtkEntry" id="RunDialog-entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="has_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> +</widget> + +<widget class="GtkWindow" id="TreeWindow"> + <property name="title" translatable="yes">MemProf - Processes</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow8"> + <property name="visible">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkCTree" id="TreeWindow-ctree"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="n_columns">3</property> + <property name="column_widths">97,143,89</property> + <property name="selection_mode">GTK_SELECTION_BROWSE</property> + <property name="show_titles">True</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkLabel" id="label50"> + <property name="visible">True</property> + <property name="label" translatable="yes">PID</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label51"> + <property name="visible">True</property> + <property name="label" translatable="yes">Command Line</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label52"> + <property name="visible">True</property> + <property name="label" translatable="yes">Status</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + </widget> + </child> +</widget> + +<widget class="GtkDialog" id="SkipRegexesAddDialog"> + <property name="title" translatable="yes">Adding Skip Regular Expression</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="has_separator">True</property> + + <child internal-child="vbox"> + <widget class="GtkVBox" id="vbox11"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">8</property> + + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="hbuttonbox1"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + + <child> + <widget class="GtkButton" id="button31"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-cancel</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="response_id">0</property> + </widget> + </child> + + <child> + <widget class="GtkButton" id="SkipRegexesAddDialog-add"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-add</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="response_id">1</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox12"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">8</property> + + <child> + <widget class="GtkHBox" id="hbox10"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkImage" id="pixmap3"> + <property name="visible">True</property> + <property name="stock">gtk-dialog-question</property> + <property name="icon_size">6</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label55"> + <property name="visible">True</property> + <property name="label" translatable="yes">Enter a regular expression of function names to skip when computing profiles</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="SkipRegexesAddDialog-entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="has_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> +</widget> + +<widget class="GtkWindow" id="Preferences"> + <property name="title" translatable="yes">Preferences</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + + <child> + <widget class="GtkNotebook" id="notebook2"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="show_tabs">True</property> + <property name="show_border">True</property> + <property name="tab_pos">GTK_POS_TOP</property> + <property name="scrollable">False</property> + <property name="enable_popup">False</property> + + <child> + <widget class="GtkVBox" id="vbox13"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkVBox" id="vbox14"> + <property name="border_width">8</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">4</property> + + <child> + <widget class="GtkLabel" id="label56"> + <property name="visible">True</property> + <property name="label" translatable="yes">Functions to Skip:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox11"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow10"> + <property name="visible">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkCList" id="skip-clist"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="n_columns">1</property> + <property name="column_widths">80</property> + <property name="selection_mode">GTK_SELECTION_BROWSE</property> + <property name="show_titles">False</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkLabel" id="label57"> + <property name="visible">True</property> + <property name="label" translatable="yes">label37</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox15"> + <property name="border_width">8</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">4</property> + + <child> + <widget class="GtkButton" id="skip-add-button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-add</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="skip-delete-button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-delete</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="skip-defaults-button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Defaults</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox16"> + <property name="border_width">8</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">4</property> + + <child> + <widget class="GtkLabel" id="label58"> + <property name="visible">True</property> + <property name="label" translatable="yes">Regular expressions to Skip:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox12"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow11"> + <property name="visible">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkCList" id="skip-regexes-clist"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="n_columns">1</property> + <property name="column_widths">80</property> + <property name="selection_mode">GTK_SELECTION_BROWSE</property> + <property name="show_titles">False</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkLabel" id="label59"> + <property name="visible">True</property> + <property name="label" translatable="yes">label37</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox17"> + <property name="border_width">8</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">4</property> + + <child> + <widget class="GtkButton" id="skip-regexes-add-button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-add</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="skip-regexes-delete-button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-delete</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="skip-regexes-defaults-button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Defaults</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label60"> + <property name="visible">True</property> + <property name="label" translatable="yes">Profile Options</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox18"> + <property name="border_width">5</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkLabel" id="label61"> + <property name="visible">True</property> + <property name="label" translatable="yes">Command to run on double click in stack trace:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">4.47035e-08</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="stack-command-entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label62"> + <property name="visible">True</property> + <property name="label" translatable="yes">Leak Detection Options</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + </widget> + </child> +</widget> + </glade-interface> Index: profile.c =================================================================== RCS file: /cvs/gnome/memprof/profile.c,v retrieving revision 1.10 diff -u -p -u -r1.10 profile.c --- profile.c 17 Aug 2002 18:59:57 -0000 1.10 +++ profile.c 3 Jan 2003 00:57:00 -0000 @@ -1,8 +1,5 @@ -/* -*- mode: C; c-file-style: "linux" -*- */ - /* MemProf -- memory profiler and leak detector - * Copyright 1999, 2000, 2001, Red Hat, Inc. - * Copyright 2002, Kristian Rietveld + * Copyright 2002, 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 @@ -18,223 +15,501 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*====*/ -#include <errno.h> -#include <stdlib.h> -#include <string.h> -#include <libgnome/libgnome.h> /* For i18n */ +/*=====*/ #include "profile.h" +#include <glib.h> static GList * -add_bytes_to_ref (GList *reflist, ProfileFunc *function, guint bytes) +block_create_stack_list (Block *block, MPProcess *process, GHashTable *skip_hash) { - ProfileFuncRef *ref = NULL; /* Quiet GCC */ - GList *tmp_list; - - tmp_list = reflist; - while (tmp_list) + StackElement *element; + GList *stack = NULL; + + for (element = block->stack; !STACK_ELEMENT_IS_ROOT (element); element = element->parent) { - ref = tmp_list->data; - if (ref->function == function) - break; - - tmp_list = tmp_list->next; + Symbol *symbol = process_locate_symbol (process, (guint)element->address); + + if (symbol && symbol->name && g_hash_table_lookup (skip_hash, symbol->name)) + continue; + + stack = g_list_prepend (stack, element); } + + return stack; +} - if (!tmp_list) +static void +profile_add_stack_trace (Profile *profile, GList *stack, guint size) +{ + GList *list; + GPtrArray *roots = profile->roots; + ProfileNode *parent = NULL; + GHashTable *seen_symbols = g_hash_table_new (g_direct_hash, g_direct_equal); + + for (list = stack; list != NULL; list = list->next) { - ref = g_new (ProfileFuncRef, 1); - ref->function = function; - ref->bytes = 0; - reflist = g_list_prepend (reflist, ref); + StackElement *element = list->data; + ProfileNode *match = NULL; + Symbol *symbol = process_locate_symbol (profile->process, (guint)element->address); + int i; + + for (i = 0; i < roots->len; ++i) + { + ProfileNode *node = roots->pdata[i]; + + if (node->symbol == symbol) + match = node; + } + + if (!match) + { + ProfileNode *next_node; + + match = g_new (ProfileNode, 1); + + match->symbol = symbol; + match->total = 0; + match->self = 0; + + if (g_hash_table_lookup (seen_symbols, symbol)) + match->toplevel = FALSE; + else + match->toplevel = TRUE; + + next_node = g_hash_table_lookup (profile->nodes_by_symbol, symbol); + if (next_node) + match->next = next_node; + else + match->next = NULL; + g_hash_table_insert (profile->nodes_by_symbol, symbol, match); + + match->children = g_ptr_array_new (); + match->parent = parent; + + g_ptr_array_add (roots, match); + } + + g_hash_table_insert (seen_symbols, symbol, GINT_TO_POINTER (1)); + + match->total += size; + if (!list->next) + match->self += size; + + parent = match; + roots = match->children; } + + g_hash_table_destroy (seen_symbols); +} - ref->bytes += bytes; - - return reflist; +static void +profile_build_tree (Profile *profile, GList *blocks, GSList *skip_funcs) +{ + GHashTable *skip_hash = g_hash_table_new (g_str_hash, g_str_equal); + GList *list; + GSList *slist; + + for (slist = skip_funcs; slist != NULL; slist = slist->next) + g_hash_table_insert (skip_hash, slist->data, ""); + + for (list = blocks; list != NULL; list = list->next) + { + Block *block = list->data; + GList *stack = block_create_stack_list (block, profile->process, skip_hash); + + profile_add_stack_trace (profile, stack, block->size); + + g_list_free (stack); + } + + g_hash_table_destroy (skip_hash); } static void -add_block_to_functions (Block *block, gpointer data) +add_function (gpointer key, gpointer value, gpointer data) { - ProfileFunc *last_function = NULL; - StackElement *stack; + ProfileFunc *func; + ProfileNode *node; + Profile *profile = data; + + node = value; + + func = g_new (ProfileFunc, 1); + func->node = node; + func->total = 0; + func->self = 0; + + while (node) + { + func->self += node->self; + if (node->toplevel) + func->total += node->total; + + node = node->next; + } + + g_ptr_array_add (profile->functions, func); +} - Profile *profile = data; - gboolean first = TRUE; +static void +add_block_to_list (Block *block, gpointer data) +{ + GList **blocks = data; + + *blocks = g_list_prepend (*blocks, block); +} - for (stack = block->stack; !STACK_ELEMENT_IS_ROOT (stack); stack = stack->parent) +Profile * +profile_create (MPProcess *process, GSList *skip_funcs) +{ + Profile *profile; + GList *blocks = NULL; + GList *list; + + process_block_foreach (process, add_block_to_list, &blocks); + + profile = g_new (Profile, 1); + profile->roots = g_ptr_array_new (); + profile->functions = g_ptr_array_new (); + profile->n_bytes = 0; + profile->process = process; + profile->nodes_by_symbol = g_hash_table_new (g_direct_hash, g_direct_equal); + + profile_build_tree (profile, blocks, skip_funcs); + + for (list = blocks; list != NULL; list = list->next) { - Symbol *symbol; - ProfileFunc *function; - - symbol = process_locate_symbol (profile->process, (guint)stack->address); - if (symbol) - { - if (g_hash_table_lookup (profile->skip_hash, symbol->name)) - continue; - - function = g_hash_table_lookup (profile->function_hash, symbol); - if (!function) - { - function = g_new0 (ProfileFunc, 1); - function->symbol = symbol; - g_hash_table_insert (profile->function_hash, symbol, function); - } + Block *block = list->data; + + profile->n_bytes += block->size; + } + + g_hash_table_foreach (profile->nodes_by_symbol, add_function, profile); + + g_list_free (blocks); + return profile; +} - if (first) - { - function->self += block->size; - first = FALSE; - } +static void +profile_node_free (ProfileNode *node) +{ + int i; + + for (i = 0; i < node->children->len; ++i) + profile_node_free (node->children->pdata[i]); + g_ptr_array_free (node->children, TRUE); + g_free (node); +} - function->total += block->size; +void +profile_free (Profile *profile) +{ + int i; + + for (i = 0; i < profile->roots->len; ++i) + profile_node_free (profile->roots->pdata[i]); + g_ptr_array_free (profile->roots, TRUE); + + for (i = 0; i < profile->functions->len; ++i) + g_free (profile->functions->pdata[i]); + g_ptr_array_free (profile->functions, TRUE); + + g_hash_table_destroy (profile->nodes_by_symbol); + g_free (profile); +} - if (last_function) +static void +node_list_leaves (ProfileNode *node, GList **leaves) +{ + int i; + + if (node->self > 0) + *leaves = g_list_prepend (*leaves, node); + + for (i = 0; i < node->children->len; ++i) + node_list_leaves (node->children->pdata[i], leaves); +} + +static void +add_trace_to_tree (GPtrArray *roots, GList *trace, guint size) +{ + GList *list; + GList *nodes_to_unmark = NULL; + GList *nodes_to_unmark_recursive = NULL; + ProfileDescendantTreeNode *parent = NULL; + + GHashTable *seen_symbols = g_hash_table_new (g_direct_hash, g_direct_equal); + + for (list = trace; list != NULL; list = list->next) + { + int i; + ProfileNode *node = list->data; + ProfileDescendantTreeNode *match = NULL; + + for (i = 0; i < roots->len; ++i) + { + ProfileDescendantTreeNode *tree_node = roots->pdata[i]; + + if (tree_node->symbol == node->symbol) + match = tree_node; + } + + if (!match) + { + ProfileDescendantTreeNode *seen_tree_node; + + seen_tree_node = g_hash_table_lookup (seen_symbols, node->symbol); + + if (seen_tree_node) { - function->children = - add_bytes_to_ref (function->children, last_function, block->size); - last_function->inherited = - add_bytes_to_ref (last_function->inherited, function, block->size); + ProfileDescendantTreeNode *node; + + g_assert (parent); + + for (node = parent; node != seen_tree_node->parent; node = node->parent) + { + node->non_recursion -= size; + --node->marked_non_recursive; + } + + match = seen_tree_node; + + g_hash_table_destroy (seen_symbols); + seen_symbols = g_hash_table_new (g_direct_hash, g_direct_equal); + + for (node = match; node != NULL; node = node->parent) + g_hash_table_insert (seen_symbols, node->symbol, node); + } - - last_function = function; } + + if (!match) + { + match = g_new (ProfileDescendantTreeNode, 1); + + match->symbol = node->symbol; + match->non_recursion = 0; + match->total = 0; + match->self = 0; + match->children = g_ptr_array_new (); + match->marked_non_recursive = 0; + match->marked_total = FALSE; + match->parent = parent; + + g_ptr_array_add (roots, match); + } + + if (!match->marked_non_recursive) + { + nodes_to_unmark = g_list_prepend (nodes_to_unmark, match); + match->non_recursion += size; + ++match->marked_non_recursive; + } + + if (!match->marked_total) + { + nodes_to_unmark_recursive = g_list_prepend ( + nodes_to_unmark_recursive, match); + + match->total += size; + match->marked_total = TRUE; + } + + if (!list->next) + match->self += size; + + g_hash_table_insert (seen_symbols, node->symbol, match); + + roots = match->children; + parent = match; } + + g_hash_table_destroy (seen_symbols); + + for (list = nodes_to_unmark; list != NULL; list = list->next) + { + ProfileDescendantTreeNode *tree_node = list->data; + + tree_node->marked_non_recursive = 0; + } + + for (list = nodes_to_unmark_recursive; list != NULL; list = list->next) + { + ProfileDescendantTreeNode *tree_node = list->data; + + tree_node->marked_total = FALSE; + } + + g_list_free (nodes_to_unmark); } static void -add_function_to_array (gpointer key, gpointer value, gpointer data) +add_leaf_to_tree (ProfileDescendantTree *tree, ProfileNode *leaf, ProfileNode *top) { - GArray *functions = data; - ProfileFunc *function = value; - - g_array_append_vals (functions, &function, 1); + ProfileNode *node; + GList *trace = NULL; + + for (node = leaf; node != top->parent; node = node->parent) + trace = g_list_prepend (trace, node); + + add_trace_to_tree (tree->roots, trace, leaf->self); + + g_list_free (trace); } -static gint -compare_function (const void *a, const void *b) +ProfileDescendantTree * +profile_func_create_descendant_tree (ProfileFunc *func) { - ProfileFunc * const *f1 = a; - ProfileFunc * const *f2 = b; - - return strcmp ((*f1)->symbol->name, (*f2)->symbol->name); + ProfileDescendantTree *tree = g_new (ProfileDescendantTree, 1); + ProfileNode *node; + + tree->roots = g_ptr_array_new (); + + for (node = func->node; node != NULL; node = node->next) + if (node->toplevel) + { + GList *leaves = NULL; + GList *list; + + node_list_leaves (node, &leaves); + + for (list = leaves; list != NULL; list = list->next) + add_leaf_to_tree (tree, list->data, node); + + g_list_free (leaves); + } + + return tree; } -Profile * -profile_create (MPProcess *process, - GSList *skip_funcs) +static void +profile_descendant_tree_node_free (ProfileDescendantTreeNode *node) { - GArray *functions; - Profile *profile; - GSList *tmp_list; - - profile = g_new (Profile, 1); - profile->process = process; - - profile->skip_hash = g_hash_table_new (g_str_hash, g_str_equal); - for (tmp_list = skip_funcs; tmp_list != NULL; tmp_list = tmp_list->next) - g_hash_table_insert (profile->skip_hash, (gchar *)tmp_list->data, ""); - - /* Go through all blocks, and add up memory - */ - profile->function_hash = g_hash_table_new (g_direct_hash, NULL); - process_block_foreach (process, add_block_to_functions, profile); - - /* Make a sorted list of functions - */ - functions = g_array_new (FALSE, FALSE, sizeof(ProfileFunc *)); - g_hash_table_foreach (profile->function_hash, add_function_to_array, functions); - - qsort (functions->data, functions->len, sizeof(ProfileFunc *), compare_function); - - profile->n_functions = functions->len; - profile->functions = (ProfileFunc **)functions->data; - - g_hash_table_destroy (profile->function_hash); - profile->function_hash = NULL; - g_hash_table_destroy (profile->skip_hash); - profile->skip_hash = NULL; - g_array_free (functions, FALSE); - - return profile; + int i; + + for (i = 0; i < node->children->len; ++i) + { + ProfileDescendantTreeNode *child = node->children->pdata[i]; + + profile_descendant_tree_node_free (child); + } + + g_ptr_array_free (node->children, TRUE); + g_free (node); } -static void -print_refs (FILE *out, GList *reflist) +void +profile_descendant_tree_free (ProfileDescendantTree *descendant_tree) { - ProfileFuncRef *ref; - GList *tmp_list; - - tmp_list = reflist; - while (tmp_list) + int i; + + for (i = 0; i < descendant_tree->roots->len; ++i) { - ref = tmp_list->data; - fprintf (out, " %s: %u\n", ref->function->symbol->name, ref->bytes); - - tmp_list = tmp_list->next; + ProfileDescendantTreeNode *node = descendant_tree->roots->pdata[i]; + + profile_descendant_tree_node_free (node); } + g_ptr_array_free (descendant_tree->roots, TRUE); + g_free (descendant_tree); } -static gint -refs_compare (const void *a, const void *b) +GPtrArray * +profile_func_create_caller_list (ProfileFunc *func) { - const ProfileFuncRef *refa = a; - const ProfileFuncRef *refb = b; - - return strcmp (refa->function->symbol->name, refb->function->symbol->name); + GPtrArray *result = g_ptr_array_new (); + GHashTable *callers_by_symbol = g_hash_table_new (g_direct_hash, g_direct_equal); + GHashTable *marked_callers = g_hash_table_new (g_direct_hash, g_direct_equal); + ProfileFunc *spontaneous = NULL; + ProfileNode *node; + + for (node = func->node; node != NULL; node = node->next) + { + if (node->parent) + { + if (!g_hash_table_lookup (callers_by_symbol, node->parent->symbol)) + { + ProfileFunc *caller = g_new (ProfileFunc, 1); + + caller->total = 0; + caller->self = 0; + caller->node = node->parent; + + g_hash_table_insert (callers_by_symbol, node->parent->symbol, caller); + g_ptr_array_add (result, caller); + } + } + else + { + if (!spontaneous) + { + spontaneous = g_new (ProfileFunc, 1); + spontaneous->total = 0; + spontaneous->self = 0; + spontaneous->node = NULL; + g_ptr_array_add (result, spontaneous); + } + } + } + + for (node = func->node; node != NULL; node = node->next) + { + ProfileNode *top_caller_node; + ProfileNode *top_callee_node; + ProfileFunc *caller; + ProfileNode *n; + + if (!node->parent) + { + g_assert (spontaneous); + caller = spontaneous; + } + else + caller = g_hash_table_lookup (callers_by_symbol, node->parent->symbol); + + /* find topmost node/parent pair identical to this node/parent */ + top_caller_node = node->parent; + top_callee_node = node; + for (n = node->parent; n && n->parent != NULL; n = n->parent) + { + if (n->symbol == node->symbol && + n->parent->symbol == top_caller_node->symbol) + { + top_caller_node = n->parent; + top_callee_node = n; + } + } + if (!g_hash_table_lookup (marked_callers, top_caller_node)) + { + caller->total += top_callee_node->total; + + g_hash_table_insert (marked_callers, top_caller_node, GINT_TO_POINTER (1)); + } + + if (node->self > 0) + caller->self += node->self; + } + + g_hash_table_destroy (marked_callers); + g_hash_table_destroy (callers_by_symbol); + + return result; } void -profile_write (Profile *profile, gchar *outfile) +profile_caller_list_free (GPtrArray *caller_list) { - int i; - FILE *out; - - /* Print results - */ - - out = fopen (outfile, "w"); - if (!out) - { - show_error (NULL, ERROR_MODAL, _("Cannot open output file: %s\n"), - g_strerror (errno)); - return; - } - - for (i=0; i<profile->n_functions; i++) - { - fprintf (out, "%s\n", profile->functions[i]->symbol->name); - fprintf (out, " children:\n"); - profile->functions[i]->children = g_list_sort (profile->functions[i]->children, refs_compare); - print_refs (out, profile->functions[i]->children); - fprintf (out, " total: %d\n", profile->functions[i]->total); - fprintf (out, " self: %d\n", profile->functions[i]->self); - fprintf (out, " inherited:\n"); - profile->functions[i]->inherited = g_list_sort (profile->functions[i]->inherited, refs_compare); - print_refs (out, profile->functions[i]->inherited); - - fprintf (out, "\n"); - } - - fclose (out); + int i; + + for (i = 0; i < caller_list->len; ++i) + g_free (caller_list->pdata[i]); + + g_ptr_array_free (caller_list, TRUE); } void -profile_free (Profile *profile) +profile_write (Profile *profile, const gchar *outfile) { - int i; - - for (i=0; i<profile->n_functions; i++) - { - g_list_foreach (profile->functions[i]->children, (GFunc)g_free, NULL); - g_list_free (profile->functions[i]->children); - g_list_foreach (profile->functions[i]->inherited, (GFunc)g_free, NULL); - g_list_free (profile->functions[i]->inherited); - g_free (profile->functions[i]); - } - - g_free (profile); + /* FIXME */ } Index: profile.h =================================================================== RCS file: /cvs/gnome/memprof/profile.h,v retrieving revision 1.4 diff -u -p -u -r1.4 profile.h --- profile.h 15 Jul 2002 23:39:00 -0000 1.4 +++ profile.h 3 Jan 2003 00:57:00 -0000 @@ -1,8 +1,5 @@ -/* -*- mode: C; c-file-style: "linux" -*- */ - /* MemProf -- memory profiler and leak detector - * Copyright 1999, 2000, 2001, Red Hat, Inc. - * Copyright 2002, Kristian Rietveld + * Copyright 2002, Soeren Sandmann (sandmann daimi au dk) * * 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 @@ -22,31 +19,67 @@ #include "memprof.h" #include "process.h" +#include <glib.h> -typedef struct { - Symbol *symbol; - guint self; - guint total; - GList *inherited; - GList *children; -} ProfileFunc; - -typedef struct { - ProfileFunc *function; - guint bytes; -} ProfileFuncRef; - -typedef struct { - gint n_functions; - ProfileFunc **functions; - - /* Private */ - MPProcess *process; - GHashTable *function_hash; - GHashTable *skip_hash; -} Profile; - -Profile *profile_create (MPProcess *process, GSList *skip_funcs); -void profile_write (Profile *profile, - gchar *outfile); -void profile_free (Profile *profile); +typedef struct ProfileNode ProfileNode; +typedef struct Profile Profile; +typedef struct ProfileFunc ProfileFunc; +typedef struct ProfileDescendantTree ProfileDescendantTree; +typedef struct ProfileDescendantTreeNode ProfileDescendantTreeNode; + +struct ProfileNode { + Symbol * symbol; + + guint total; + guint self; + gboolean toplevel; + + ProfileNode * next; + + GPtrArray * children; + ProfileNode * parent; +}; + +struct ProfileDescendantTreeNode +{ + Symbol * symbol; + + guint self; + guint non_recursion; + guint total; + + GPtrArray * children; + ProfileDescendantTreeNode *parent; + + gint marked_non_recursive; + gboolean marked_total; +}; + +struct ProfileDescendantTree { + GPtrArray * roots; +}; + +struct ProfileFunc { + guint total; /* sum of all toplevel totals */ + guint self; /* sum of all selfs */ + + ProfileNode *node; +}; + +struct Profile { + GPtrArray * roots; /* root nodes of call tree */ + GPtrArray * functions; + guint n_bytes; /* total number of bytes profiled */ + + /* private */ + MPProcess * process; + GHashTable *nodes_by_symbol; +}; + +Profile * profile_create (MPProcess *process, + GSList *skip_funcs); +void profile_free (Profile *profile); +ProfileDescendantTree *profile_func_create_descendant_tree (ProfileFunc *func); +void profile_descendant_tree_free (ProfileDescendantTree *descendant_tree); +GPtrArray * profile_func_create_caller_list (ProfileFunc *func); +void profile_caller_list_free (GPtrArray *caller_list);
Attachment:
leak.png
Description: The new leak icon