diff options
author | Kuba Mracek <mracek@apple.com> | 2017-02-02 13:17:05 +0000 |
---|---|---|
committer | Kuba Mracek <mracek@apple.com> | 2017-02-02 13:17:05 +0000 |
commit | dafbfeaa2a09e1fec8fa81304bfb80bb0b36763d (patch) | |
tree | 0292215bcb716dda18d7dd4b4302f346fd8d24bf /lib/tsan/rtl/tsan_debugging.cc | |
parent | fcdea2a41c1be21e6b2601e0fda909bbc9628513 (diff) |
[tsan] Provide API for libraries for race detection on custom objects
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
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293885 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan/rtl/tsan_debugging.cc')
-rw-r--r-- | lib/tsan/rtl/tsan_debugging.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/tsan/rtl/tsan_debugging.cc b/lib/tsan/rtl/tsan_debugging.cc index d9fb6861b..360879481 100644 --- a/lib/tsan/rtl/tsan_debugging.cc +++ b/lib/tsan/rtl/tsan_debugging.cc @@ -24,6 +24,7 @@ static const char *ReportTypeDescription(ReportType typ) { if (typ == ReportTypeVptrRace) return "data-race-vptr"; if (typ == ReportTypeUseAfterFree) return "heap-use-after-free"; if (typ == ReportTypeVptrUseAfterFree) return "heap-use-after-free-vptr"; + if (typ == ReportTypeExternalRace) return "external-race"; if (typ == ReportTypeThreadLeak) return "thread-leak"; if (typ == ReportTypeMutexDestroyLocked) return "locked-mutex-destroy"; if (typ == ReportTypeMutexDoubleLock) return "mutex-double-lock"; |