blob: 42d6a2b635329e9b519919178221f5bd55e99f9b [file] [log] [blame]
Kostya Serebryany4ad375f2012-05-10 13:48:04 +00001//===-- tsan_stat.h ---------------------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file is a part of ThreadSanitizer (TSan), a race detector.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef TSAN_STAT_H
15#define TSAN_STAT_H
16
17namespace __tsan {
18
19enum StatType {
20 // Memory access processing related stuff.
21 StatMop,
22 StatMopRead,
23 StatMopWrite,
24 StatMop1, // These must be consequtive.
25 StatMop2,
26 StatMop4,
27 StatMop8,
28 StatMopSame,
Dmitry Vyukovafdcc962014-05-30 13:36:29 +000029 StatMopIgnored,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +000030 StatMopRange,
Dmitry Vyukovb62c1582013-03-20 13:21:50 +000031 StatMopRodata,
32 StatMopRangeRodata,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +000033 StatShadowProcessed,
34 StatShadowZero,
35 StatShadowNonZero, // Derived.
36 StatShadowSameSize,
37 StatShadowIntersect,
38 StatShadowNotIntersect,
39 StatShadowSameThread,
40 StatShadowAnotherThread,
41 StatShadowReplace,
42
43 // Func processing.
44 StatFuncEnter,
45 StatFuncExit,
46
47 // Trace processing.
48 StatEvents,
49
50 // Threads.
51 StatThreadCreate,
52 StatThreadFinish,
53 StatThreadReuse,
54 StatThreadMaxTid,
55 StatThreadMaxAlive,
56
57 // Mutexes.
58 StatMutexCreate,
59 StatMutexDestroy,
60 StatMutexLock,
61 StatMutexUnlock,
62 StatMutexRecLock,
63 StatMutexRecUnlock,
64 StatMutexReadLock,
65 StatMutexReadUnlock,
66
67 // Synchronization.
68 StatSyncCreated,
69 StatSyncDestroyed,
70 StatSyncAcquire,
71 StatSyncRelease,
72
Dmitry Vyukovd23118c2014-03-24 18:54:20 +000073 // Clocks - acquire.
74 StatClockAcquire,
75 StatClockAcquireEmpty,
76 StatClockAcquireFastRelease,
Dmitry Vyukovd23118c2014-03-24 18:54:20 +000077 StatClockAcquireFull,
78 StatClockAcquiredSomething,
79 // Clocks - release.
80 StatClockRelease,
81 StatClockReleaseResize,
Dmitry Vyukov1fa72992017-07-12 12:54:38 +000082 StatClockReleaseFast,
Dmitry Vyukovb5eb8f02014-04-11 15:38:03 +000083 StatClockReleaseSlow,
Dmitry Vyukovd23118c2014-03-24 18:54:20 +000084 StatClockReleaseFull,
85 StatClockReleaseAcquired,
86 StatClockReleaseClearTail,
Dmitry Vyukovd23118c2014-03-24 18:54:20 +000087 // Clocks - release store.
88 StatClockStore,
89 StatClockStoreResize,
90 StatClockStoreFast,
91 StatClockStoreFull,
92 StatClockStoreTail,
93 // Clocks - acquire-release.
94 StatClockAcquireRelease,
95
Kostya Serebryany4ad375f2012-05-10 13:48:04 +000096 // Atomics.
97 StatAtomic,
98 StatAtomicLoad,
99 StatAtomicStore,
100 StatAtomicExchange,
101 StatAtomicFetchAdd,
Dmitry Vyukovb96a7b52012-10-04 10:08:23 +0000102 StatAtomicFetchSub,
Dmitry Vyukov572c5b22012-05-14 15:33:00 +0000103 StatAtomicFetchAnd,
104 StatAtomicFetchOr,
105 StatAtomicFetchXor,
Dmitry Vyukov3b450122012-11-26 09:42:56 +0000106 StatAtomicFetchNand,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000107 StatAtomicCAS,
108 StatAtomicFence,
109 StatAtomicRelaxed,
110 StatAtomicConsume,
111 StatAtomicAcquire,
112 StatAtomicRelease,
113 StatAtomicAcq_Rel,
114 StatAtomicSeq_Cst,
115 StatAtomic1,
116 StatAtomic2,
117 StatAtomic4,
118 StatAtomic8,
Dmitry Vyukov59d58662012-11-27 07:41:27 +0000119 StatAtomic16,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000120
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000121 // Dynamic annotations.
122 StatAnnotation,
123 StatAnnotateHappensBefore,
124 StatAnnotateHappensAfter,
125 StatAnnotateCondVarSignal,
126 StatAnnotateCondVarSignalAll,
127 StatAnnotateMutexIsNotPHB,
128 StatAnnotateCondVarWait,
129 StatAnnotateRWLockCreate,
Dmitry Vyukov4723e6b2012-08-16 13:29:41 +0000130 StatAnnotateRWLockCreateStatic,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000131 StatAnnotateRWLockDestroy,
132 StatAnnotateRWLockAcquired,
133 StatAnnotateRWLockReleased,
134 StatAnnotateTraceMemory,
135 StatAnnotateFlushState,
136 StatAnnotateNewMemory,
137 StatAnnotateNoOp,
138 StatAnnotateFlushExpectedRaces,
139 StatAnnotateEnableRaceDetection,
140 StatAnnotateMutexIsUsedAsCondVar,
141 StatAnnotatePCQGet,
142 StatAnnotatePCQPut,
143 StatAnnotatePCQDestroy,
144 StatAnnotatePCQCreate,
145 StatAnnotateExpectRace,
146 StatAnnotateBenignRaceSized,
147 StatAnnotateBenignRace,
148 StatAnnotateIgnoreReadsBegin,
149 StatAnnotateIgnoreReadsEnd,
150 StatAnnotateIgnoreWritesBegin,
151 StatAnnotateIgnoreWritesEnd,
Dmitry Vyukovfbb194f2013-10-10 15:58:12 +0000152 StatAnnotateIgnoreSyncBegin,
153 StatAnnotateIgnoreSyncEnd,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000154 StatAnnotatePublishMemoryRange,
155 StatAnnotateUnpublishMemoryRange,
156 StatAnnotateThreadName,
Dmitry Vyukov8096a8c2017-03-26 15:27:04 +0000157 Stat__tsan_mutex_create,
158 Stat__tsan_mutex_destroy,
159 Stat__tsan_mutex_pre_lock,
160 Stat__tsan_mutex_post_lock,
161 Stat__tsan_mutex_pre_unlock,
162 Stat__tsan_mutex_post_unlock,
163 Stat__tsan_mutex_pre_signal,
164 Stat__tsan_mutex_post_signal,
165 Stat__tsan_mutex_pre_divert,
166 Stat__tsan_mutex_post_divert,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000167
168 // Internal mutex contentionz.
169 StatMtxTotal,
170 StatMtxTrace,
171 StatMtxThreads,
172 StatMtxReport,
173 StatMtxSyncVar,
174 StatMtxSyncTab,
175 StatMtxSlab,
176 StatMtxAnnotations,
177 StatMtxAtExit,
Dmitry Vyukovfd5ebcd2012-12-06 12:16:15 +0000178 StatMtxMBlock,
Kostya Serebryany0548c792014-02-21 15:07:18 +0000179 StatMtxDeadlockDetector,
Dmitry Vyukov3464dac2015-09-03 11:20:46 +0000180 StatMtxFired,
181 StatMtxRacy,
Dmitry Vyukov606de602013-02-04 08:06:32 +0000182 StatMtxFD,
Dmitry Vyukov144eafd2016-05-06 19:35:22 +0000183 StatMtxGlobalProc,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000184
185 // This must be the last.
Alexey Samsonov046248c2012-09-13 11:54:41 +0000186 StatCnt
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000187};
188
189} // namespace __tsan
190
191#endif // TSAN_STAT_H