[mutter] util: Don't generate a backtrace on every G_LOG



commit f143fe3710685fe06e59d9f34c98c2be48aa7e5a
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.in       |    3 ---
 src/core/display.c |    1 -
 src/core/main.c    |    1 -
 src/core/util.c    |   33 ---------------------------------
 src/meta/util.h    |    2 --
 5 files changed, 0 insertions(+), 40 deletions(-)
---
diff --git a/configure.in b/configure.in
index 2877415..d9cdfcc 100644
--- a/configure.in
+++ b/configure.in
@@ -113,9 +113,6 @@ AC_ARG_ENABLE(shape,
                  [disable mutter's use of the shaped window extension]),,
   enable_shape=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 6ef744e..a789fcb 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -5332,7 +5332,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 8718319..4460e9b 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -110,7 +110,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 69de5f0..09be7f6 100644
--- a/src/core/util.c
+++ b/src/core/util.c
@@ -47,37 +47,6 @@ meta_topic_real_valist (MetaDebugTopic topic,
                         va_list        args);
 #endif
 
-#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 gint verbose_topics = 0;
 static gboolean is_debugging = FALSE;
 static gboolean replace_current = FALSE;
@@ -441,8 +410,6 @@ meta_bug (const char *format, ...)
   fflush (out);
   
   g_free (str);
-
-  meta_print_backtrace ();
   
   /* stop us in a debugger */
   abort ();
diff --git a/src/meta/util.h b/src/meta/util.h
index d345840..c9fead4 100644
--- a/src/meta/util.h
+++ b/src/meta/util.h
@@ -90,8 +90,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_frame_type_to_string (MetaFrameType type);
 const char* meta_gravity_to_string (int gravity);
 



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