summaryrefslogtreecommitdiff
path: root/lib/tsan/rtl/tsan_trace.h
AgeCommit message (Collapse)Author
2017-08-25tsan: don't pass bogus PCs to __tsan_symbolize_externalDmitry Vyukov
See the added comment for an explanation. Reviewed in https://reviews.llvm.org/D37107 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311768 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28tsan: always define SANITIZER_GODmitry Vyukov
Currently we either define SANITIZER_GO for Go or don't define it at all for C++. This works fine with preprocessor (ifdef/ifndef/defined), but does not work for C++ if statements (e.g. if (SANITIZER_GO) {...}). Also this is different from majority of SANITIZER_FOO macros which are always defined to either 0 or 1. Always define SANITIZER_GO to either 0 or 1. This allows to use SANITIZER_GO in expressions and in flag default values. Also remove kGoMode and kCppMode, which were meant to be used in expressions, but they are not defined in sanitizer_common code, so SANITIZER_GO become prevalent. Also convert some preprocessor checks to C++ if's or ternary expressions. Majority of this change is done mechanically with: sed "s#ifdef SANITIZER_GO#if SANITIZER_GO#g" sed "s#ifndef SANITIZER_GO#if \!SANITIZER_GO#g" sed "s#defined(SANITIZER_GO)#SANITIZER_GO#g" git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@285443 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-14tsan: fix buildDmitry Vyukov
Revision 229127 introduced a bug: zero value is not OK for trace headers, because stack0 needs constructor call. Instead unmap the unused part of trace after all ctors have been executed. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229263 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13tsan: reduce history size in Go modeDmitry Vyukov
The ContainsSameAccess optimization substantially reduces pressure on trace by eliminating duplicate accesses. So now we can reduce default trace size to reduce per-goroutine memory consumption. Current default size is 64K events, new -- 32K events. In either case user can change it with GORACE env var. Reduces per-goroutine memory consumption from 356K to 226K. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229117 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-09[tsan] remove TSAN_GO in favor of SANITIZER_GOKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223732 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-03[TSan] Use StackTrace from sanitizer_common where applicableAlexey Samsonov
Summary: This change removes `__tsan::StackTrace` class. There are now three alternatives: # Lightweight `__sanitizer::StackTrace`, which doesn't own a buffer of PCs. It is used in functions that need stack traces in read-only mode, and helps to prevent unnecessary allocations/copies (e.g. for StackTraces fetched from StackDepot). # `__sanitizer::BufferedStackTrace`, which stores buffer of PCs in a constant array. It is used in TraceHeader (non-Go version) # `__tsan::VarSizeStackTrace`, which owns buffer of PCs, dynamically allocated via TSan internal allocator. Test Plan: compiler-rt test suite Reviewers: dvyukov, kcc Reviewed By: kcc Subscribers: llvm-commits, kcc Differential Revision: http://reviews.llvm.org/D6004 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221194 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29tsan: refactor storage of meta information for heap blocks and sync objectsDmitry Vyukov
The new storage (MetaMap) is based on direct shadow (instead of a hashmap + per-block lists). This solves a number of problems: - eliminates quadratic behaviour in SyncTab::GetAndLock (https://code.google.com/p/thread-sanitizer/issues/detail?id=26) - eliminates contention in SyncTab - eliminates contention in internal allocator during allocation of sync objects - removes a bunch of ad-hoc code in java interface - reduces java shadow from 2x to 1/2x - allows to memorize heap block meta info for Java and Go - allows to cleanup sync object meta info for Go - which in turn enabled deadlock detector for Go git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209810 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-16tsan: move shadow stack from thread descriptors to fixed addressesDmitry Vyukov
This allows to increase max shadow stack size to 64K, and reliably catch shadow stack overflows instead of silently corrupting memory. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192797 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06tsan: add mutexsets to reportsDmitry Vyukov
With this change reports say what mutexes the threads hold around the racy memory accesses. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@169493 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28tsan: dynamic history sizeDmitry Vyukov
introduces history_size parameter that can be used to control trace size at startup git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@168786 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28tsan: move traces from tls into dedicated storage at fixed addressDmitry Vyukov
helps to reduce tls size (it's weird to have multi-MB tls) will help with dynamically adjustable trace size git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@168783 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13[TSan] fix a bunch of warnings reported by pedantic gccAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163788 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-06tsan: increase max shadow stack size + reduce memory consumption at the same ↵Dmitry Vyukov
time (by not memorizing full stacks in traces) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163322 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30tsan: simplify TSAN_HISTORY_SIZE codeDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162905 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-23tsan: allow to override per-thread event trace sizeDmitry Vyukov
useful if you don't see the second stack trace git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162456 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-17[TSan] cleanup header commentsAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@160359 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-16tsan: use dynamic shadow stack for GoDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@160288 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-22tsan: do not call malloc/free in memory access handling routine.Dmitry Vyukov
This improves signal-/fork-safety of instrumented programs. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@158988 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-22tsan: reduce per-thread memory usageDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157252 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-10[tsan] First commit of ThreadSanitizer (TSan) run-time library.Kostya Serebryany
Algorithm description: http://code.google.com/p/thread-sanitizer/wiki/ThreadSanitizerAlgorithm Status: The tool is known to work on large real-life applications, but still has quite a few rough edges. Nothing is guaranteed yet. The tool works on x86_64 Linux. Support for 64-bit MacOS 10.7+ is planned for late 2012. Support for 32-bit OSes is doable, but problematic and not yet planed. Further commits coming: - tests - makefiles - documentation - clang driver patch The code was previously developed at http://code.google.com/p/data-race-test/source/browse/trunk/v2/ by Dmitry Vyukov and Kostya Serebryany with contributions from Timur Iskhodzhanov, Alexander Potapenko, Alexey Samsonov and Evgeniy Stepanov. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@156542 91177308-0d34-0410-b5e6-96231b3b80d8