summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/tsan')
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_interface_java.cc8
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_mutex.cc22
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_mutex.h2
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_stat.cc1
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_stat.h2
5 files changed, 18 insertions, 17 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_interface_java.cc b/compiler-rt/lib/tsan/rtl/tsan_interface_java.cc
index c49d58b3ad3..2bebed8eb21 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_interface_java.cc
+++ b/compiler-rt/lib/tsan/rtl/tsan_interface_java.cc
@@ -31,14 +31,14 @@ struct BlockDesc {
SyncVar *head;
BlockDesc()
- : mtx(MutexTypeJava, StatMtxJava)
+ : mtx(MutexTypeJavaMBlock, StatMtxJavaMBlock)
, head() {
CHECK_EQ(begin, false);
begin = true;
}
explicit BlockDesc(BlockDesc *b)
- : mtx(MutexTypeJava, StatMtxJava)
+ : mtx(MutexTypeJavaMBlock, StatMtxJavaMBlock)
, head(b->head) {
CHECK_EQ(begin, false);
begin = true;
@@ -63,14 +63,12 @@ struct BlockDesc {
};
struct JavaContext {
- Mutex mtx;
const uptr heap_begin;
const uptr heap_size;
BlockDesc *heap_shadow;
JavaContext(jptr heap_begin, jptr heap_size)
- : mtx(MutexTypeJava, StatMtxJava)
- , heap_begin(heap_begin)
+ : heap_begin(heap_begin)
, heap_size(heap_size) {
uptr size = heap_size / kHeapAlignment * sizeof(BlockDesc);
heap_shadow = (BlockDesc*)MmapFixedNoReserve(kHeapShadow, size);
diff --git a/compiler-rt/lib/tsan/rtl/tsan_mutex.cc b/compiler-rt/lib/tsan/rtl/tsan_mutex.cc
index a02d3ed640a..335ca2211d1 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_mutex.cc
+++ b/compiler-rt/lib/tsan/rtl/tsan_mutex.cc
@@ -28,16 +28,18 @@ namespace __tsan {
#if TSAN_DEBUG && !TSAN_GO
const MutexType MutexTypeLeaf = (MutexType)-1;
static MutexType CanLockTab[MutexTypeCount][MutexTypeCount] = {
- /*0 MutexTypeInvalid*/ {},
- /*1 MutexTypeTrace*/ {MutexTypeLeaf},
- /*2 MutexTypeThreads*/ {MutexTypeReport},
- /*3 MutexTypeReport*/ {MutexTypeSyncTab, MutexTypeMBlock},
- /*4 MutexTypeSyncVar*/ {},
- /*5 MutexTypeSyncTab*/ {MutexTypeSyncVar},
- /*6 MutexTypeSlab*/ {MutexTypeLeaf},
- /*7 MutexTypeAnnotations*/ {},
- /*8 MutexTypeAtExit*/ {MutexTypeSyncTab},
- /*9 MutexTypeMBlock*/ {MutexTypeSyncVar},
+ /*0 MutexTypeInvalid*/ {},
+ /*1 MutexTypeTrace*/ {MutexTypeLeaf},
+ /*2 MutexTypeThreads*/ {MutexTypeReport},
+ /*3 MutexTypeReport*/ {MutexTypeSyncTab, MutexTypeMBlock,
+ MutexTypeJavaMBlock},
+ /*4 MutexTypeSyncVar*/ {},
+ /*5 MutexTypeSyncTab*/ {MutexTypeSyncVar},
+ /*6 MutexTypeSlab*/ {MutexTypeLeaf},
+ /*7 MutexTypeAnnotations*/ {},
+ /*8 MutexTypeAtExit*/ {MutexTypeSyncTab},
+ /*9 MutexTypeMBlock*/ {MutexTypeSyncVar},
+ /*10 MutexTypeJavaMBlock*/ {MutexTypeSyncVar},
};
static bool CanLockAdj[MutexTypeCount][MutexTypeCount];
diff --git a/compiler-rt/lib/tsan/rtl/tsan_mutex.h b/compiler-rt/lib/tsan/rtl/tsan_mutex.h
index 3a03cfbb3b1..a2b489107a9 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_mutex.h
+++ b/compiler-rt/lib/tsan/rtl/tsan_mutex.h
@@ -30,7 +30,7 @@ enum MutexType {
MutexTypeAnnotations,
MutexTypeAtExit,
MutexTypeMBlock,
- MutexTypeJava,
+ MutexTypeJavaMBlock,
// This must be the last.
MutexTypeCount
diff --git a/compiler-rt/lib/tsan/rtl/tsan_stat.cc b/compiler-rt/lib/tsan/rtl/tsan_stat.cc
index 4bfc9625a0f..645e1d0f5fc 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_stat.cc
+++ b/compiler-rt/lib/tsan/rtl/tsan_stat.cc
@@ -279,6 +279,7 @@ void StatOutput(u64 *stat) {
name[StatMtxAtExit] = " Atexit ";
name[StatMtxAnnotations] = " Annotations ";
name[StatMtxMBlock] = " MBlock ";
+ name[StatMtxJavaMBlock] = " JavaMBlock ";
Printf("Statistics:\n");
for (int i = 0; i < StatCnt; i++)
diff --git a/compiler-rt/lib/tsan/rtl/tsan_stat.h b/compiler-rt/lib/tsan/rtl/tsan_stat.h
index e6bb6288027..397e6ee4675 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_stat.h
+++ b/compiler-rt/lib/tsan/rtl/tsan_stat.h
@@ -281,7 +281,7 @@ enum StatType {
StatMtxAnnotations,
StatMtxAtExit,
StatMtxMBlock,
- StatMtxJava,
+ StatMtxJavaMBlock,
// This must be the last.
StatCnt
OpenPOWER on IntegriCloud