diff options
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_defs.h | 4 | ||||
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_flags.cc | 6 | ||||
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_flags.h | 2 | ||||
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_rtl.h | 6 |
4 files changed, 9 insertions, 9 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_defs.h b/compiler-rt/lib/tsan/rtl/tsan_defs.h index 2ffe2ef831b..6d8e9cfc3a3 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_defs.h +++ b/compiler-rt/lib/tsan/rtl/tsan_defs.h @@ -25,8 +25,12 @@ namespace __tsan { #ifdef TSAN_GO +const bool kGoMode = true; +const bool kCppMode = false; const char *const kTsanOptionsEnv = "GORACE"; #else +const bool kGoMode = false; +const bool kCppMode = true; const char *const kTsanOptionsEnv = "TSAN_OPTIONS"; #endif diff --git a/compiler-rt/lib/tsan/rtl/tsan_flags.cc b/compiler-rt/lib/tsan/rtl/tsan_flags.cc index 942d392e5cb..e3a18da579e 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_flags.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_flags.cc @@ -56,11 +56,7 @@ void InitializeFlags(Flags *f, const char *env) { f->stop_on_start = false; f->running_on_valgrind = false; f->external_symbolizer_path = ""; - f->history_size = 2; - -#ifdef TSAN_GO - f->history_size = 1; // There are a lot of goroutines. -#endif + f->history_size = kGoMode ? 1 : 2; // There are a lot of goroutines in Go. // Let a frontend override. OverrideFlags(f); diff --git a/compiler-rt/lib/tsan/rtl/tsan_flags.h b/compiler-rt/lib/tsan/rtl/tsan_flags.h index 41a8a7853bc..86c2af5e2b7 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_flags.h +++ b/compiler-rt/lib/tsan/rtl/tsan_flags.h @@ -69,7 +69,7 @@ struct Flags { // Path to external symbolizer. const char *external_symbolizer_path; // Per-thread history size, controls how many previous memory accesses - // is remembered per thread. Possible values are [0..7]. + // are remembered per thread. Possible values are [0..7]. // history_size=0 amounts to 32K memory accesses. Each next value doubles // the amount of memory accesses, up to history_size=7 that amounts to // 4M memory accesses. The default value is 2 (128K memory accesses). diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.h b/compiler-rt/lib/tsan/rtl/tsan_rtl.h index 79075f09419..eab2af5aeef 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl.h +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.h @@ -568,8 +568,8 @@ extern "C" void __tsan_trace_switch(); void ALWAYS_INLINE INLINE TraceAddEvent(ThreadState *thr, FastState fs, EventType typ, uptr addr) { StatInc(thr, StatEvents); - u64 epoch = fs.GetTracePos(); - if (UNLIKELY((epoch % kTracePartSize) == 0)) { + u64 pos = fs.GetTracePos(); + if (UNLIKELY((pos % kTracePartSize) == 0)) { #ifndef TSAN_GO HACKY_CALL(__tsan_trace_switch); #else @@ -577,7 +577,7 @@ void ALWAYS_INLINE INLINE TraceAddEvent(ThreadState *thr, FastState fs, #endif } Event *trace = (Event*)GetThreadTrace(fs.tid()); - Event *evp = &trace[epoch]; + Event *evp = &trace[pos]; Event ev = (u64)addr | ((u64)typ << 61); *evp = ev; } |

