summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl/tsan_interface.h
Commit message (Collapse)AuthorAgeFilesLines
* [TSAN] Add read/write range interface functions with PCJoachim Protze2019-09-241-0/+5
| | | | | | | | | | Adding annotation function variants __tsan_write_range_pc and __tsan_read_range_pc to annotate ranged access to memory while providing a program counter for the access. Differential Revision: https://reviews.llvm.org/D66885 llvm-svn: 372730
* Remove NOLINTs from compiler-rtVitaly Buka2019-09-111-4/+4
| | | | llvm-svn: 371687
* Adjust documentation for git migration.James Y Knight2019-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes most references to the paths: llvm.org/svn/ llvm.org/git/ llvm.org/viewvc/ github.com/llvm-mirror/ github.com/llvm-project/ reviews.llvm.org/diffusion/ to instead point to https://github.com/llvm/llvm-project. This is *not* a trivial substitution, because additionally, all the checkout instructions had to be migrated to instruct users on how to use the monorepo layout, setting LLVM_ENABLE_PROJECTS instead of checking out various projects into various subdirectories. I've attempted to not change any scripts here, only documentation. The scripts will have to be addressed separately. Additionally, I've deleted one document which appeared to be outdated and unneeded: lldb/docs/building-with-debug-llvm.txt Differential Revision: https://reviews.llvm.org/D57330 llvm-svn: 352514
* 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] Add debugging API to retrieve the "external tag" from reportsKuba Mracek2018-05-101-0/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D46661 llvm-svn: 332048
* [tsan] Detect races on modifying accesses in Swift codeKuba Mracek2017-05-031-0/+2
| | | | | | | | This patch allows the Swift compiler to emit calls to `__tsan_external_write` before starting any modifying access, which will cause TSan to detect races on arrays, dictionaries and other classes defined in non-instrumented modules. Races on collections from the Swift standard library and user-defined structs and a frequent cause of subtle bugs and it's important that TSan detects those on top of existing LLVM IR instrumentation, which already detects races in direct memory accesses. Differential Revision: https://reviews.llvm.org/D31630 llvm-svn: 302050
* [sanitizer] Introduce tid_t as a typedef for OS-provided thread IDsKuba Mracek2017-04-171-2/+3
| | | | | | | | We seem to assume that OS-provided thread IDs are either uptr or int, neither of which is true on Darwin. This introduces a tid_t type, which holds a OS-provided thread ID (gettid on Linux, pthread_threadid_np on Darwin, pthread_self on FreeBSD). Differential Revision: https://reviews.llvm.org/D31774 llvm-svn: 300473
* Re-commit of r295318, which was reverted due to AArch64 flakiness. Moving ↵Kuba Mracek2017-02-221-0/+4
| | | | | | the test to Darwin only. llvm-svn: 295801
* Revert "[tsan] Provide external tags (object types) via debugging API"Diana Picus2017-02-201-4/+0
| | | | | | This reverts commit r295318 as the test is flaky on AArch64. llvm-svn: 295667
* [tsan] Provide external tags (object types) via debugging APIKuba Mracek2017-02-161-0/+4
| | | | | | | | In D28836, we added a way to tag heap objects and thus provide object types into report. This patch exposes this information into the debugging API. Differential Revision: https://reviews.llvm.org/D30023 llvm-svn: 295318
* [tsan] Provide API for libraries for race detection on custom objectsKuba Mracek2017-02-021-0/+9
| | | | | | | | This patch allows a non-instrumented library to call into TSan runtime, and tell us about "readonly" and "modifying" accesses to an arbitrary "object" and provide the caller and tag (type of object). This allows TSan to detect violations of API threading contracts where "read-only" methods can be called simulatenously from multiple threads, while modifying methods must be exclusive. Differential Revision: https://reviews.llvm.org/D28836 llvm-svn: 293885
* tsan: Introducing a function to flush the shadow memory from third-party ↵Dmitry Vyukov2017-01-071-0/+2
| | | | | | | | | | | | libraries As discussed with Dmitry (https://goo.gl/SA4izd), I would like to introduce a function to be called from a third-party library to flush the shadow memory. In particular, we ran some experiments with our tool Archer (an OpenMP data race detector based on Tsan, https://github.com/PRUNER/archer) and flushing the memory at the end of an outer parallel region, slightly increase the runtime overhead, but reduce the memory overhead of about 30%. This feature would come very handy in case of very large OpenMP applications that may cause an "out of memory" exception when checked with Tsan. Reviewed in: https://reviews.llvm.org/D28443 Author: Simone Atzeni (simoatze) llvm-svn: 291346
* [tsan] Implement __tsan_get_alloc_stack and __tsan_locate_address to query ↵Kuba Mracek2016-12-191-0/+11
| | | | | | | | | | pointer types and allocation stacks of heap pointers In ASan, we have __asan_locate_address and __asan_get_alloc_stack, which is used in LLDB/Xcode to show the allocation backtrace for a heap memory object. This patch implements the same for TSan. Differential Revision: https://reviews.llvm.org/D27656 llvm-svn: 290119
* [tsan] Expose __tsan_ignore_thread_begin and __tsan_ignore_thread_end in ↵Anna Zaks2016-11-111-0/+3
| | | | | | | | | | TSan interface This patch is needed to implement the function attribute that disable TSan checking at run time. Differential Revision: https://reviews.llvm.org/D25859 llvm-svn: 286658
* 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
* [compiler-rt] Do not introduce __sanitizer namespace globallyAnna Zaks2016-09-151-0/+1
| | | | | | | | | | | | The definitions in sanitizer_common may conflict with definitions from system headers because: The runtime includes the system headers after the project headers (as per LLVM coding guidelines). lib/sanitizer_common/sanitizer_internal_defs.h pollutes the namespace of everything defined after it, which is all/most of the sanitizer .h and .cc files and the included system headers with: using namespace __sanitizer; // NOLINT This patch solves the problem by introducing the namespace only within the sanitizer namespaces as proposed by Dmitry. Differential Revision: https://reviews.llvm.org/D21947 llvm-svn: 281657
* [tsan] Rename ReportThread->pid to ReportThread->os_idKuba Brecka2016-04-211-1/+1
| | | | | | | | The field "pid" in ReportThread is used to store the OS-provided thread ID (pthread_self or gettid). The name "pid" suggests it's a process ID, which it isn't. Let's rename it. Differential Revision: http://reviews.llvm.org/D19365 llvm-svn: 266994
* [tsan] Add TSan __tsan_atomic* functions to tsan_interface.hKuba Brecka2016-04-071-0/+235
| | | | | | | | To avoid using the public header (tsan_interface_atomic.h), which has different data types, let's add all the __tsan_atomic* functions to tsan_interface.h. Differential Revision: http://reviews.llvm.org/D18543 llvm-svn: 265663
* [tsan] Add TSan debugger APIsKuba Brecka2016-03-101-0/+55
| | | | | | | | Currently, TSan only reports everything in a formatted textual form. The idea behind this patch is to provide a consistent API that can be used to query information contained in a TSan-produced report. User can use these APIs either in a debugger (via a script or directly), or they can use it directly from the process (e.g. in the __tsan_on_report callback). ASan already has a similar API, see http://reviews.llvm.org/D4466. Differential Revision: http://reviews.llvm.org/D16191 llvm-svn: 263126
* tsan: add memory access functions that accept pcDmitry Vyukov2015-05-051-0/+12
| | | | | | This is required for Java support, as real PCs don't work for Java. llvm-svn: 236484
* tsan: properly instrument unaligned accessesDmitry Vyukov2015-01-271-6/+9
| | | | | | | | | | | If a memory access is unaligned, emit __tsan_unaligned_read/write callbacks instead of __tsan_read/write. Required to change semantics of __tsan_unaligned_read/write to not do the user memory. But since they were unused (other than through __sanitizer_unaligned_load/store) this is fine. Fixes long standing issue 17: https://code.google.com/p/thread-sanitizer/issues/detail?id=17 llvm-svn: 227230
* Define SANITIZER_INTERFACE_ATTRIBUTE on Windows and fix all the places where ↵Timur Iskhodzhanov2013-08-131-26/+26
| | | | | | SANITIZER_INTERFACE_ATTRIBUTE or SANITIZER_ATTRIBUTE_WEAK are used llvm-svn: 188261
* [sanitizer] Fix __sanitizer_unaligned_* to work with unaligned data types.Evgeniy Stepanov2013-06-041-6/+6
| | | | llvm-svn: 183224
* tsan: add interface functions for unaligned access, e.g. ↵Dmitry Vyukov2013-04-301-0/+7
| | | | | | __sanitizer_unaligned_load16 llvm-svn: 180780
* tsan: better reporting for races on vptrDmitry Vyukov2013-03-211-0/+1
| | | | | | explicitly say "ctor/dtor vs virtual call" llvm-svn: 177640
* [sanitizer] Further split private and public sanitizer headers.Evgeniy Stepanov2013-01-301-1/+1
| | | | | | And make msan_interface.h C-compatible. llvm-svn: 173928
* tsan: make atomic operations atomic againDmitry Vyukov2012-12-041-1/+2
| | | | llvm-svn: 169273
* tsan: add __attribute__((visibility("default"))) to interface functionsDmitry Vyukov2012-12-041-16/+20
| | | | llvm-svn: 169265
* tsan: add memory range access functions to public ifaceDmitry Vyukov2012-11-271-0/+3
| | | | llvm-svn: 168692
* [tsan] First commit of ThreadSanitizer (TSan) run-time library.Kostya Serebryany2012-05-101-0/+51
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