summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl/tsan_mutex.cc
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2012-12-06 12:16:15 +0000
committerDmitry Vyukov <dvyukov@google.com>2012-12-06 12:16:15 +0000
commitfd5ebcd1b0a7e73c3aabb4c872bdbc5d2a196a5e (patch)
treef1a80c6fc97c625fb4dc85e5955303ad4e86c238 /compiler-rt/lib/tsan/rtl/tsan_mutex.cc
parentdbe7d7e96515775489b145b866d0278345e958d8 (diff)
downloadbcm5719-llvm-fd5ebcd1b0a7e73c3aabb4c872bdbc5d2a196a5e.tar.gz
bcm5719-llvm-fd5ebcd1b0a7e73c3aabb4c872bdbc5d2a196a5e.zip
tsan: add mutexsets to reports
With this change reports say what mutexes the threads hold around the racy memory accesses. llvm-svn: 169493
Diffstat (limited to 'compiler-rt/lib/tsan/rtl/tsan_mutex.cc')
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_mutex.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_mutex.cc b/compiler-rt/lib/tsan/rtl/tsan_mutex.cc
index dde97f4f002..ca9b1083826 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_mutex.cc
+++ b/compiler-rt/lib/tsan/rtl/tsan_mutex.cc
@@ -30,12 +30,13 @@ static MutexType CanLockTab[MutexTypeCount][MutexTypeCount] = {
/*0 MutexTypeInvalid*/ {},
/*1 MutexTypeTrace*/ {MutexTypeLeaf},
/*2 MutexTypeThreads*/ {MutexTypeReport},
- /*3 MutexTypeReport*/ {},
+ /*3 MutexTypeReport*/ {MutexTypeSyncTab, MutexTypeMBlock},
/*4 MutexTypeSyncVar*/ {},
/*5 MutexTypeSyncTab*/ {MutexTypeSyncVar},
/*6 MutexTypeSlab*/ {MutexTypeLeaf},
/*7 MutexTypeAnnotations*/ {},
/*8 MutexTypeAtExit*/ {MutexTypeSyncTab},
+ /*9 MutexTypeMBlock*/ {MutexTypeSyncVar},
};
static bool CanLockAdj[MutexTypeCount][MutexTypeCount];
@@ -122,6 +123,8 @@ DeadlockDetector::DeadlockDetector() {
void DeadlockDetector::Lock(MutexType t) {
// Printf("LOCK %d @%zu\n", t, seq_ + 1);
+ CHECK_GT(t, MutexTypeInvalid);
+ CHECK_LT(t, MutexTypeCount);
u64 max_seq = 0;
u64 max_idx = MutexTypeInvalid;
for (int i = 0; i != MutexTypeCount; i++) {
OpenPOWER on IntegriCloud