diff --git a/compiler-rt/lib/tsan/rtl/tsan_interface.h b/compiler-rt/lib/tsan/rtl/tsan_interface.h --- a/compiler-rt/lib/tsan/rtl/tsan_interface.h +++ b/compiler-rt/lib/tsan/rtl/tsan_interface.h @@ -34,6 +34,10 @@ SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE const char * __tsan_default_options(); +SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE const char * +__tsan_default_suppressions(); +SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void +__tsan_test_only_on_fork(); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_flush_memory(); @@ -109,12 +113,6 @@ SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write_range_pc(void *addr, unsigned long size, void *pc); -// User may provide function that would be called right when TSan detects -// an error. The argument 'report' is an opaque pointer that can be used to -// gather additional information using other TSan report API functions. -SANITIZER_INTERFACE_ATTRIBUTE -void __tsan_on_report(void *report); - // If TSan is currently reporting a detected issue on the current thread, // returns an opaque pointer to the current report. Otherwise returns NULL. SANITIZER_INTERFACE_ATTRIBUTE @@ -192,6 +190,21 @@ int __tsan_get_alloc_stack(uptr addr, uptr *trace, uptr size, int *thread_id, tid_t *os_id); +// May be overriden by JIT/JAVA/etc, whatever produces PCs marked with +// kExternalPCBit. +SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void +__tsan_symbolize_external_ex(uptr pc, + void (*add_frame)(void *, const char *, + const char *, int, int), + void *ctx); + +// Legacy API. May be overriden by JIT/JAVA/etc, whatever produces PCs marked +// with kExternalPCBit. +SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE +bool __tsan_symbolize_external(uptr pc, char *func_buf, uptr func_siz, + char *file_buf, uptr file_siz, int *line, + int *col); + #endif // SANITIZER_GO #ifdef __cplusplus @@ -225,6 +238,25 @@ mo_seq_cst } morder; +#if !SANITIZER_GO +class ReportDesc; +extern "C++" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void +OnPotentiallyBlockingRegionBegin(); +extern "C++" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void +OnPotentiallyBlockingRegionEnd(); +extern "C++" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void +OnInitialize(); +extern "C++" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE bool +OnFinalize(bool failed); +extern "C++" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE bool +OnReport(const ReportDesc *rep, bool suppressed); +// User may provide function that would be called right when TSan detects +// an error. The argument 'report' is an opaque pointer that can be used to +// gather additional information using other TSan report API functions. +extern "C" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void +__tsan_on_report(const ReportDesc *report); +#endif // SANITIZER_GO + struct ThreadState; extern "C" { diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp b/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp --- a/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp @@ -17,6 +17,7 @@ #include "sanitizer_common/sanitizer_stacktrace.h" #include "tsan_fd.h" #include "tsan_flags.h" +#include "tsan_interface.h" #include "tsan_mman.h" #include "tsan_platform.h" #include "tsan_report.h" diff --git a/compiler-rt/lib/tsan/rtl/tsan_suppressions.cpp b/compiler-rt/lib/tsan/rtl/tsan_suppressions.cpp --- a/compiler-rt/lib/tsan/rtl/tsan_suppressions.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_suppressions.cpp @@ -17,6 +17,7 @@ #include "sanitizer_common/sanitizer_placement_new.h" #include "sanitizer_common/sanitizer_suppressions.h" #include "tsan_flags.h" +#include "tsan_interface.h" #include "tsan_mman.h" #include "tsan_platform.h" #include "tsan_rtl.h" diff --git a/compiler-rt/lib/tsan/rtl/tsan_symbolize.cpp b/compiler-rt/lib/tsan/rtl/tsan_symbolize.cpp --- a/compiler-rt/lib/tsan/rtl/tsan_symbolize.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_symbolize.cpp @@ -16,6 +16,7 @@ #include "sanitizer_common/sanitizer_placement_new.h" #include "sanitizer_common/sanitizer_symbolizer.h" #include "tsan_flags.h" +#include "tsan_interface.h" #include "tsan_report.h" #include "tsan_rtl.h"