From 98308836afa4b0a690373716e3de3823bc399150 Mon Sep 17 00:00:00 2001 From: Soeren Sandmann Date: Sat, 14 Jan 2006 23:26:34 +0000 Subject: [PATCH] Only build GUI when the necessary dependencies are found. Sat Jan 14 18:24:43 2006 Soeren Sandmann * configure.ac, Makefile.am: Only build GUI when the necessary dependencies are found. * sysprof.c (compute_text_width): Remove unused variable * profile.c (build_object_list): Follow next instead of siblings. --- ChangeLog | 9 +++++++++ Makefile.am | 9 ++++++++- TODO | 14 ++++++++++---- configure.ac | 9 +++++---- profile.c | 4 +++- profile.h | 5 ++++- sysprof.c | 1 - 7 files changed, 39 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 09caba78..f1ff7a8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Sat Jan 14 18:24:43 2006 Soeren Sandmann + + * configure.ac, Makefile.am: Only build GUI when the necessary + dependencies are found. + + * sysprof.c (compute_text_width): Remove unused variable + + * profile.c (build_object_list): Follow next instead of siblings. + Fri Jan 13 23:11:33 2006 Søren Sandmann * TODO: updates diff --git a/Makefile.am b/Makefile.am index 943699e1..43e957f5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,11 @@ SUBDIRS = $(MODULE_SUBDIR) DIST_SUBDIRS = module -bin_PROGRAMS = sysprof sysprof-text +bin_PROGRAMS = sysprof-text + +if BUILD_GUI +bin_PROGRAMS += sysprof +endif SYSPROF_CORE = \ binfile.h \ @@ -23,6 +27,7 @@ SYSPROF_CORE = \ # # GUI version # +if BUILD_GUI sysprof_SOURCES = \ $(SYSPROF_CORE) \ @@ -37,6 +42,8 @@ sysprof_CPPFLAGS = \ sysprof_LDADD = $(GUI_DEP_LIBS) +endif + udevdir = $(sysconfdir)/udev/rules.d dist_udev_DATA = 60-sysprof.rules diff --git a/TODO b/TODO index d7f56ae1..2bb3fd39 100644 --- a/TODO +++ b/TODO @@ -20,6 +20,11 @@ Before 1.0.2: Before 1.2: +* Consider deleting cmdline hack in process.c and replace with something at + the symbol resolution level. + +* Fix (deleted) problem. + * Add spew infrastructure to make remote debugging easier. * Make it compile and work on x86-64 @@ -30,8 +35,6 @@ Before 1.2: the alert. This causes the start button to appear prelighted. Probably just another gtk+ bug. -* Don't build the GUI if gtk+ is not installed - * Find out if the first sort order of a GtkTreeView column can be changed programmatically. @@ -136,7 +139,8 @@ Before 1.2: together. well, they could be stitched together in the kernel. Already done: we now take a stacktrace of the user space process when the interrupt happens in kernel mode. (Unfortunately, this - causes lockups on many kernels). + causes lockups on many kernels (though I haven't seen that for + a while)). We don't take any stacktraces of the kernel though. Things that need to be @@ -206,7 +210,7 @@ http://www.linuxbase.org/spec/booksets/LSB-Embedded/LSB-Embedded/ehframe.html - Charge 'self' properly to processes that don't get any stack trace at all (probably we get that for free with stackstash reorganisation) -- Add ability to show more than one function at a time. Algorithm: +- Consider adding ability to show more than one function at a time. Algorithm: Find all relevant nodes; For each relevant node best_so_far = relevant node @@ -421,6 +425,8 @@ Later: DONE: +* Don't build the GUI if gtk+ is not installed + * Find out why we sometimes get reports of time spent by [pid 0]. * - Run a.out generated normally with gcc. diff --git a/configure.ac b/configure.ac index 9962d0fa..6523b08b 100644 --- a/configure.ac +++ b/configure.ac @@ -86,11 +86,12 @@ fi core_dep="glib-2.0" gui_dep="gtk+-2.0 > 2.6.0 gdk-pixbuf-2.0 pangoft2 libglade-2.0" -PKG_CHECK_MODULES(CORE_DEP, $core_dep, [], - AC_MSG_ERROR([sysprof dependencies not satisfied])) +PKG_CHECK_MODULES(CORE_DEP, $core_dep, [], AC_MSG_ERROR([sysprof dependencies not satisfied])) -PKG_CHECK_MODULES(GUI_DEP, $gui_dep, [], - AC_MSG_ERROR([sysprof dependencies not satisfied])) +build_gui=yes +PKG_CHECK_MODULES(GUI_DEP, $gui_dep, [], build_gui=no) + +AM_CONDITIONAL([BUILD_GUI], [test "$build_gui" = yes]) # libiberty and libbfd diff --git a/profile.c b/profile.c index 935c7cd8..79ac4cec 100644 --- a/profile.c +++ b/profile.c @@ -331,6 +331,8 @@ profile_create_descendants (Profile *profile, while (node) { + g_print ("node: %s (%d)\n", node->address, node->size); + if (node->toplevel) stack_node_foreach_trace (node, add_trace_to_tree, &tree); @@ -473,7 +475,7 @@ build_object_list (StackNode *node, gpointer data) obj->total = compute_total (node); obj->self = 0; - for (n = node; n != NULL; n = n->siblings) + for (n = node; n != NULL; n = n->next) obj->self += n->size; *objects = g_list_prepend (*objects, obj); diff --git a/profile.h b/profile.h index d20e7352..5a9a3f55 100644 --- a/profile.h +++ b/profile.h @@ -30,7 +30,10 @@ typedef struct ProfileCaller ProfileCaller; struct ProfileObject { - char * name; /* identifies this object uniquely */ + char * name; /* identifies this object uniquely + * (the pointer itself, not the + * string) + */ guint total; /* sum of all toplevel totals */ guint self; /* sum of all selfs */ diff --git a/sysprof.c b/sysprof.c index 345afb19..58644819 100644 --- a/sysprof.c +++ b/sysprof.c @@ -1062,7 +1062,6 @@ compute_text_width (GtkTreeView *view, { int *width = data; char *name; - int indent; get_data (view, iter, &name, NULL, NULL);