blob: 4d8c61c7b16d1bc95fb5c34a7172f22f77aa76ee [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,
Dmitry Vyukovb62c1582013-03-20 13:21:50 +000030 StatMopRodata,
31 StatMopRangeRodata,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +000032 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 // Atomics.
73 StatAtomic,
74 StatAtomicLoad,
75 StatAtomicStore,
76 StatAtomicExchange,
77 StatAtomicFetchAdd,
Dmitry Vyukovb96a7b52012-10-04 10:08:23 +000078 StatAtomicFetchSub,
Dmitry Vyukov572c5b22012-05-14 15:33:00 +000079 StatAtomicFetchAnd,
80 StatAtomicFetchOr,
81 StatAtomicFetchXor,
Dmitry Vyukov3b450122012-11-26 09:42:56 +000082 StatAtomicFetchNand,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +000083 StatAtomicCAS,
84 StatAtomicFence,
85 StatAtomicRelaxed,
86 StatAtomicConsume,
87 StatAtomicAcquire,
88 StatAtomicRelease,
89 StatAtomicAcq_Rel,
90 StatAtomicSeq_Cst,
91 StatAtomic1,
92 StatAtomic2,
93 StatAtomic4,
94 StatAtomic8,
Dmitry Vyukov59d58662012-11-27 07:41:27 +000095 StatAtomic16,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +000096
97 // Interceptors.
98 StatInterceptor,
Dmitry Vyukov95a5c5c2012-05-31 18:03:59 +000099 StatInt_longjmp,
100 StatInt_siglongjmp,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000101 StatInt_malloc,
Dmitry Vyukov1450ac62012-11-30 17:27:58 +0000102 StatInt___libc_memalign,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000103 StatInt_calloc,
104 StatInt_realloc,
105 StatInt_free,
106 StatInt_cfree,
Alexey Samsonov85f0a7e2013-02-25 08:43:10 +0000107 StatInt_malloc_usable_size,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000108 StatInt_mmap,
109 StatInt_mmap64,
110 StatInt_munmap,
111 StatInt_memalign,
112 StatInt_valloc,
113 StatInt_pvalloc,
114 StatInt_posix_memalign,
115 StatInt__Znwm,
116 StatInt__ZnwmRKSt9nothrow_t,
117 StatInt__Znam,
118 StatInt__ZnamRKSt9nothrow_t,
119 StatInt__ZdlPv,
120 StatInt__ZdlPvRKSt9nothrow_t,
121 StatInt__ZdaPv,
122 StatInt__ZdaPvRKSt9nothrow_t,
123 StatInt_strlen,
124 StatInt_memset,
125 StatInt_memcpy,
126 StatInt_strcmp,
127 StatInt_memchr,
128 StatInt_memrchr,
129 StatInt_memmove,
130 StatInt_memcmp,
131 StatInt_strchr,
132 StatInt_strchrnul,
133 StatInt_strrchr,
134 StatInt_strncmp,
135 StatInt_strcpy,
136 StatInt_strncpy,
137 StatInt_strstr,
138 StatInt_atexit,
139 StatInt___cxa_guard_acquire,
140 StatInt___cxa_guard_release,
Dmitry Vyukovc446aa02012-12-05 12:10:22 +0000141 StatInt___cxa_guard_abort,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000142 StatInt_pthread_create,
143 StatInt_pthread_join,
144 StatInt_pthread_detach,
145 StatInt_pthread_mutex_init,
146 StatInt_pthread_mutex_destroy,
147 StatInt_pthread_mutex_lock,
148 StatInt_pthread_mutex_trylock,
149 StatInt_pthread_mutex_timedlock,
150 StatInt_pthread_mutex_unlock,
151 StatInt_pthread_spin_init,
152 StatInt_pthread_spin_destroy,
153 StatInt_pthread_spin_lock,
154 StatInt_pthread_spin_trylock,
155 StatInt_pthread_spin_unlock,
156 StatInt_pthread_rwlock_init,
157 StatInt_pthread_rwlock_destroy,
158 StatInt_pthread_rwlock_rdlock,
159 StatInt_pthread_rwlock_tryrdlock,
160 StatInt_pthread_rwlock_timedrdlock,
161 StatInt_pthread_rwlock_wrlock,
162 StatInt_pthread_rwlock_trywrlock,
163 StatInt_pthread_rwlock_timedwrlock,
164 StatInt_pthread_rwlock_unlock,
165 StatInt_pthread_cond_init,
166 StatInt_pthread_cond_destroy,
167 StatInt_pthread_cond_signal,
168 StatInt_pthread_cond_broadcast,
169 StatInt_pthread_cond_wait,
170 StatInt_pthread_cond_timedwait,
171 StatInt_pthread_barrier_init,
172 StatInt_pthread_barrier_destroy,
173 StatInt_pthread_barrier_wait,
174 StatInt_pthread_once,
175 StatInt_sem_init,
176 StatInt_sem_destroy,
177 StatInt_sem_wait,
178 StatInt_sem_trywait,
179 StatInt_sem_timedwait,
180 StatInt_sem_post,
181 StatInt_sem_getvalue,
Dmitry Vyukovb130fc32013-01-29 09:23:09 +0000182 StatInt_stat,
183 StatInt___xstat,
184 StatInt_stat64,
185 StatInt___xstat64,
186 StatInt_lstat,
187 StatInt___lxstat,
188 StatInt_lstat64,
189 StatInt___lxstat64,
190 StatInt_fstat,
191 StatInt___fxstat,
192 StatInt_fstat64,
193 StatInt___fxstat64,
Dmitry Vyukov04580512012-12-07 18:30:40 +0000194 StatInt_open,
Dmitry Vyukov60c14ce2012-12-12 11:59:30 +0000195 StatInt_open64,
Dmitry Vyukov04580512012-12-07 18:30:40 +0000196 StatInt_creat,
Dmitry Vyukov60c14ce2012-12-12 11:59:30 +0000197 StatInt_creat64,
Dmitry Vyukov04580512012-12-07 18:30:40 +0000198 StatInt_dup,
199 StatInt_dup2,
200 StatInt_dup3,
Dmitry Vyukov54b87402012-12-07 19:23:59 +0000201 StatInt_eventfd,
Dmitry Vyukovd5091792012-12-18 12:35:31 +0000202 StatInt_signalfd,
203 StatInt_inotify_init,
204 StatInt_inotify_init1,
Dmitry Vyukov54b87402012-12-07 19:23:59 +0000205 StatInt_socket,
Dmitry Vyukove0c37642012-12-14 09:57:42 +0000206 StatInt_socketpair,
Dmitry Vyukov54b87402012-12-07 19:23:59 +0000207 StatInt_connect,
Dmitry Vyukov606de602013-02-04 08:06:32 +0000208 StatInt_bind,
209 StatInt_listen,
Dmitry Vyukov54b87402012-12-07 19:23:59 +0000210 StatInt_accept,
211 StatInt_accept4,
212 StatInt_epoll_create,
213 StatInt_epoll_create1,
Dmitry Vyukov4e7c0f92012-12-07 15:32:56 +0000214 StatInt_close,
Dmitry Vyukov60c14ce2012-12-12 11:59:30 +0000215 StatInt___close,
Dmitry Vyukoveffd98b2013-02-07 15:27:45 +0000216 StatInt___res_iclose,
Dmitry Vyukov4e7c0f92012-12-07 15:32:56 +0000217 StatInt_pipe,
218 StatInt_pipe2,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000219 StatInt_read,
Kostya Serebryany69fe0ba2013-01-18 06:43:13 +0000220 StatInt_prctl,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000221 StatInt_pread,
222 StatInt_pread64,
223 StatInt_readv,
224 StatInt_preadv64,
225 StatInt_write,
226 StatInt_pwrite,
227 StatInt_pwrite64,
228 StatInt_writev,
229 StatInt_pwritev64,
230 StatInt_send,
231 StatInt_sendmsg,
232 StatInt_recv,
233 StatInt_recvmsg,
234 StatInt_unlink,
235 StatInt_fopen,
Dmitry Vyukov60c14ce2012-12-12 11:59:30 +0000236 StatInt_freopen,
237 StatInt_fclose,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000238 StatInt_fread,
239 StatInt_fwrite,
240 StatInt_puts,
241 StatInt_rmdir,
242 StatInt_opendir,
243 StatInt_epoll_ctl,
244 StatInt_epoll_wait,
Dmitry Vyukov262465c2012-11-15 17:40:49 +0000245 StatInt_poll,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000246 StatInt_sigaction,
Dmitry Vyukov98953b72012-05-21 08:26:51 +0000247 StatInt_signal,
248 StatInt_raise,
249 StatInt_kill,
250 StatInt_pthread_kill,
Dmitry Vyukov318f7772012-08-31 17:27:49 +0000251 StatInt_sleep,
252 StatInt_usleep,
253 StatInt_nanosleep,
Dmitry Vyukov317f3922012-11-09 19:55:06 +0000254 StatInt_gettimeofday,
Dmitry Vyukov44e1beae2012-12-18 14:44:44 +0000255 StatInt_fork,
Evgeniy Stepanov222076e2013-01-18 11:17:23 +0000256 StatInt_vscanf,
257 StatInt_vsscanf,
258 StatInt_vfscanf,
259 StatInt_scanf,
260 StatInt_sscanf,
261 StatInt_fscanf,
Evgeniy Stepanovd8cfb992013-02-12 12:02:49 +0000262 StatInt___isoc99_vscanf,
263 StatInt___isoc99_vsscanf,
264 StatInt___isoc99_vfscanf,
265 StatInt___isoc99_scanf,
266 StatInt___isoc99_sscanf,
267 StatInt___isoc99_fscanf,
Dmitry Vyukov4399d922013-01-29 13:05:30 +0000268 StatInt_on_exit,
269 StatInt___cxa_atexit,
Evgeniy Stepanovea61d082013-02-19 09:19:16 +0000270 StatInt_localtime,
271 StatInt_localtime_r,
272 StatInt_gmtime,
273 StatInt_gmtime_r,
274 StatInt_ctime,
275 StatInt_ctime_r,
276 StatInt_asctime,
277 StatInt_asctime_r,
Evgeniy Stepanov231894a2013-03-14 11:34:39 +0000278 StatInt_frexp,
279 StatInt_frexpf,
280 StatInt_frexpl,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000281
282 // Dynamic annotations.
283 StatAnnotation,
284 StatAnnotateHappensBefore,
285 StatAnnotateHappensAfter,
286 StatAnnotateCondVarSignal,
287 StatAnnotateCondVarSignalAll,
288 StatAnnotateMutexIsNotPHB,
289 StatAnnotateCondVarWait,
290 StatAnnotateRWLockCreate,
Dmitry Vyukov4723e6b2012-08-16 13:29:41 +0000291 StatAnnotateRWLockCreateStatic,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000292 StatAnnotateRWLockDestroy,
293 StatAnnotateRWLockAcquired,
294 StatAnnotateRWLockReleased,
295 StatAnnotateTraceMemory,
296 StatAnnotateFlushState,
297 StatAnnotateNewMemory,
298 StatAnnotateNoOp,
299 StatAnnotateFlushExpectedRaces,
300 StatAnnotateEnableRaceDetection,
301 StatAnnotateMutexIsUsedAsCondVar,
302 StatAnnotatePCQGet,
303 StatAnnotatePCQPut,
304 StatAnnotatePCQDestroy,
305 StatAnnotatePCQCreate,
306 StatAnnotateExpectRace,
307 StatAnnotateBenignRaceSized,
308 StatAnnotateBenignRace,
309 StatAnnotateIgnoreReadsBegin,
310 StatAnnotateIgnoreReadsEnd,
311 StatAnnotateIgnoreWritesBegin,
312 StatAnnotateIgnoreWritesEnd,
313 StatAnnotatePublishMemoryRange,
314 StatAnnotateUnpublishMemoryRange,
315 StatAnnotateThreadName,
316
317 // Internal mutex contentionz.
318 StatMtxTotal,
319 StatMtxTrace,
320 StatMtxThreads,
321 StatMtxReport,
322 StatMtxSyncVar,
323 StatMtxSyncTab,
324 StatMtxSlab,
325 StatMtxAnnotations,
326 StatMtxAtExit,
Dmitry Vyukovfd5ebcd2012-12-06 12:16:15 +0000327 StatMtxMBlock,
Dmitry Vyukov22be55e2012-12-21 11:30:14 +0000328 StatMtxJavaMBlock,
Dmitry Vyukov606de602013-02-04 08:06:32 +0000329 StatMtxFD,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000330
331 // This must be the last.
Alexey Samsonov046248c2012-09-13 11:54:41 +0000332 StatCnt
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000333};
334
335} // namespace __tsan
336
337#endif // TSAN_STAT_H