From 1a75379b24195c0127a4627d27530f8217c42718 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 28 Oct 2016 21:25:37 +0000 Subject: [PATCH] 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. llvm-svn: 285455 --- compiler-rt/lib/tsan/go/tsan_go.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler-rt/lib/tsan/go/tsan_go.cc b/compiler-rt/lib/tsan/go/tsan_go.cc index bc0d553..34625c8 100644 --- a/compiler-rt/lib/tsan/go/tsan_go.cc +++ b/compiler-rt/lib/tsan/go/tsan_go.cc @@ -271,6 +271,11 @@ void __tsan_go_ignore_sync_end(ThreadState *thr) { ThreadIgnoreSyncEnd(thr, 0); } +void __tsan_report_count(u64 *pn) { + Lock lock(&ctx->report_mtx); + *pn = ctx->nreported; +} + } // extern "C" } // namespace __tsan -- 2.7.4