[metacity] util: don't generate a backtrace on every G_LOG



commit a101a3b3039c0634d095f7ee732aea823a6b405e
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Apr 5 00:14:36 2012 -0400

    util: don't generate a backtrace on every G_LOG
    
    We may not show the backtrace, but it's prohibitly expensive to generate,
    so don't. If someone wants a backtrace they can use the appropriate G_DEBUG
    environment variable plus GDB.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=676855

 configure.ac       |    3 ---
 src/core/display.c |    1 -
 src/core/main.c    |    1 -
 src/core/util.c    |   33 ---------------------------------
 src/include/util.h |    2 --
 5 files changed, 0 insertions(+), 40 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index a7bf001..68cd93d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -129,9 +129,6 @@ AC_ARG_ENABLE(render,
                  [disable metacity's use of the RENDER extension]),,
   enable_render=auto)
 
-## try definining HAVE_BACKTRACE
-AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
-
 AM_GLIB_GNU_GETTEXT
 
 ## here we get the flags we'll actually use
diff --git a/src/core/display.c b/src/core/display.c
index 1e552bb..9fd9d5e 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -5246,7 +5246,6 @@ timestamp_too_old (MetaDisplay *display,
       meta_warning ("Got a request to focus %s with a timestamp of 0.  This "
                     "shouldn't happen!\n",
                     window ? window->desc : "the no_focus_window");
-      meta_print_backtrace ();
       *timestamp = meta_display_get_current_time_roundtrip (display);
       return FALSE;
     }
diff --git a/src/core/main.c b/src/core/main.c
index 82c00d3..5d60094 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -104,7 +104,6 @@ log_handler (const gchar   *log_domain,
              gpointer       user_data)
 {
   meta_warning ("Log level %d: %s\n", log_level, message);
-  meta_print_backtrace ();
 }
 
 /**
diff --git a/src/core/util.c b/src/core/util.c
index 363f615..0e94865 100644
--- a/src/core/util.c
+++ b/src/core/util.c
@@ -35,37 +35,6 @@
 #include <X11/Xlib.h>   /* must explicitly be included for Solaris; #326746 */
 #include <X11/Xutil.h>  /* Just for the definition of the various gravities */
 
-#ifdef HAVE_BACKTRACE
-#include <execinfo.h>
-void
-meta_print_backtrace (void)
-{
-  void *bt[500];
-  int bt_size;
-  int i;
-  char **syms;
-
-  bt_size = backtrace (bt, 500);
-
-  syms = backtrace_symbols (bt, bt_size);
-
-  i = 0;
-  while (i < bt_size)
-    {
-      meta_verbose ("  %s\n", syms[i]);
-      ++i;
-    }
-
-  free (syms);
-}
-#else
-void
-meta_print_backtrace (void)
-{
-  meta_verbose ("Not compiled with backtrace support\n");
-}
-#endif
-
 static gboolean is_verbose = FALSE;
 static gboolean is_debugging = FALSE;
 static gboolean replace_current = FALSE;
@@ -392,8 +361,6 @@ meta_bug (const char *format, ...)
 
   g_free (str);
 
-  meta_print_backtrace ();
-
   /* stop us in a debugger */
   abort ();
 }
diff --git a/src/include/util.h b/src/include/util.h
index dbbc74c..9ae043f 100644
--- a/src/include/util.h
+++ b/src/include/util.h
@@ -84,8 +84,6 @@ gint  meta_unsigned_long_equal (gconstpointer v1,
                                 gconstpointer v2);
 guint meta_unsigned_long_hash  (gconstpointer v);
 
-void meta_print_backtrace (void);
-
 const char* meta_gravity_to_string (int gravity);
 
 #include <libintl.h>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]