diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2012-11-28 10:35:31 +0000 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2012-11-28 10:35:31 +0000 |
| commit | 2429b027703b96e99a275d71ed75fde6492bb779 (patch) | |
| tree | 28425449c58d64164bac64cf3359a8b9ae2d48ed /compiler-rt/lib/tsan/rtl/tsan_rtl.h | |
| parent | a873623e54b4d32ff7b1aada54eaf2476135d3a7 (diff) | |
| download | bcm5719-llvm-2429b027703b96e99a275d71ed75fde6492bb779.tar.gz bcm5719-llvm-2429b027703b96e99a275d71ed75fde6492bb779.zip | |
tsan: move traces from tls into dedicated storage at fixed address
helps to reduce tls size (it's weird to have multi-MB tls)
will help with dynamically adjustable trace size
llvm-svn: 168783
Diffstat (limited to 'compiler-rt/lib/tsan/rtl/tsan_rtl.h')
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_rtl.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.h b/compiler-rt/lib/tsan/rtl/tsan_rtl.h index 967bf797274..d3052cf0b53 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl.h +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.h @@ -35,6 +35,7 @@ #include "tsan_trace.h" #include "tsan_vector.h" #include "tsan_report.h" +#include "tsan_platform.h" namespace __tsan { @@ -533,11 +534,13 @@ void AfterSleep(ThreadState *thr, uptr pc); #endif void TraceSwitch(ThreadState *thr); +uptr TraceTopPC(ThreadState *thr); extern "C" void __tsan_trace_switch(); -void ALWAYS_INLINE INLINE TraceAddEvent(ThreadState *thr, u64 epoch, +void ALWAYS_INLINE INLINE TraceAddEvent(ThreadState *thr, FastState fs, EventType typ, uptr addr) { StatInc(thr, StatEvents); + u64 epoch = fs.epoch(); if (UNLIKELY((epoch % kTracePartSize) == 0)) { #ifndef TSAN_GO HACKY_CALL(__tsan_trace_switch); @@ -545,7 +548,8 @@ void ALWAYS_INLINE INLINE TraceAddEvent(ThreadState *thr, u64 epoch, TraceSwitch(thr); #endif } - Event *evp = &thr->trace.events[epoch % kTraceSize]; + Event *trace = (Event*)GetThreadTrace(fs.tid()); + Event *evp = &trace[epoch % kTraceSize]; Event ev = (u64)addr | ((u64)typ << 61); *evp = ev; } |

