[compiler-rt] r285455 - tsan: add a hook to obtain number of reports

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 28 14:25:38 PDT 2016


Author: dvyukov
Date: Fri Oct 28 16:25:37 2016
New Revision: 285455

URL: http://llvm.org/viewvc/llvm-project?rev=285455&view=rev
Log:
tsan: add a hook to obtain number of reports

Requested in:
https://github.com/golang/go/issues/15972
Will help to fail individual test cases with races.


Modified:
    compiler-rt/trunk/lib/tsan/go/tsan_go.cc

Modified: compiler-rt/trunk/lib/tsan/go/tsan_go.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/go/tsan_go.cc?rev=285455&r1=285454&r2=285455&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/go/tsan_go.cc (original)
+++ compiler-rt/trunk/lib/tsan/go/tsan_go.cc Fri Oct 28 16:25:37 2016
@@ -271,6 +271,11 @@ void __tsan_go_ignore_sync_end(ThreadSta
   ThreadIgnoreSyncEnd(thr, 0);
 }
 
+void __tsan_report_count(u64 *pn) {
+  Lock lock(&ctx->report_mtx);
+  *pn = ctx->nreported;
+}
+
 }  // extern "C"
 }  // namespace __tsan
 




More information about the llvm-commits mailing list