summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl/tsan_trace.h
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* tsan: don't pass bogus PCs to __tsan_symbolize_externalDmitry Vyukov2017-08-251-0/+2
| | | | | | | | See the added comment for an explanation. Reviewed in https://reviews.llvm.org/D37107 llvm-svn: 311768
* tsan: always define SANITIZER_GODmitry Vyukov2016-10-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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" llvm-svn: 285443
* tsan: fix buildDmitry Vyukov2015-02-141-1/+3
| | | | | | | | | | 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. llvm-svn: 229263
* tsan: reduce history size in Go modeDmitry Vyukov2015-02-131-2/+2
| | | | | | | | | | | | 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. llvm-svn: 229117
* [tsan] remove TSAN_GO in favor of SANITIZER_GOKostya Serebryany2014-12-091-2/+2
| | | | llvm-svn: 223732
* [TSan] Use StackTrace from sanitizer_common where applicableAlexey Samsonov2014-11-031-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 221194
* tsan: refactor storage of meta information for heap blocks and sync objectsDmitry Vyukov2014-05-291-1/+1
| | | | | | | | | | | | | | | 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 llvm-svn: 209810
* tsan: move shadow stack from thread descriptors to fixed addressesDmitry Vyukov2013-10-161-0/+5
| | | | | | | | This allows to increase max shadow stack size to 64K, and reliably catch shadow stack overflows instead of silently corrupting memory. llvm-svn: 192797
* tsan: add mutexsets to reportsDmitry Vyukov2012-12-061-0/+2
| | | | | | With this change reports say what mutexes the threads hold around the racy memory accesses. llvm-svn: 169493
* tsan: dynamic history sizeDmitry Vyukov2012-11-281-6/+3
| | | | | | introduces history_size parameter that can be used to control trace size at startup llvm-svn: 168786
* tsan: move traces from tls into dedicated storage at fixed addressDmitry Vyukov2012-11-281-1/+0
| | | | | | | helps to reduce tls size (it's weird to have multi-MB tls) will help with dynamically adjustable trace size llvm-svn: 168783
* [TSan] fix a bunch of warnings reported by pedantic gccAlexey Samsonov2012-09-131-1/+1
| | | | llvm-svn: 163788
* tsan: increase max shadow stack size + reduce memory consumption at the same ↵Dmitry Vyukov2012-09-061-2/+2
| | | | | | time (by not memorizing full stacks in traces) llvm-svn: 163322
* tsan: simplify TSAN_HISTORY_SIZE codeDmitry Vyukov2012-08-301-4/+4
| | | | llvm-svn: 162905
* tsan: allow to override per-thread event trace sizeDmitry Vyukov2012-08-231-2/+6
| | | | | | useful if you don't see the second stack trace llvm-svn: 162456
* [TSan] cleanup header commentsAlexey Samsonov2012-07-171-1/+1
| | | | llvm-svn: 160359
* tsan: use dynamic shadow stack for GoDmitry Vyukov2012-07-161-0/+6
| | | | llvm-svn: 160288
* tsan: do not call malloc/free in memory access handling routine.Dmitry Vyukov2012-06-221-1/+7
| | | | | | This improves signal-/fork-safety of instrumented programs. llvm-svn: 158988
* tsan: reduce per-thread memory usageDmitry Vyukov2012-05-221-1/+1
| | | | llvm-svn: 157252
* [tsan] First commit of ThreadSanitizer (TSan) run-time library.Kostya Serebryany2012-05-101-0/+59
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. llvm-svn: 156542
OpenPOWER on IntegriCloud