diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2012-11-28 12:19:50 +0000 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2012-11-28 12:19:50 +0000 |
| commit | e1a7f338a34f358b8866a7d08a21a1756e43f2da (patch) | |
| tree | f22d56ebf846e7aae5f1aee51938b29140fbad5b /compiler-rt/lib/tsan/rtl/tsan_rtl.cc | |
| parent | 3eb16c543e2cc3f0415012df03dc6189359d6f81 (diff) | |
| download | bcm5719-llvm-e1a7f338a34f358b8866a7d08a21a1756e43f2da.tar.gz bcm5719-llvm-e1a7f338a34f358b8866a7d08a21a1756e43f2da.zip | |
tsan: dynamic history size
introduces history_size parameter that can be used to control trace size at startup
llvm-svn: 168786
Diffstat (limited to 'compiler-rt/lib/tsan/rtl/tsan_rtl.cc')
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_rtl.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc index e66e5e3f0fe..22338ca48cb 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc @@ -290,11 +290,14 @@ void TraceSwitch(ThreadState *thr) { uptr TraceTopPC(ThreadState *thr) { Event *events = (Event*)GetThreadTrace(thr->tid); - uptr pc = events[thr->fast_state.epoch() % kTraceSize] - & ((1ull << 61) - 1); + uptr pc = events[thr->fast_state.GetTracePos()]; return pc; } +uptr TraceSize() { + return (uptr)(1ull << (kTracePartSizeBits + flags()->history_size + 1)); +} + #ifndef TSAN_GO extern "C" void __tsan_trace_switch() { TraceSwitch(cur_thread()); |

