blob: cc8b088a6889df18265be9820a02ba1bea991c77 [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 Vyukovb96a7b52012-10-04 10:08:23 +000076 StatAtomicFetchSub,
Dmitry Vyukov572c5b22012-05-14 15:33:00 +000077 StatAtomicFetchAnd,
78 StatAtomicFetchOr,
79 StatAtomicFetchXor,
Dmitry Vyukov3b450122012-11-26 09:42:56 +000080 StatAtomicFetchNand,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +000081 StatAtomicCAS,
82 StatAtomicFence,
83 StatAtomicRelaxed,
84 StatAtomicConsume,
85 StatAtomicAcquire,
86 StatAtomicRelease,
87 StatAtomicAcq_Rel,
88 StatAtomicSeq_Cst,
89 StatAtomic1,
90 StatAtomic2,
91 StatAtomic4,
92 StatAtomic8,
Dmitry Vyukov59d58662012-11-27 07:41:27 +000093 StatAtomic16,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +000094
95 // Interceptors.
96 StatInterceptor,
Dmitry Vyukov95a5c5c2012-05-31 18:03:59 +000097 StatInt_longjmp,
98 StatInt_siglongjmp,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +000099 StatInt_malloc,
Dmitry Vyukov1450ac62012-11-30 17:27:58 +0000100 StatInt___libc_memalign,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000101 StatInt_calloc,
102 StatInt_realloc,
103 StatInt_free,
104 StatInt_cfree,
105 StatInt_mmap,
106 StatInt_mmap64,
107 StatInt_munmap,
108 StatInt_memalign,
109 StatInt_valloc,
110 StatInt_pvalloc,
111 StatInt_posix_memalign,
112 StatInt__Znwm,
113 StatInt__ZnwmRKSt9nothrow_t,
114 StatInt__Znam,
115 StatInt__ZnamRKSt9nothrow_t,
116 StatInt__ZdlPv,
117 StatInt__ZdlPvRKSt9nothrow_t,
118 StatInt__ZdaPv,
119 StatInt__ZdaPvRKSt9nothrow_t,
120 StatInt_strlen,
121 StatInt_memset,
122 StatInt_memcpy,
123 StatInt_strcmp,
124 StatInt_memchr,
125 StatInt_memrchr,
126 StatInt_memmove,
127 StatInt_memcmp,
128 StatInt_strchr,
129 StatInt_strchrnul,
130 StatInt_strrchr,
131 StatInt_strncmp,
132 StatInt_strcpy,
133 StatInt_strncpy,
134 StatInt_strstr,
135 StatInt_atexit,
136 StatInt___cxa_guard_acquire,
137 StatInt___cxa_guard_release,
138 StatInt_pthread_create,
139 StatInt_pthread_join,
140 StatInt_pthread_detach,
141 StatInt_pthread_mutex_init,
142 StatInt_pthread_mutex_destroy,
143 StatInt_pthread_mutex_lock,
144 StatInt_pthread_mutex_trylock,
145 StatInt_pthread_mutex_timedlock,
146 StatInt_pthread_mutex_unlock,
147 StatInt_pthread_spin_init,
148 StatInt_pthread_spin_destroy,
149 StatInt_pthread_spin_lock,
150 StatInt_pthread_spin_trylock,
151 StatInt_pthread_spin_unlock,
152 StatInt_pthread_rwlock_init,
153 StatInt_pthread_rwlock_destroy,
154 StatInt_pthread_rwlock_rdlock,
155 StatInt_pthread_rwlock_tryrdlock,
156 StatInt_pthread_rwlock_timedrdlock,
157 StatInt_pthread_rwlock_wrlock,
158 StatInt_pthread_rwlock_trywrlock,
159 StatInt_pthread_rwlock_timedwrlock,
160 StatInt_pthread_rwlock_unlock,
161 StatInt_pthread_cond_init,
162 StatInt_pthread_cond_destroy,
163 StatInt_pthread_cond_signal,
164 StatInt_pthread_cond_broadcast,
165 StatInt_pthread_cond_wait,
166 StatInt_pthread_cond_timedwait,
167 StatInt_pthread_barrier_init,
168 StatInt_pthread_barrier_destroy,
169 StatInt_pthread_barrier_wait,
170 StatInt_pthread_once,
171 StatInt_sem_init,
172 StatInt_sem_destroy,
173 StatInt_sem_wait,
174 StatInt_sem_trywait,
175 StatInt_sem_timedwait,
176 StatInt_sem_post,
177 StatInt_sem_getvalue,
178 StatInt_read,
179 StatInt_pread,
180 StatInt_pread64,
181 StatInt_readv,
182 StatInt_preadv64,
183 StatInt_write,
184 StatInt_pwrite,
185 StatInt_pwrite64,
186 StatInt_writev,
187 StatInt_pwritev64,
188 StatInt_send,
189 StatInt_sendmsg,
190 StatInt_recv,
191 StatInt_recvmsg,
192 StatInt_unlink,
193 StatInt_fopen,
194 StatInt_fread,
195 StatInt_fwrite,
196 StatInt_puts,
197 StatInt_rmdir,
198 StatInt_opendir,
199 StatInt_epoll_ctl,
200 StatInt_epoll_wait,
Dmitry Vyukov262465c2012-11-15 17:40:49 +0000201 StatInt_poll,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000202 StatInt_sigaction,
Dmitry Vyukov98953b72012-05-21 08:26:51 +0000203 StatInt_signal,
204 StatInt_raise,
205 StatInt_kill,
206 StatInt_pthread_kill,
Dmitry Vyukov318f7772012-08-31 17:27:49 +0000207 StatInt_sleep,
208 StatInt_usleep,
209 StatInt_nanosleep,
Dmitry Vyukov317f3922012-11-09 19:55:06 +0000210 StatInt_gettimeofday,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000211
212 // Dynamic annotations.
213 StatAnnotation,
214 StatAnnotateHappensBefore,
215 StatAnnotateHappensAfter,
216 StatAnnotateCondVarSignal,
217 StatAnnotateCondVarSignalAll,
218 StatAnnotateMutexIsNotPHB,
219 StatAnnotateCondVarWait,
220 StatAnnotateRWLockCreate,
Dmitry Vyukov4723e6b2012-08-16 13:29:41 +0000221 StatAnnotateRWLockCreateStatic,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000222 StatAnnotateRWLockDestroy,
223 StatAnnotateRWLockAcquired,
224 StatAnnotateRWLockReleased,
225 StatAnnotateTraceMemory,
226 StatAnnotateFlushState,
227 StatAnnotateNewMemory,
228 StatAnnotateNoOp,
229 StatAnnotateFlushExpectedRaces,
230 StatAnnotateEnableRaceDetection,
231 StatAnnotateMutexIsUsedAsCondVar,
232 StatAnnotatePCQGet,
233 StatAnnotatePCQPut,
234 StatAnnotatePCQDestroy,
235 StatAnnotatePCQCreate,
236 StatAnnotateExpectRace,
237 StatAnnotateBenignRaceSized,
238 StatAnnotateBenignRace,
239 StatAnnotateIgnoreReadsBegin,
240 StatAnnotateIgnoreReadsEnd,
241 StatAnnotateIgnoreWritesBegin,
242 StatAnnotateIgnoreWritesEnd,
243 StatAnnotatePublishMemoryRange,
244 StatAnnotateUnpublishMemoryRange,
245 StatAnnotateThreadName,
246
247 // Internal mutex contentionz.
248 StatMtxTotal,
249 StatMtxTrace,
250 StatMtxThreads,
251 StatMtxReport,
252 StatMtxSyncVar,
253 StatMtxSyncTab,
254 StatMtxSlab,
255 StatMtxAnnotations,
256 StatMtxAtExit,
257
258 // This must be the last.
Alexey Samsonov046248c2012-09-13 11:54:41 +0000259 StatCnt
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000260};
261
262} // namespace __tsan
263
264#endif // TSAN_STAT_H