From: Tudor Bosman Date: Thu, 5 Dec 2013 21:40:59 +0000 (-0800) Subject: Revert "Change exception tracer to use per-thread caching in libunwind" X-Git-Tag: v0.22.0~769 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3952281ca7ba3c4c133b9e6f0ed4651c35424bb8;p=folly.git Revert "Change exception tracer to use per-thread caching in libunwind" Summary: Per-thread caching calls malloc, which means it doesn't work for malloc's profiling (and also it isn't async-signal-safe, despite the documentation). Test Plan: compiled Reviewed By: philipp@fb.com FB internal diff: D1085368 @override-unit-failures --- diff --git a/folly/experimental/exception_tracer/ExceptionTracerLib.cpp b/folly/experimental/exception_tracer/ExceptionTracerLib.cpp index 3813c6ad..eab33fd3 100644 --- a/folly/experimental/exception_tracer/ExceptionTracerLib.cpp +++ b/folly/experimental/exception_tracer/ExceptionTracerLib.cpp @@ -81,8 +81,6 @@ void initialize() { !orig_cxa_end_catch || !orig_rethrow_exception) { abort(); // what else can we do? } - - initStackTrace(); } } // namespace diff --git a/folly/experimental/exception_tracer/StackTrace.h b/folly/experimental/exception_tracer/StackTrace.h index b7354498..6b2ab3c7 100644 --- a/folly/experimental/exception_tracer/StackTrace.h +++ b/folly/experimental/exception_tracer/StackTrace.h @@ -75,11 +75,6 @@ void clearStack(StackTraceStack** head); */ int moveTop(StackTraceStack** from, StackTraceStack** to); -/** - * Initialize the stack tracing code. - */ -void initStackTrace(); - #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/folly/experimental/symbolizer/Symbolizer.cpp b/folly/experimental/symbolizer/Symbolizer.cpp index f7e0d59d..70d5a51f 100644 --- a/folly/experimental/symbolizer/Symbolizer.cpp +++ b/folly/experimental/symbolizer/Symbolizer.cpp @@ -403,23 +403,5 @@ std::ostream& operator<<(std::ostream& out, const FrameInfo& ainfo) { return out; } -namespace { - -struct Init { - Init(); -}; - -Init::Init() { - // Don't use global caching -- it's slow and leads to lock contention. (And - // it's made signal-safe using sigprocmask to block all signals while the - // lock is being held, and sigprocmask contends on a lock inside the kernel, - // too, ugh.) - unw_set_caching_policy(unw_local_addr_space, UNW_CACHE_PER_THREAD); -} - -Init initializer; - -} // namespace - } // namespace symbolizer } // namespace folly