tsan_stat.h revision 2d1fdb26e458c4ddc04155c1d421bced3ba90cd0
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  StatMopRange,
30  StatMopRodata,
31  StatMopRangeRodata,
32  StatShadowProcessed,
33  StatShadowZero,
34  StatShadowNonZero,  // Derived.
35  StatShadowSameSize,
36  StatShadowIntersect,
37  StatShadowNotIntersect,
38  StatShadowSameThread,
39  StatShadowAnotherThread,
40  StatShadowReplace,
41
42  // Func processing.
43  StatFuncEnter,
44  StatFuncExit,
45
46  // Trace processing.
47  StatEvents,
48
49  // Threads.
50  StatThreadCreate,
51  StatThreadFinish,
52  StatThreadReuse,
53  StatThreadMaxTid,
54  StatThreadMaxAlive,
55
56  // Mutexes.
57  StatMutexCreate,
58  StatMutexDestroy,
59  StatMutexLock,
60  StatMutexUnlock,
61  StatMutexRecLock,
62  StatMutexRecUnlock,
63  StatMutexReadLock,
64  StatMutexReadUnlock,
65
66  // Synchronization.
67  StatSyncCreated,
68  StatSyncDestroyed,
69  StatSyncAcquire,
70  StatSyncRelease,
71
72  // Clocks - acquire.
73  StatClockAcquire,
74  StatClockAcquireEmpty,
75  StatClockAcquireFastRelease,
76  StatClockAcquireLarge,
77  StatClockAcquireRepeat,
78  StatClockAcquireFull,
79  StatClockAcquiredSomething,
80  // Clocks - release.
81  StatClockRelease,
82  StatClockReleaseResize,
83  StatClockReleaseFast1,
84  StatClockReleaseFast2,
85  StatClockReleaseSlow,
86  StatClockReleaseFull,
87  StatClockReleaseAcquired,
88  StatClockReleaseClearTail,
89  // Clocks - release store.
90  StatClockStore,
91  StatClockStoreResize,
92  StatClockStoreFast,
93  StatClockStoreFull,
94  StatClockStoreTail,
95  // Clocks - acquire-release.
96  StatClockAcquireRelease,
97
98  // Atomics.
99  StatAtomic,
100  StatAtomicLoad,
101  StatAtomicStore,
102  StatAtomicExchange,
103  StatAtomicFetchAdd,
104  StatAtomicFetchSub,
105  StatAtomicFetchAnd,
106  StatAtomicFetchOr,
107  StatAtomicFetchXor,
108  StatAtomicFetchNand,
109  StatAtomicCAS,
110  StatAtomicFence,
111  StatAtomicRelaxed,
112  StatAtomicConsume,
113  StatAtomicAcquire,
114  StatAtomicRelease,
115  StatAtomicAcq_Rel,
116  StatAtomicSeq_Cst,
117  StatAtomic1,
118  StatAtomic2,
119  StatAtomic4,
120  StatAtomic8,
121  StatAtomic16,
122
123  // Dynamic annotations.
124  StatAnnotation,
125  StatAnnotateHappensBefore,
126  StatAnnotateHappensAfter,
127  StatAnnotateCondVarSignal,
128  StatAnnotateCondVarSignalAll,
129  StatAnnotateMutexIsNotPHB,
130  StatAnnotateCondVarWait,
131  StatAnnotateRWLockCreate,
132  StatAnnotateRWLockCreateStatic,
133  StatAnnotateRWLockDestroy,
134  StatAnnotateRWLockAcquired,
135  StatAnnotateRWLockReleased,
136  StatAnnotateTraceMemory,
137  StatAnnotateFlushState,
138  StatAnnotateNewMemory,
139  StatAnnotateNoOp,
140  StatAnnotateFlushExpectedRaces,
141  StatAnnotateEnableRaceDetection,
142  StatAnnotateMutexIsUsedAsCondVar,
143  StatAnnotatePCQGet,
144  StatAnnotatePCQPut,
145  StatAnnotatePCQDestroy,
146  StatAnnotatePCQCreate,
147  StatAnnotateExpectRace,
148  StatAnnotateBenignRaceSized,
149  StatAnnotateBenignRace,
150  StatAnnotateIgnoreReadsBegin,
151  StatAnnotateIgnoreReadsEnd,
152  StatAnnotateIgnoreWritesBegin,
153  StatAnnotateIgnoreWritesEnd,
154  StatAnnotateIgnoreSyncBegin,
155  StatAnnotateIgnoreSyncEnd,
156  StatAnnotatePublishMemoryRange,
157  StatAnnotateUnpublishMemoryRange,
158  StatAnnotateThreadName,
159
160  // Internal mutex contentionz.
161  StatMtxTotal,
162  StatMtxTrace,
163  StatMtxThreads,
164  StatMtxReport,
165  StatMtxSyncVar,
166  StatMtxSyncTab,
167  StatMtxSlab,
168  StatMtxAnnotations,
169  StatMtxAtExit,
170  StatMtxMBlock,
171  StatMtxJavaMBlock,
172  StatMtxDeadlockDetector,
173  StatMtxFD,
174
175  // This must be the last.
176  StatCnt
177};
178
179}  // namespace __tsan
180
181#endif  // TSAN_STAT_H
182