diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2013-03-20 13:21:50 +0000 |
---|---|---|
committer | Dmitry Vyukov <dvyukov@google.com> | 2013-03-20 13:21:50 +0000 |
commit | b62c158d811be14ad6ae5f7ebe48e6035aa94da5 (patch) | |
tree | 1a788564872243c320a3bfe183bfbcd0fc8be12a /compiler-rt/lib/tsan/rtl/tsan_rtl.cc | |
parent | b921e6377b86e3445975073bbb8154ec0dd6818d (diff) | |
download | bcm5719-llvm-b62c158d811be14ad6ae5f7ebe48e6035aa94da5.tar.gz bcm5719-llvm-b62c158d811be14ad6ae5f7ebe48e6035aa94da5.zip |
tsan: special handling of .rodata (don't try to find races, don't keep shadow, dont' put into traces)
llvm-svn: 177517
Diffstat (limited to 'compiler-rt/lib/tsan/rtl/tsan_rtl.cc')
-rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_rtl.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc index df41f1886e7..36fe5787080 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc @@ -457,6 +457,16 @@ void MemoryAccess(ThreadState *thr, uptr pc, uptr addr, } #endif + if (*shadow_mem == kShadowRodata) { + // Access to .rodata section, no races here. + // Measurements show that it can be 10-20% of all memory accesses. + StatInc(thr, StatMop); + StatInc(thr, kAccessIsWrite ? StatMopWrite : StatMopRead); + StatInc(thr, (StatType)(StatMop1 + kAccessSizeLog)); + StatInc(thr, StatMopRodata); + return; + } + FastState fast_state = thr->fast_state; if (fast_state.GetIgnoreBit()) return; |