Change exception tracer to use per-thread caching in libunwind
authorTudor Bosman <tudorb@fb.com>
Tue, 3 Dec 2013 21:09:13 +0000 (13:09 -0800)
committerJordan DeLong <jdelong@fb.com>
Fri, 20 Dec 2013 21:04:00 +0000 (13:04 -0800)
Summary: Because the global cache is slow and contends on locks.

Test Plan: testinproduction

Reviewed By: philipp@fb.com

FB internal diff: D1081259

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

index eab33fd3efbb0836f9859acea6b61591f3248f0f..3813c6ad7d017d18c7a09137000039cd35e3f57a 100644 (file)
@@ -81,6 +81,8 @@ void initialize() {
       !orig_cxa_end_catch || !orig_rethrow_exception) {
     abort();  // what else can we do?
   }
+
+  initStackTrace();
 }
 
 }  // namespace
index 6b2ab3c7f983bbc60585062aa8c1a0013463f924..b7354498c3fc127bfebe609f8a6edccdea88d2df 100644 (file)
@@ -75,6 +75,11 @@ void clearStack(StackTraceStack** head);
  */
 int moveTop(StackTraceStack** from, StackTraceStack** to);
 
+/**
+ * Initialize the stack tracing code.
+ */
+void initStackTrace();
+
 #ifdef __cplusplus
 }  /* extern "C" */
 #endif