Revert "Change exception tracer to use per-thread caching in libunwind"
authorTudor Bosman <tudorb@fb.com>
Thu, 5 Dec 2013 21:40:59 +0000 (13:40 -0800)
committerJordan DeLong <jdelong@fb.com>
Fri, 20 Dec 2013 21:04:53 +0000 (13:04 -0800)
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

folly/experimental/exception_tracer/ExceptionTracerLib.cpp
folly/experimental/exception_tracer/StackTrace.h
folly/experimental/symbolizer/Symbolizer.cpp

index 3813c6ad7d017d18c7a09137000039cd35e3f57a..eab33fd3efbb0836f9859acea6b61591f3248f0f 100644 (file)
@@ -81,8 +81,6 @@ void initialize() {
       !orig_cxa_end_catch || !orig_rethrow_exception) {
     abort();  // what else can we do?
   }
-
-  initStackTrace();
 }
 
 }  // namespace
index b7354498c3fc127bfebe609f8a6edccdea88d2df..6b2ab3c7f983bbc60585062aa8c1a0013463f924 100644 (file)
@@ -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
index f7e0d59d232abe291385182c18735fd66659fd50..70d5a51f46b038709c27eb9ea1dbffbe2c653313 100644 (file)
@@ -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