diff options
author | je@facebook.com <je@facebook.com> | 2010-06-05 00:36:05 (GMT) |
---|---|---|
committer | Jason Evans <je@fb.com> | 2011-03-24 00:45:57 (GMT) |
commit | adc675c8ef55b59bb2facf795a3c26411cfbf3ed (patch) | |
tree | 1145a5a34ac23de60b74a0be597efff7b5698705 /jemalloc/configure.ac | |
parent | 38d9210c464c4ad49655a4da6bc84ea4fbec83d2 (diff) | |
download | jemalloc-adc675c8ef55b59bb2facf795a3c26411cfbf3ed.zip jemalloc-adc675c8ef55b59bb2facf795a3c26411cfbf3ed.tar.gz jemalloc-adc675c8ef55b59bb2facf795a3c26411cfbf3ed.tar.bz2 |
Add support for libunwind backtrace caching.
Use libunwind's unw_tdep_trace() if it is available.
Diffstat (limited to 'jemalloc/configure.ac')
-rw-r--r-- | jemalloc/configure.ac | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/jemalloc/configure.ac b/jemalloc/configure.ac index 412d3d1..26e1c41 100644 --- a/jemalloc/configure.ac +++ b/jemalloc/configure.ac @@ -29,7 +29,7 @@ dnl JE_COMPILABLE(label, hcode, mcode, rvar) AC_DEFUN([JE_COMPILABLE], [ AC_MSG_CHECKING([whether $1 is compilable]) -AC_RUN_IFELSE([AC_LANG_PROGRAM( +AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [$2], [$3])], AC_MSG_RESULT([yes]) [$4="yes"], @@ -454,6 +454,17 @@ if test "x$backtrace_method" = "x" -a "x$enable_prof_libunwind" = "x1" ; then if test "x${enable_prof_libunwind}" = "x1" ; then backtrace_method="libunwind" AC_DEFINE([JEMALLOC_PROF_LIBUNWIND], [ ]) + JE_COMPILABLE([libunwind frame cache], [ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +], [ +unw_tdep_make_frame_cache(0, 0); +unw_tdep_free_frame_cache(0); +unw_tdep_trace(0, 0, 0, 0); +], [libunwind_cache]) + if test "x${libunwind_cache}" = "xyes" ; then + AC_DEFINE([JEMALLOC_PROF_LIBUNWIND_CACHE], [ ]) + fi fi fi |