From: Tudor Bosman Date: Sat, 15 Apr 2017 02:57:03 +0000 (-0700) Subject: Add exception_tracer to OSS build X-Git-Tag: v2017.04.17.00~2 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=507086879c31e0918c94e96fc696fac2501cc001 Add exception_tracer to OSS build Summary: What it says on the tin. Add the exception_tracer library to the folly OSS build, enabled with `--enable-exception-tracer`. Closes https://github.com/facebook/folly/pull/580 Reviewed By: Orvid Differential Revision: D4895533 Pulled By: yfeldblum fbshipit-source-id: 4878826c71e7d6af17845b23abc07dc48ea1aa51 --- diff --git a/folly/Makefile.am b/folly/Makefile.am index 4bde2ae3..3d5fd9ba 100644 --- a/folly/Makefile.am +++ b/folly/Makefile.am @@ -1,9 +1,14 @@ if FOLLY_TESTMAIN -SUBDIRS = . experimental init test io/test experimental/io/test -else -SUBDIRS = . experimental test io/test experimental/io/test +MAYBE_INIT = init endif +if EXCEPTION_TRACER +MAYBE_EXCEPTION_TRACER = experimental/exception_tracer +endif + +SUBDIRS = . experimental $(MAYBE_INIT) test io/test experimental/io/test \ + $(MAYBE_EXCEPTION_TRACER) + ACLOCAL_AMFLAGS = -I m4 CLEANFILES = @@ -109,6 +114,11 @@ nobase_follyinclude_HEADERS = \ experimental/EventCount.h \ experimental/Instructions.h \ experimental/bser/Bser.h \ + experimental/exception_tracer/ExceptionAbi.h \ + experimental/exception_tracer/ExceptionCounterLib.h \ + experimental/exception_tracer/ExceptionTracer.h \ + experimental/exception_tracer/ExceptionTracerLib.h \ + experimental/exception_tracer/StackTrace.h \ experimental/FunctionScheduler.h \ experimental/FutureDAG.h \ experimental/io/FsUtil.h \ diff --git a/folly/configure.ac b/folly/configure.ac index 4e951b74..593ca850 100644 --- a/folly/configure.ac +++ b/folly/configure.ac @@ -580,6 +580,10 @@ AS_IF([test "x${mobile}" = "xyes"], [ [Define to 1 for compiler guards for mobile targets.]) ]) +AC_ARG_ENABLE([exception-tracer], + AS_HELP_STRING([--enable-exception-tracer], [enables building exception tracer]), + [build_exception_tracer=${enableval}], [build_exception_tracer=no]) + # Include directory that contains "folly" so #include works AM_CPPFLAGS='-I$(top_srcdir)/..' AM_CPPFLAGS="$AM_CPPFLAGS $BOOST_CPPFLAGS $OPENSSL_INCLUDES" @@ -606,6 +610,7 @@ AM_CONDITIONAL([HAVE_EXTRANDOM_SFMT19937], AM_CONDITIONAL([FOLLY_TESTMAIN], [test "x${use_follytestmain}" = "xyes"]) AM_CONDITIONAL([HAVE_LIBDWARF], [test "x${have_libdwarf}" = "xyes"]) AM_CONDITIONAL([HAVE_BOOST_CONTEXT], [test "x${ax_cv_boost_context}" = "xyes"]) +AM_CONDITIONAL([EXCEPTION_TRACER], [test "x${build_exception_tracer}" = "xyes"]) # remove pkg-config deps from dependent libraries # (at least for pkg-config file purposes) @@ -621,4 +626,7 @@ AC_CONFIG_FILES([Makefile experimental/io/test/Makefile experimental/symbolizer/Makefile init/Makefile]) + +AM_COND_IF([EXCEPTION_TRACER], + [AC_CONFIG_FILES([experimental/exception_tracer/Makefile])]) AC_OUTPUT diff --git a/folly/experimental/exception_tracer/Makefile.am b/folly/experimental/exception_tracer/Makefile.am new file mode 100644 index 00000000..5c881bc7 --- /dev/null +++ b/folly/experimental/exception_tracer/Makefile.am @@ -0,0 +1,13 @@ +SUBDIRS = . + +lib_LTLIBRARIES = libfollyexception_tracer.la + +libfollyexception_tracer_la_SOURCES = \ + ExceptionCounterLib.cpp \ + ExceptionStackTraceLib.cpp \ + ExceptionTracer.cpp \ + ExceptionTracerLib.cpp \ + StackTrace.cpp + +libfollyexception_tracer_la_LIBADD = $(top_builddir)/libfolly.la $(top_builddir)/experimental/symbolizer/libfollysymbolizer.la +libfollyexception_tracer_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LT_VERSION)