1 //===-- tsan_stat.h ---------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file is a part of ThreadSanitizer (TSan), a race detector.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef TSAN_STAT_H
14 #define TSAN_STAT_H
15 
16 namespace __tsan {
17 
18 enum StatType {
19   // Memory access processing related stuff.
20   StatMop,
21   StatMopRead,
22   StatMopWrite,
23   StatMop1,  // These must be consequtive.
24   StatMop2,
25   StatMop4,
26   StatMop8,
27   StatMopSame,
28   StatMopIgnored,
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   StatClockAcquireFull,
77   StatClockAcquiredSomething,
78   // Clocks - release.
79   StatClockRelease,
80   StatClockReleaseResize,
81   StatClockReleaseFast,
82   StatClockReleaseSlow,
83   StatClockReleaseFull,
84   StatClockReleaseAcquired,
85   StatClockReleaseClearTail,
86   // Clocks - release store.
87   StatClockStore,
88   StatClockStoreResize,
89   StatClockStoreFast,
90   StatClockStoreFull,
91   StatClockStoreTail,
92   // Clocks - acquire-release.
93   StatClockAcquireRelease,
94 
95   // Atomics.
96   StatAtomic,
97   StatAtomicLoad,
98   StatAtomicStore,
99   StatAtomicExchange,
100   StatAtomicFetchAdd,
101   StatAtomicFetchSub,
102   StatAtomicFetchAnd,
103   StatAtomicFetchOr,
104   StatAtomicFetchXor,
105   StatAtomicFetchNand,
106   StatAtomicCAS,
107   StatAtomicFence,
108   StatAtomicRelaxed,
109   StatAtomicConsume,
110   StatAtomicAcquire,
111   StatAtomicRelease,
112   StatAtomicAcq_Rel,
113   StatAtomicSeq_Cst,
114   StatAtomic1,
115   StatAtomic2,
116   StatAtomic4,
117   StatAtomic8,
118   StatAtomic16,
119 
120   // Dynamic annotations.
121   StatAnnotation,
122   StatAnnotateHappensBefore,
123   StatAnnotateHappensAfter,
124   StatAnnotateCondVarSignal,
125   StatAnnotateCondVarSignalAll,
126   StatAnnotateMutexIsNotPHB,
127   StatAnnotateCondVarWait,
128   StatAnnotateRWLockCreate,
129   StatAnnotateRWLockCreateStatic,
130   StatAnnotateRWLockDestroy,
131   StatAnnotateRWLockAcquired,
132   StatAnnotateRWLockReleased,
133   StatAnnotateTraceMemory,
134   StatAnnotateFlushState,
135   StatAnnotateNewMemory,
136   StatAnnotateNoOp,
137   StatAnnotateFlushExpectedRaces,
138   StatAnnotateEnableRaceDetection,
139   StatAnnotateMutexIsUsedAsCondVar,
140   StatAnnotatePCQGet,
141   StatAnnotatePCQPut,
142   StatAnnotatePCQDestroy,
143   StatAnnotatePCQCreate,
144   StatAnnotateExpectRace,
145   StatAnnotateBenignRaceSized,
146   StatAnnotateBenignRace,
147   StatAnnotateIgnoreReadsBegin,
148   StatAnnotateIgnoreReadsEnd,
149   StatAnnotateIgnoreWritesBegin,
150   StatAnnotateIgnoreWritesEnd,
151   StatAnnotateIgnoreSyncBegin,
152   StatAnnotateIgnoreSyncEnd,
153   StatAnnotatePublishMemoryRange,
154   StatAnnotateUnpublishMemoryRange,
155   StatAnnotateThreadName,
156   Stat__tsan_mutex_create,
157   Stat__tsan_mutex_destroy,
158   Stat__tsan_mutex_pre_lock,
159   Stat__tsan_mutex_post_lock,
160   Stat__tsan_mutex_pre_unlock,
161   Stat__tsan_mutex_post_unlock,
162   Stat__tsan_mutex_pre_signal,
163   Stat__tsan_mutex_post_signal,
164   Stat__tsan_mutex_pre_divert,
165   Stat__tsan_mutex_post_divert,
166 
167   // Internal mutex contentionz.
168   StatMtxTotal,
169   StatMtxTrace,
170   StatMtxThreads,
171   StatMtxReport,
172   StatMtxSyncVar,
173   StatMtxSyncTab,
174   StatMtxSlab,
175   StatMtxAnnotations,
176   StatMtxAtExit,
177   StatMtxMBlock,
178   StatMtxDeadlockDetector,
179   StatMtxFired,
180   StatMtxRacy,
181   StatMtxFD,
182   StatMtxGlobalProc,
183 
184   // This must be the last.
185   StatCnt
186 };
187 
188 }  // namespace __tsan
189 
190 #endif  // TSAN_STAT_H
191