summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl/tsan_interface_ann.cc
Commit message (Collapse)AuthorAgeFilesLines
* compiler-rt: Rename .cc file in lib/tsan/rtl to .cppNico Weber2019-08-011-552/+0
| | | | | | Like r367463, but for tsan/rtl. llvm-svn: 367564
* 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
* Move __tsan::Vector to __sanitizerKamil Rytarowski2017-12-041-3/+3
| | | | | | | | | | | | | | | | | | | | | Summary: The low-fat STL-like vector container will be reused in MSan. It is needed to implement an atexit(3) interceptor on NetBSD/amd64 in MSan. Sponsored by <The NetBSD Foundation> Reviewers: joerg, dvyukov, eugenis, vitalybuka, kcc Reviewed By: dvyukov Subscribers: kubamracek, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40726 llvm-svn: 319650
* [tsan] Add comments for the bool argument of ↵Kuba Mracek2017-07-101-8/+8
| | | | | | | | ThreadIgnoreBegin/ThreadIgnoreSyncBegin, NFC. Differential Revision: https://reviews.llvm.org/D35134 llvm-svn: 307545
* tsan: support linker init flag in __tsan_mutex_destroyDmitry Vyukov2017-05-011-1/+1
| | | | | | | | | | | | | | For a linker init mutex with lazy flag setup (no __tsan_mutex_create call), it is possible that no lock/unlock happened before the destroy call. Then when destroy runs we still don't know that it is a linker init mutex and will emulate a memory write. This in turn can lead to false positives as the mutex is in fact linker initialized. Support linker init flag in destroy annotation to resolve this. llvm-svn: 301795
* tsan: add new mutex annotationsDmitry Vyukov2017-03-261-10/+102
| | | | | | | | | | | | | | There are several problems with the current annotations (AnnotateRWLockCreate and friends): - they don't fully support deadlock detection (we need a hook _before_ mutex lock) - they don't support insertion of random artificial delays to perturb execution (again we need a hook _before_ mutex lock) - they don't support setting extended mutex attributes like read/write reentrancy (only "linker init" was bolted on) - they don't support setting mutex attributes if a mutex don't have a "constructor" (e.g. static, Java, Go mutexes) - they don't ignore synchronization inside of lock/unlock operations which leads to slowdown and false negatives The new annotations solve of the above problems. See tsan_interface.h for the interface specification and comments. Reviewed in https://reviews.llvm.org/D31093 llvm-svn: 298809
* tsan: speed up race deduplicationDmitry Vyukov2015-09-031-16/+18
| | | | | | | | | | | | | | | | | | | | | | | Race deduplication code proved to be a performance bottleneck in the past if suppressions/annotations are used, or just some races left unaddressed. And we still get user complaints about this: https://groups.google.com/forum/#!topic/thread-sanitizer/hB0WyiTI4e4 ReportRace already has several layers of caching for racy pcs/addresses to make deduplication faster. However, ReportRace still takes a global mutex (ThreadRegistry and ReportMutex) during deduplication and also calls mmap/munmap (which take process-wide semaphore in kernel), this makes deduplication non-scalable. This patch moves race deduplication outside of global mutexes and also removes all mmap/munmap calls. As the result, race_stress.cc with 100 threads and 10000 iterations become 30x faster: before: real 0m21.673s user 0m5.932s sys 0m34.885s after: real 0m0.720s user 0m23.646s sys 0m1.254s http://reviews.llvm.org/D12554 llvm-svn: 246758
* [TSan] Use StackTrace from sanitizer_common where applicableAlexey Samsonov2014-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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] add a stub of another dynamic annotationKostya Serebryany2014-10-221-0/+2
| | | | llvm-svn: 220369
* tsan: remove compat mappingDmitry Vyukov2014-07-151-2/+0
| | | | | | There are no known usages anymore, so one less thing to support. llvm-svn: 213056
* tsan: refactor storage of meta information for heap blocks and sync objectsDmitry Vyukov2014-05-291-0/+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: deobfuscate global ctx variableDmitry Vyukov2014-03-201-1/+1
| | | | llvm-svn: 204327
* Reapply r201910. MSVC gets __func__ defined explicitly, even though itJoerg Sonnenberger2014-02-261-1/+1
| | | | | | can't build anything here. llvm-svn: 202297
* Revert "Replace __FUNCTION__ with __func__, the latter being standard ↵Reid Kleckner2014-02-221-1/+1
| | | | | | | | | | | | C99/C++11." This reverts commit r201910. While __func__ may be standard in C++11, it was only recently added to MSVC in 2013 CTP, and LLVM supports MSVC 2012. __FUNCTION__ may not be standard, but it's *very* portable. llvm-svn: 201916
* Replace __FUNCTION__ with __func__, the latter being standard C99/C++11.Joerg Sonnenberger2014-02-211-1/+1
| | | | llvm-svn: 201910
* tsan: remove in_rtl counterDmitry Vyukov2013-12-241-7/+1
| | | | | | | | This is intended to address the following problem. Episodically we see CHECK-failures when recursive interceptors call back into user code. Effectively we are not "in_rtl" at this point, but it's very complicated and fragile to properly maintain in_rtl property. Instead get rid of it. It was used mostly for sanity CHECKs, which basically never uncover real problems. Instead introduce ignore_interceptors flag, which is used in very few narrow places to disable recursive interceptors (e.g. during runtime initialization). llvm-svn: 197979
* tsan: better diagnostics if thread finishes with ignores enabledDmitry Vyukov2013-11-271-9/+9
| | | | | | | print thread creation stack and stacks where ignores were enabled. llvm-svn: 195836
* tsan: fix WTFAnnotateBenignRaceSized annotationDmitry Vyukov2013-11-191-1/+1
| | | | | | actually use the passed size llvm-svn: 195133
* tsan: add annotations to ignore synchronization operationsDmitry Vyukov2013-10-101-0/+10
| | | | | | | | The annotations are AnnotateIgnoreSyncBegin/End, may be useful to ignore some infrastructure synchronization that introduces lots of false negatives. llvm-svn: 192355
* tsan: consistently use thr instead of cur_thread() in annotations implementationDmitry Vyukov2013-09-191-6/+6
| | | | llvm-svn: 190988
* tsan: refactor internal IgnoreCtl interfaceDmitry Vyukov2013-09-191-4/+4
| | | | llvm-svn: 190987
* [tsan] No-op implementation of AnnotateMemoryIsInitialized.Evgeniy Stepanov2013-09-181-0/+3
| | | | llvm-svn: 190933
* tsan: consistently use return pc as top frame pcDmitry Vyukov2013-06-171-2/+3
| | | | | | | always substract 1 from the top pc this allows to get correct stacks with -O2 llvm-svn: 184112
* [nolibc] Move all platforms to internal_getpid.Peter Collingbourne2013-05-171-2/+2
| | | | | | | | | | Before, we had an unused internal_getpid function for Linux, and a platform-independent GetPid function. To make the naming conventions consistent for syscall-like functions, the GetPid syscall wrapper in sanitizer_posix.cc is moved to sanitizer_mac.cc, and GetPid is renamed to internal_getpid, bringing the Linux variant into use. llvm-svn: 182132
* [TSan] Add the WTFAnnotateBenignRaceSized implementation and a test forAlexander Potapenko2013-04-021-0/+4
| | | | | | WTFAnnotateBenignRaceSized and AnnotateBenignRaceSized. llvm-svn: 178534
* tsan: print statistics about benign race annotationsDmitry Vyukov2013-03-281-10/+69
| | | | | | | (total count, unique, matched) if requested with print_benign=1 flag. llvm-svn: 178245
* tsan: output thread namesDmitry Vyukov2012-12-041-1/+2
| | | | llvm-svn: 169279
* tsan: add __attribute__((visibility("default"))) to interface functionsDmitry Vyukov2012-12-041-39/+58
| | | | llvm-svn: 169265
* [TSan] finally remove TsanPrintf in favor of Printf from sanitizer_commonAlexey Samsonov2012-11-021-4/+4
| | | | llvm-svn: 167294
* tsan: implement RWLOCK annotationsDmitry Vyukov2012-08-161-5/+20
| | | | llvm-svn: 162019
* tsan: fix COMPAT mapping to not produce false reportsDmitry Vyukov2012-06-141-0/+3
| | | | llvm-svn: 158473
* [Sanitizer] move placement_new definiton from TSan to common runtimeAlexey Samsonov2012-06-071-1/+1
| | | | llvm-svn: 158145
* [Sanitizer]: Introduce a common internal printf function. For now, also use ↵Alexey Samsonov2012-06-061-4/+4
| | | | | | tool-specific wrappers TsanPrintf (its output is controlled by TSan flags) and AsanPrintf (which copies its results to the ASan-private buffer). Supported formats: %[z]{d,u,x}, %s, %p. Re-write all format strings in TSan according to this format (this should have no effect on 64-bit platforms). llvm-svn: 158065
* [TSan] run some renaming as a preparation for factoring out Printf ↵Alexey Samsonov2012-06-061-4/+4
| | | | | | implementation. llvm-svn: 158058
* [Sanitizer] remove using namespace __sanitizer linesAlexey Samsonov2012-06-051-1/+0
| | | | llvm-svn: 157999
* [Sanitizer] Use common defines for ASan and TSan runtime. Split defines ↵Alexey Samsonov2012-06-051-1/+1
| | | | | | between interface defines (can be visible in user code that includes interface ASan/TSan headers) and internal defines. llvm-svn: 157998
* Remove file-type tags in .cc files in tsan/ and sanitizer_common/Alexey Samsonov2012-06-041-1/+1
| | | | llvm-svn: 157928
* [Sanitizer]: move internal_strcmp to sanitizer_commonAlexey Samsonov2012-06-041-0/+2
| | | | llvm-svn: 157926
* tsan: add a flag to control RunningOnValgrind() return valueDmitry Vyukov2012-05-241-1/+1
| | | | llvm-svn: 157383
* tsan: ValgrindSlowdown() should be weak for some timeDmitry Vyukov2012-05-171-1/+1
| | | | llvm-svn: 156982
* tsan: add ValgrindSlowdown() "dynamic annotation"Dmitry Vyukov2012-05-171-0/+4
| | | | llvm-svn: 156981
* [tsan] First commit of ThreadSanitizer (TSan) run-time library.Kostya Serebryany2012-05-101-0/+344
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