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
This commit is contained in:
Jasper St. Pierre
2012-04-05 00:14:36 -04:00
parent 66406b3035
commit f143fe3710
5 changed files with 0 additions and 40 deletions

View File

@ -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 ();