blob: c5871f1447a515d1c7809721a300c5bfb0c6f9ed [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,
29 StatMopRange,
30 StatShadowProcessed,
31 StatShadowZero,
32 StatShadowNonZero, // Derived.
33 StatShadowSameSize,
34 StatShadowIntersect,
35 StatShadowNotIntersect,
36 StatShadowSameThread,
37 StatShadowAnotherThread,
38 StatShadowReplace,
39
40 // Func processing.
41 StatFuncEnter,
42 StatFuncExit,
43
44 // Trace processing.
45 StatEvents,
46
47 // Threads.
48 StatThreadCreate,
49 StatThreadFinish,
50 StatThreadReuse,
51 StatThreadMaxTid,
52 StatThreadMaxAlive,
53
54 // Mutexes.
55 StatMutexCreate,
56 StatMutexDestroy,
57 StatMutexLock,
58 StatMutexUnlock,
59 StatMutexRecLock,
60 StatMutexRecUnlock,
61 StatMutexReadLock,
62 StatMutexReadUnlock,
63
64 // Synchronization.
65 StatSyncCreated,
66 StatSyncDestroyed,
67 StatSyncAcquire,
68 StatSyncRelease,
69
70 // Atomics.
71 StatAtomic,
72 StatAtomicLoad,
73 StatAtomicStore,
74 StatAtomicExchange,
75 StatAtomicFetchAdd,
Dmitry Vyukov572c5b22012-05-14 15:33:00 +000076 StatAtomicFetchAnd,
77 StatAtomicFetchOr,
78 StatAtomicFetchXor,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +000079 StatAtomicCAS,
80 StatAtomicFence,
81 StatAtomicRelaxed,
82 StatAtomicConsume,
83 StatAtomicAcquire,
84 StatAtomicRelease,
85 StatAtomicAcq_Rel,
86 StatAtomicSeq_Cst,
87 StatAtomic1,
88 StatAtomic2,
89 StatAtomic4,
90 StatAtomic8,
91
92 // Interceptors.
93 StatInterceptor,
94 StatInt_malloc,
95 StatInt_calloc,
96 StatInt_realloc,
97 StatInt_free,
98 StatInt_cfree,
99 StatInt_mmap,
100 StatInt_mmap64,
101 StatInt_munmap,
102 StatInt_memalign,
103 StatInt_valloc,
104 StatInt_pvalloc,
105 StatInt_posix_memalign,
106 StatInt__Znwm,
107 StatInt__ZnwmRKSt9nothrow_t,
108 StatInt__Znam,
109 StatInt__ZnamRKSt9nothrow_t,
110 StatInt__ZdlPv,
111 StatInt__ZdlPvRKSt9nothrow_t,
112 StatInt__ZdaPv,
113 StatInt__ZdaPvRKSt9nothrow_t,
114 StatInt_strlen,
115 StatInt_memset,
116 StatInt_memcpy,
117 StatInt_strcmp,
118 StatInt_memchr,
119 StatInt_memrchr,
120 StatInt_memmove,
121 StatInt_memcmp,
122 StatInt_strchr,
123 StatInt_strchrnul,
124 StatInt_strrchr,
125 StatInt_strncmp,
126 StatInt_strcpy,
127 StatInt_strncpy,
128 StatInt_strstr,
129 StatInt_atexit,
130 StatInt___cxa_guard_acquire,
131 StatInt___cxa_guard_release,
132 StatInt_pthread_create,
133 StatInt_pthread_join,
134 StatInt_pthread_detach,
135 StatInt_pthread_mutex_init,
136 StatInt_pthread_mutex_destroy,
137 StatInt_pthread_mutex_lock,
138 StatInt_pthread_mutex_trylock,
139 StatInt_pthread_mutex_timedlock,
140 StatInt_pthread_mutex_unlock,
141 StatInt_pthread_spin_init,
142 StatInt_pthread_spin_destroy,
143 StatInt_pthread_spin_lock,
144 StatInt_pthread_spin_trylock,
145 StatInt_pthread_spin_unlock,
146 StatInt_pthread_rwlock_init,
147 StatInt_pthread_rwlock_destroy,
148 StatInt_pthread_rwlock_rdlock,
149 StatInt_pthread_rwlock_tryrdlock,
150 StatInt_pthread_rwlock_timedrdlock,
151 StatInt_pthread_rwlock_wrlock,
152 StatInt_pthread_rwlock_trywrlock,
153 StatInt_pthread_rwlock_timedwrlock,
154 StatInt_pthread_rwlock_unlock,
155 StatInt_pthread_cond_init,
156 StatInt_pthread_cond_destroy,
157 StatInt_pthread_cond_signal,
158 StatInt_pthread_cond_broadcast,
159 StatInt_pthread_cond_wait,
160 StatInt_pthread_cond_timedwait,
161 StatInt_pthread_barrier_init,
162 StatInt_pthread_barrier_destroy,
163 StatInt_pthread_barrier_wait,
164 StatInt_pthread_once,
165 StatInt_sem_init,
166 StatInt_sem_destroy,
167 StatInt_sem_wait,
168 StatInt_sem_trywait,
169 StatInt_sem_timedwait,
170 StatInt_sem_post,
171 StatInt_sem_getvalue,
172 StatInt_read,
173 StatInt_pread,
174 StatInt_pread64,
175 StatInt_readv,
176 StatInt_preadv64,
177 StatInt_write,
178 StatInt_pwrite,
179 StatInt_pwrite64,
180 StatInt_writev,
181 StatInt_pwritev64,
182 StatInt_send,
183 StatInt_sendmsg,
184 StatInt_recv,
185 StatInt_recvmsg,
186 StatInt_unlink,
187 StatInt_fopen,
188 StatInt_fread,
189 StatInt_fwrite,
190 StatInt_puts,
191 StatInt_rmdir,
192 StatInt_opendir,
193 StatInt_epoll_ctl,
194 StatInt_epoll_wait,
195 StatInt_sigaction,
196
197 // Dynamic annotations.
198 StatAnnotation,
199 StatAnnotateHappensBefore,
200 StatAnnotateHappensAfter,
201 StatAnnotateCondVarSignal,
202 StatAnnotateCondVarSignalAll,
203 StatAnnotateMutexIsNotPHB,
204 StatAnnotateCondVarWait,
205 StatAnnotateRWLockCreate,
206 StatAnnotateRWLockDestroy,
207 StatAnnotateRWLockAcquired,
208 StatAnnotateRWLockReleased,
209 StatAnnotateTraceMemory,
210 StatAnnotateFlushState,
211 StatAnnotateNewMemory,
212 StatAnnotateNoOp,
213 StatAnnotateFlushExpectedRaces,
214 StatAnnotateEnableRaceDetection,
215 StatAnnotateMutexIsUsedAsCondVar,
216 StatAnnotatePCQGet,
217 StatAnnotatePCQPut,
218 StatAnnotatePCQDestroy,
219 StatAnnotatePCQCreate,
220 StatAnnotateExpectRace,
221 StatAnnotateBenignRaceSized,
222 StatAnnotateBenignRace,
223 StatAnnotateIgnoreReadsBegin,
224 StatAnnotateIgnoreReadsEnd,
225 StatAnnotateIgnoreWritesBegin,
226 StatAnnotateIgnoreWritesEnd,
227 StatAnnotatePublishMemoryRange,
228 StatAnnotateUnpublishMemoryRange,
229 StatAnnotateThreadName,
230
231 // Internal mutex contentionz.
232 StatMtxTotal,
233 StatMtxTrace,
234 StatMtxThreads,
235 StatMtxReport,
236 StatMtxSyncVar,
237 StatMtxSyncTab,
238 StatMtxSlab,
239 StatMtxAnnotations,
240 StatMtxAtExit,
241
242 // This must be the last.
243 StatCnt,
244};
245
246} // namespace __tsan
247
248#endif // TSAN_STAT_H