blob: 0bd949ed15633607565cddd795b6201c8e18dedc [file] [log] [blame]
Kostya Serebryany7ac41482012-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,
Stephen Hines6a211c52014-07-21 00:49:56 -070029 StatMopIgnored,
Kostya Serebryany7ac41482012-05-10 13:48:04 +000030 StatMopRange,
Dmitry Vyukov82dbc512013-03-20 13:21:50 +000031 StatMopRodata,
32 StatMopRangeRodata,
Kostya Serebryany7ac41482012-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
Stephen Hines2d1fdb22014-05-28 23:58:16 -070073 // Clocks - acquire.
74 StatClockAcquire,
75 StatClockAcquireEmpty,
76 StatClockAcquireFastRelease,
77 StatClockAcquireLarge,
78 StatClockAcquireRepeat,
79 StatClockAcquireFull,
80 StatClockAcquiredSomething,
81 // Clocks - release.
82 StatClockRelease,
83 StatClockReleaseResize,
84 StatClockReleaseFast1,
85 StatClockReleaseFast2,
86 StatClockReleaseSlow,
87 StatClockReleaseFull,
88 StatClockReleaseAcquired,
89 StatClockReleaseClearTail,
90 // Clocks - release store.
91 StatClockStore,
92 StatClockStoreResize,
93 StatClockStoreFast,
94 StatClockStoreFull,
95 StatClockStoreTail,
96 // Clocks - acquire-release.
97 StatClockAcquireRelease,
98
Kostya Serebryany7ac41482012-05-10 13:48:04 +000099 // Atomics.
100 StatAtomic,
101 StatAtomicLoad,
102 StatAtomicStore,
103 StatAtomicExchange,
104 StatAtomicFetchAdd,
Dmitry Vyukov529cfa02012-10-04 10:08:23 +0000105 StatAtomicFetchSub,
Dmitry Vyukovcdfb33a2012-05-14 15:33:00 +0000106 StatAtomicFetchAnd,
107 StatAtomicFetchOr,
108 StatAtomicFetchXor,
Dmitry Vyukov02b45d22012-11-26 09:42:56 +0000109 StatAtomicFetchNand,
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000110 StatAtomicCAS,
111 StatAtomicFence,
112 StatAtomicRelaxed,
113 StatAtomicConsume,
114 StatAtomicAcquire,
115 StatAtomicRelease,
116 StatAtomicAcq_Rel,
117 StatAtomicSeq_Cst,
118 StatAtomic1,
119 StatAtomic2,
120 StatAtomic4,
121 StatAtomic8,
Dmitry Vyukov63da5092012-11-27 07:41:27 +0000122 StatAtomic16,
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000123
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000124 // Dynamic annotations.
125 StatAnnotation,
126 StatAnnotateHappensBefore,
127 StatAnnotateHappensAfter,
128 StatAnnotateCondVarSignal,
129 StatAnnotateCondVarSignalAll,
130 StatAnnotateMutexIsNotPHB,
131 StatAnnotateCondVarWait,
132 StatAnnotateRWLockCreate,
Dmitry Vyukovc20e9ba2012-08-16 13:29:41 +0000133 StatAnnotateRWLockCreateStatic,
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000134 StatAnnotateRWLockDestroy,
135 StatAnnotateRWLockAcquired,
136 StatAnnotateRWLockReleased,
137 StatAnnotateTraceMemory,
138 StatAnnotateFlushState,
139 StatAnnotateNewMemory,
140 StatAnnotateNoOp,
141 StatAnnotateFlushExpectedRaces,
142 StatAnnotateEnableRaceDetection,
143 StatAnnotateMutexIsUsedAsCondVar,
144 StatAnnotatePCQGet,
145 StatAnnotatePCQPut,
146 StatAnnotatePCQDestroy,
147 StatAnnotatePCQCreate,
148 StatAnnotateExpectRace,
149 StatAnnotateBenignRaceSized,
150 StatAnnotateBenignRace,
151 StatAnnotateIgnoreReadsBegin,
152 StatAnnotateIgnoreReadsEnd,
153 StatAnnotateIgnoreWritesBegin,
154 StatAnnotateIgnoreWritesEnd,
Dmitry Vyukove1ddbf92013-10-10 15:58:12 +0000155 StatAnnotateIgnoreSyncBegin,
156 StatAnnotateIgnoreSyncEnd,
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000157 StatAnnotatePublishMemoryRange,
158 StatAnnotateUnpublishMemoryRange,
159 StatAnnotateThreadName,
160
161 // Internal mutex contentionz.
162 StatMtxTotal,
163 StatMtxTrace,
164 StatMtxThreads,
165 StatMtxReport,
166 StatMtxSyncVar,
167 StatMtxSyncTab,
168 StatMtxSlab,
169 StatMtxAnnotations,
170 StatMtxAtExit,
Dmitry Vyukovad9da372012-12-06 12:16:15 +0000171 StatMtxMBlock,
Dmitry Vyukovf4e4f932012-12-21 11:30:14 +0000172 StatMtxJavaMBlock,
Stephen Hines2d1fdb22014-05-28 23:58:16 -0700173 StatMtxDeadlockDetector,
Dmitry Vyukov52c70e52013-02-04 08:06:32 +0000174 StatMtxFD,
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000175
176 // This must be the last.
Alexey Samsonov2135d8a2012-09-13 11:54:41 +0000177 StatCnt
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000178};
179
180} // namespace __tsan
181
182#endif // TSAN_STAT_H