diff --git a/compiler-rt/lib/tsan/rtl/tsan_trace.h b/compiler-rt/lib/tsan/rtl/tsan_trace.h --- a/compiler-rt/lib/tsan/rtl/tsan_trace.h +++ b/compiler-rt/lib/tsan/rtl/tsan_trace.h @@ -191,7 +191,12 @@ }; struct TracePart : TraceHeader { + // There are a lot of goroutines in Go, so we use smaller parts. +#if SANITIZER_GO + static constexpr uptr kByteSize = 128 << 10; +#else static constexpr uptr kByteSize = 256 << 10; +#endif static constexpr uptr kSize = (kByteSize - sizeof(TraceHeader)) / sizeof(Event); // TraceAcquire does a fast event pointer overflow check by comparing