blob: e4362b034b100536576852b4f0a19466779a6057 [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,
Alexey Samsonov85f0a7e2013-02-25 08:43:10 +0000105 StatInt_malloc_usable_size,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000106 StatInt_mmap,
107 StatInt_mmap64,
108 StatInt_munmap,
109 StatInt_memalign,
110 StatInt_valloc,
111 StatInt_pvalloc,
112 StatInt_posix_memalign,
113 StatInt__Znwm,
114 StatInt__ZnwmRKSt9nothrow_t,
115 StatInt__Znam,
116 StatInt__ZnamRKSt9nothrow_t,
117 StatInt__ZdlPv,
118 StatInt__ZdlPvRKSt9nothrow_t,
119 StatInt__ZdaPv,
120 StatInt__ZdaPvRKSt9nothrow_t,
121 StatInt_strlen,
122 StatInt_memset,
123 StatInt_memcpy,
124 StatInt_strcmp,
125 StatInt_memchr,
126 StatInt_memrchr,
127 StatInt_memmove,
128 StatInt_memcmp,
129 StatInt_strchr,
130 StatInt_strchrnul,
131 StatInt_strrchr,
132 StatInt_strncmp,
133 StatInt_strcpy,
134 StatInt_strncpy,
135 StatInt_strstr,
136 StatInt_atexit,
137 StatInt___cxa_guard_acquire,
138 StatInt___cxa_guard_release,
Dmitry Vyukovc446aa02012-12-05 12:10:22 +0000139 StatInt___cxa_guard_abort,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000140 StatInt_pthread_create,
141 StatInt_pthread_join,
142 StatInt_pthread_detach,
143 StatInt_pthread_mutex_init,
144 StatInt_pthread_mutex_destroy,
145 StatInt_pthread_mutex_lock,
146 StatInt_pthread_mutex_trylock,
147 StatInt_pthread_mutex_timedlock,
148 StatInt_pthread_mutex_unlock,
149 StatInt_pthread_spin_init,
150 StatInt_pthread_spin_destroy,
151 StatInt_pthread_spin_lock,
152 StatInt_pthread_spin_trylock,
153 StatInt_pthread_spin_unlock,
154 StatInt_pthread_rwlock_init,
155 StatInt_pthread_rwlock_destroy,
156 StatInt_pthread_rwlock_rdlock,
157 StatInt_pthread_rwlock_tryrdlock,
158 StatInt_pthread_rwlock_timedrdlock,
159 StatInt_pthread_rwlock_wrlock,
160 StatInt_pthread_rwlock_trywrlock,
161 StatInt_pthread_rwlock_timedwrlock,
162 StatInt_pthread_rwlock_unlock,
163 StatInt_pthread_cond_init,
164 StatInt_pthread_cond_destroy,
165 StatInt_pthread_cond_signal,
166 StatInt_pthread_cond_broadcast,
167 StatInt_pthread_cond_wait,
168 StatInt_pthread_cond_timedwait,
169 StatInt_pthread_barrier_init,
170 StatInt_pthread_barrier_destroy,
171 StatInt_pthread_barrier_wait,
172 StatInt_pthread_once,
173 StatInt_sem_init,
174 StatInt_sem_destroy,
175 StatInt_sem_wait,
176 StatInt_sem_trywait,
177 StatInt_sem_timedwait,
178 StatInt_sem_post,
179 StatInt_sem_getvalue,
Dmitry Vyukovb130fc32013-01-29 09:23:09 +0000180 StatInt_stat,
181 StatInt___xstat,
182 StatInt_stat64,
183 StatInt___xstat64,
184 StatInt_lstat,
185 StatInt___lxstat,
186 StatInt_lstat64,
187 StatInt___lxstat64,
188 StatInt_fstat,
189 StatInt___fxstat,
190 StatInt_fstat64,
191 StatInt___fxstat64,
Dmitry Vyukov04580512012-12-07 18:30:40 +0000192 StatInt_open,
Dmitry Vyukov60c14ce2012-12-12 11:59:30 +0000193 StatInt_open64,
Dmitry Vyukov04580512012-12-07 18:30:40 +0000194 StatInt_creat,
Dmitry Vyukov60c14ce2012-12-12 11:59:30 +0000195 StatInt_creat64,
Dmitry Vyukov04580512012-12-07 18:30:40 +0000196 StatInt_dup,
197 StatInt_dup2,
198 StatInt_dup3,
Dmitry Vyukov54b87402012-12-07 19:23:59 +0000199 StatInt_eventfd,
Dmitry Vyukovd5091792012-12-18 12:35:31 +0000200 StatInt_signalfd,
201 StatInt_inotify_init,
202 StatInt_inotify_init1,
Dmitry Vyukov54b87402012-12-07 19:23:59 +0000203 StatInt_socket,
Dmitry Vyukove0c37642012-12-14 09:57:42 +0000204 StatInt_socketpair,
Dmitry Vyukov54b87402012-12-07 19:23:59 +0000205 StatInt_connect,
Dmitry Vyukov606de602013-02-04 08:06:32 +0000206 StatInt_bind,
207 StatInt_listen,
Dmitry Vyukov54b87402012-12-07 19:23:59 +0000208 StatInt_accept,
209 StatInt_accept4,
210 StatInt_epoll_create,
211 StatInt_epoll_create1,
Dmitry Vyukov4e7c0f92012-12-07 15:32:56 +0000212 StatInt_close,
Dmitry Vyukov60c14ce2012-12-12 11:59:30 +0000213 StatInt___close,
Dmitry Vyukoveffd98b2013-02-07 15:27:45 +0000214 StatInt___res_iclose,
Dmitry Vyukov4e7c0f92012-12-07 15:32:56 +0000215 StatInt_pipe,
216 StatInt_pipe2,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000217 StatInt_read,
Kostya Serebryany69fe0ba2013-01-18 06:43:13 +0000218 StatInt_prctl,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000219 StatInt_pread,
220 StatInt_pread64,
221 StatInt_readv,
222 StatInt_preadv64,
223 StatInt_write,
224 StatInt_pwrite,
225 StatInt_pwrite64,
226 StatInt_writev,
227 StatInt_pwritev64,
228 StatInt_send,
229 StatInt_sendmsg,
230 StatInt_recv,
231 StatInt_recvmsg,
232 StatInt_unlink,
233 StatInt_fopen,
Dmitry Vyukov60c14ce2012-12-12 11:59:30 +0000234 StatInt_freopen,
235 StatInt_fclose,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000236 StatInt_fread,
237 StatInt_fwrite,
238 StatInt_puts,
239 StatInt_rmdir,
240 StatInt_opendir,
241 StatInt_epoll_ctl,
242 StatInt_epoll_wait,
Dmitry Vyukov262465c2012-11-15 17:40:49 +0000243 StatInt_poll,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000244 StatInt_sigaction,
Dmitry Vyukov98953b72012-05-21 08:26:51 +0000245 StatInt_signal,
246 StatInt_raise,
247 StatInt_kill,
248 StatInt_pthread_kill,
Dmitry Vyukov318f7772012-08-31 17:27:49 +0000249 StatInt_sleep,
250 StatInt_usleep,
251 StatInt_nanosleep,
Dmitry Vyukov317f3922012-11-09 19:55:06 +0000252 StatInt_gettimeofday,
Dmitry Vyukov44e1beae2012-12-18 14:44:44 +0000253 StatInt_fork,
Evgeniy Stepanov222076e2013-01-18 11:17:23 +0000254 StatInt_vscanf,
255 StatInt_vsscanf,
256 StatInt_vfscanf,
257 StatInt_scanf,
258 StatInt_sscanf,
259 StatInt_fscanf,
Evgeniy Stepanovd8cfb992013-02-12 12:02:49 +0000260 StatInt___isoc99_vscanf,
261 StatInt___isoc99_vsscanf,
262 StatInt___isoc99_vfscanf,
263 StatInt___isoc99_scanf,
264 StatInt___isoc99_sscanf,
265 StatInt___isoc99_fscanf,
Dmitry Vyukov4399d922013-01-29 13:05:30 +0000266 StatInt_on_exit,
267 StatInt___cxa_atexit,
Evgeniy Stepanovea61d082013-02-19 09:19:16 +0000268 StatInt_localtime,
269 StatInt_localtime_r,
270 StatInt_gmtime,
271 StatInt_gmtime_r,
272 StatInt_ctime,
273 StatInt_ctime_r,
274 StatInt_asctime,
275 StatInt_asctime_r,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000276
277 // Dynamic annotations.
278 StatAnnotation,
279 StatAnnotateHappensBefore,
280 StatAnnotateHappensAfter,
281 StatAnnotateCondVarSignal,
282 StatAnnotateCondVarSignalAll,
283 StatAnnotateMutexIsNotPHB,
284 StatAnnotateCondVarWait,
285 StatAnnotateRWLockCreate,
Dmitry Vyukov4723e6b2012-08-16 13:29:41 +0000286 StatAnnotateRWLockCreateStatic,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000287 StatAnnotateRWLockDestroy,
288 StatAnnotateRWLockAcquired,
289 StatAnnotateRWLockReleased,
290 StatAnnotateTraceMemory,
291 StatAnnotateFlushState,
292 StatAnnotateNewMemory,
293 StatAnnotateNoOp,
294 StatAnnotateFlushExpectedRaces,
295 StatAnnotateEnableRaceDetection,
296 StatAnnotateMutexIsUsedAsCondVar,
297 StatAnnotatePCQGet,
298 StatAnnotatePCQPut,
299 StatAnnotatePCQDestroy,
300 StatAnnotatePCQCreate,
301 StatAnnotateExpectRace,
302 StatAnnotateBenignRaceSized,
303 StatAnnotateBenignRace,
304 StatAnnotateIgnoreReadsBegin,
305 StatAnnotateIgnoreReadsEnd,
306 StatAnnotateIgnoreWritesBegin,
307 StatAnnotateIgnoreWritesEnd,
308 StatAnnotatePublishMemoryRange,
309 StatAnnotateUnpublishMemoryRange,
310 StatAnnotateThreadName,
311
312 // Internal mutex contentionz.
313 StatMtxTotal,
314 StatMtxTrace,
315 StatMtxThreads,
316 StatMtxReport,
317 StatMtxSyncVar,
318 StatMtxSyncTab,
319 StatMtxSlab,
320 StatMtxAnnotations,
321 StatMtxAtExit,
Dmitry Vyukovfd5ebcd2012-12-06 12:16:15 +0000322 StatMtxMBlock,
Dmitry Vyukov22be55e2012-12-21 11:30:14 +0000323 StatMtxJavaMBlock,
Dmitry Vyukov606de602013-02-04 08:06:32 +0000324 StatMtxFD,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000325
326 // This must be the last.
Alexey Samsonov046248c2012-09-13 11:54:41 +0000327 StatCnt
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000328};
329
330} // namespace __tsan
331
332#endif // TSAN_STAT_H