blob: 8ea32048e1474d89129e8e6b741c690fbd026957 [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,
77 StatClockAcquireLarge,
78 StatClockAcquireRepeat,
79 StatClockAcquireFull,
80 StatClockAcquiredSomething,
81 // Clocks - release.
82 StatClockRelease,
83 StatClockReleaseResize,
84 StatClockReleaseFast1,
85 StatClockReleaseFast2,
Dmitry Vyukovb5eb8f02014-04-11 15:38:03 +000086 StatClockReleaseSlow,
Dmitry Vyukovd23118c2014-03-24 18:54:20 +000087 StatClockReleaseFull,
88 StatClockReleaseAcquired,
89 StatClockReleaseClearTail,
Dmitry Vyukovd23118c2014-03-24 18:54:20 +000090 // Clocks - release store.
91 StatClockStore,
92 StatClockStoreResize,
93 StatClockStoreFast,
94 StatClockStoreFull,
95 StatClockStoreTail,
96 // Clocks - acquire-release.
97 StatClockAcquireRelease,
98
Kostya Serebryany4ad375f2012-05-10 13:48:04 +000099 // Atomics.
100 StatAtomic,
101 StatAtomicLoad,
102 StatAtomicStore,
103 StatAtomicExchange,
104 StatAtomicFetchAdd,
Dmitry Vyukovb96a7b52012-10-04 10:08:23 +0000105 StatAtomicFetchSub,
Dmitry Vyukov572c5b22012-05-14 15:33:00 +0000106 StatAtomicFetchAnd,
107 StatAtomicFetchOr,
108 StatAtomicFetchXor,
Dmitry Vyukov3b450122012-11-26 09:42:56 +0000109 StatAtomicFetchNand,
Kostya Serebryany4ad375f2012-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 Vyukov59d58662012-11-27 07:41:27 +0000122 StatAtomic16,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000123
Kostya Serebryany4ad375f2012-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 Vyukov4723e6b2012-08-16 13:29:41 +0000133 StatAnnotateRWLockCreateStatic,
Kostya Serebryany4ad375f2012-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 Vyukovfbb194f2013-10-10 15:58:12 +0000155 StatAnnotateIgnoreSyncBegin,
156 StatAnnotateIgnoreSyncEnd,
Kostya Serebryany4ad375f2012-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 Vyukovfd5ebcd2012-12-06 12:16:15 +0000171 StatMtxMBlock,
Kostya Serebryany0548c792014-02-21 15:07:18 +0000172 StatMtxDeadlockDetector,
Dmitry Vyukov3464dac2015-09-03 11:20:46 +0000173 StatMtxFired,
174 StatMtxRacy,
Dmitry Vyukov606de602013-02-04 08:06:32 +0000175 StatMtxFD,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000176
177 // This must be the last.
Alexey Samsonov046248c2012-09-13 11:54:41 +0000178 StatCnt
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000179};
180
181} // namespace __tsan
182
183#endif // TSAN_STAT_H