1//===-- 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,
29  StatMopIgnored,
30  StatMopRange,
31  StatMopRodata,
32  StatMopRangeRodata,
33  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
73  // Clocks - acquire.
74  StatClockAcquire,
75  StatClockAcquireEmpty,
76  StatClockAcquireFastRelease,
77  StatClockAcquireFull,
78  StatClockAcquiredSomething,
79  // Clocks - release.
80  StatClockRelease,
81  StatClockReleaseResize,
82  StatClockReleaseFast,
83  StatClockReleaseSlow,
84  StatClockReleaseFull,
85  StatClockReleaseAcquired,
86  StatClockReleaseClearTail,
87  // Clocks - release store.
88  StatClockStore,
89  StatClockStoreResize,
90  StatClockStoreFast,
91  StatClockStoreFull,
92  StatClockStoreTail,
93  // Clocks - acquire-release.
94  StatClockAcquireRelease,
95
96  // Atomics.
97  StatAtomic,
98  StatAtomicLoad,
99  StatAtomicStore,
100  StatAtomicExchange,
101  StatAtomicFetchAdd,
102  StatAtomicFetchSub,
103  StatAtomicFetchAnd,
104  StatAtomicFetchOr,
105  StatAtomicFetchXor,
106  StatAtomicFetchNand,
107  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,
119  StatAtomic16,
120
121  // Dynamic annotations.
122  StatAnnotation,
123  StatAnnotateHappensBefore,
124  StatAnnotateHappensAfter,
125  StatAnnotateCondVarSignal,
126  StatAnnotateCondVarSignalAll,
127  StatAnnotateMutexIsNotPHB,
128  StatAnnotateCondVarWait,
129  StatAnnotateRWLockCreate,
130  StatAnnotateRWLockCreateStatic,
131  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,
152  StatAnnotateIgnoreSyncBegin,
153  StatAnnotateIgnoreSyncEnd,
154  StatAnnotatePublishMemoryRange,
155  StatAnnotateUnpublishMemoryRange,
156  StatAnnotateThreadName,
157  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,
167
168  // Internal mutex contentionz.
169  StatMtxTotal,
170  StatMtxTrace,
171  StatMtxThreads,
172  StatMtxReport,
173  StatMtxSyncVar,
174  StatMtxSyncTab,
175  StatMtxSlab,
176  StatMtxAnnotations,
177  StatMtxAtExit,
178  StatMtxMBlock,
179  StatMtxDeadlockDetector,
180  StatMtxFired,
181  StatMtxRacy,
182  StatMtxFD,
183  StatMtxGlobalProc,
184
185  // This must be the last.
186  StatCnt
187};
188
189}  // namespace __tsan
190
191#endif  // TSAN_STAT_H
192