blob: d44aaa5e4c60acf7c3cdaf3ee33248c77946726d [file] [log] [blame]
Kostya Serebryany7ac41482012-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 Vyukov82dbc512013-03-20 13:21:50 +000030 StatMopRodata,
31 StatMopRangeRodata,
Kostya Serebryany7ac41482012-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 Vyukov529cfa02012-10-04 10:08:23 +000078 StatAtomicFetchSub,
Dmitry Vyukovcdfb33a2012-05-14 15:33:00 +000079 StatAtomicFetchAnd,
80 StatAtomicFetchOr,
81 StatAtomicFetchXor,
Dmitry Vyukov02b45d22012-11-26 09:42:56 +000082 StatAtomicFetchNand,
Kostya Serebryany7ac41482012-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 Vyukov63da5092012-11-27 07:41:27 +000095 StatAtomic16,
Kostya Serebryany7ac41482012-05-10 13:48:04 +000096
97 // Interceptors.
98 StatInterceptor,
Dmitry Vyukovf037f562012-05-31 18:03:59 +000099 StatInt_longjmp,
100 StatInt_siglongjmp,
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000101 StatInt_malloc,
Dmitry Vyukov07ba8ef2012-11-30 17:27:58 +0000102 StatInt___libc_memalign,
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000103 StatInt_calloc,
104 StatInt_realloc,
105 StatInt_free,
106 StatInt_cfree,
Alexey Samsonov8a6b5e52013-02-25 08:43:10 +0000107 StatInt_malloc_usable_size,
Kostya Serebryany7ac41482012-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,
Dmitry Vyukovbe523662013-03-26 12:40:23 +0000137 StatInt_strcasecmp,
138 StatInt_strncasecmp,
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000139 StatInt_strstr,
140 StatInt_atexit,
141 StatInt___cxa_guard_acquire,
142 StatInt___cxa_guard_release,
Dmitry Vyukov1ffeded2012-12-05 12:10:22 +0000143 StatInt___cxa_guard_abort,
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000144 StatInt_pthread_create,
145 StatInt_pthread_join,
146 StatInt_pthread_detach,
147 StatInt_pthread_mutex_init,
148 StatInt_pthread_mutex_destroy,
149 StatInt_pthread_mutex_lock,
150 StatInt_pthread_mutex_trylock,
151 StatInt_pthread_mutex_timedlock,
152 StatInt_pthread_mutex_unlock,
153 StatInt_pthread_spin_init,
154 StatInt_pthread_spin_destroy,
155 StatInt_pthread_spin_lock,
156 StatInt_pthread_spin_trylock,
157 StatInt_pthread_spin_unlock,
158 StatInt_pthread_rwlock_init,
159 StatInt_pthread_rwlock_destroy,
160 StatInt_pthread_rwlock_rdlock,
161 StatInt_pthread_rwlock_tryrdlock,
162 StatInt_pthread_rwlock_timedrdlock,
163 StatInt_pthread_rwlock_wrlock,
164 StatInt_pthread_rwlock_trywrlock,
165 StatInt_pthread_rwlock_timedwrlock,
166 StatInt_pthread_rwlock_unlock,
167 StatInt_pthread_cond_init,
168 StatInt_pthread_cond_destroy,
169 StatInt_pthread_cond_signal,
170 StatInt_pthread_cond_broadcast,
171 StatInt_pthread_cond_wait,
172 StatInt_pthread_cond_timedwait,
173 StatInt_pthread_barrier_init,
174 StatInt_pthread_barrier_destroy,
175 StatInt_pthread_barrier_wait,
176 StatInt_pthread_once,
Evgeniy Stepanov56d34722013-05-21 08:12:08 +0000177 StatInt_pthread_getschedparam,
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000178 StatInt_sem_init,
179 StatInt_sem_destroy,
180 StatInt_sem_wait,
181 StatInt_sem_trywait,
182 StatInt_sem_timedwait,
183 StatInt_sem_post,
184 StatInt_sem_getvalue,
Dmitry Vyukov61ba1b52013-01-29 09:23:09 +0000185 StatInt_stat,
186 StatInt___xstat,
187 StatInt_stat64,
188 StatInt___xstat64,
189 StatInt_lstat,
190 StatInt___lxstat,
191 StatInt_lstat64,
192 StatInt___lxstat64,
193 StatInt_fstat,
194 StatInt___fxstat,
195 StatInt_fstat64,
196 StatInt___fxstat64,
Dmitry Vyukovba3ae352012-12-07 18:30:40 +0000197 StatInt_open,
Dmitry Vyukovc78839f2012-12-12 11:59:30 +0000198 StatInt_open64,
Dmitry Vyukovba3ae352012-12-07 18:30:40 +0000199 StatInt_creat,
Dmitry Vyukovc78839f2012-12-12 11:59:30 +0000200 StatInt_creat64,
Dmitry Vyukovba3ae352012-12-07 18:30:40 +0000201 StatInt_dup,
202 StatInt_dup2,
203 StatInt_dup3,
Dmitry Vyukov68230a12012-12-07 19:23:59 +0000204 StatInt_eventfd,
Dmitry Vyukov45d43242012-12-18 12:35:31 +0000205 StatInt_signalfd,
206 StatInt_inotify_init,
207 StatInt_inotify_init1,
Dmitry Vyukov68230a12012-12-07 19:23:59 +0000208 StatInt_socket,
Dmitry Vyukov983518e2012-12-14 09:57:42 +0000209 StatInt_socketpair,
Dmitry Vyukov68230a12012-12-07 19:23:59 +0000210 StatInt_connect,
Dmitry Vyukov52c70e52013-02-04 08:06:32 +0000211 StatInt_bind,
212 StatInt_listen,
Dmitry Vyukov68230a12012-12-07 19:23:59 +0000213 StatInt_accept,
214 StatInt_accept4,
215 StatInt_epoll_create,
216 StatInt_epoll_create1,
Dmitry Vyukovddeb2c32012-12-07 15:32:56 +0000217 StatInt_close,
Dmitry Vyukovc78839f2012-12-12 11:59:30 +0000218 StatInt___close,
Dmitry Vyukov03f22482013-02-07 15:27:45 +0000219 StatInt___res_iclose,
Dmitry Vyukovddeb2c32012-12-07 15:32:56 +0000220 StatInt_pipe,
221 StatInt_pipe2,
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000222 StatInt_read,
Kostya Serebryanyc20b3212013-01-18 06:43:13 +0000223 StatInt_prctl,
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000224 StatInt_pread,
225 StatInt_pread64,
226 StatInt_readv,
227 StatInt_preadv64,
228 StatInt_write,
229 StatInt_pwrite,
230 StatInt_pwrite64,
231 StatInt_writev,
232 StatInt_pwritev64,
233 StatInt_send,
234 StatInt_sendmsg,
235 StatInt_recv,
236 StatInt_recvmsg,
237 StatInt_unlink,
238 StatInt_fopen,
Dmitry Vyukovc78839f2012-12-12 11:59:30 +0000239 StatInt_freopen,
240 StatInt_fclose,
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000241 StatInt_fread,
242 StatInt_fwrite,
Dmitry Vyukov0ebfc6f2013-03-20 14:01:10 +0000243 StatInt_fflush,
Dmitry Vyukov5043f052013-03-21 12:50:43 +0000244 StatInt_abort,
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000245 StatInt_puts,
246 StatInt_rmdir,
247 StatInt_opendir,
248 StatInt_epoll_ctl,
249 StatInt_epoll_wait,
Dmitry Vyukovee8ee242012-11-15 17:40:49 +0000250 StatInt_poll,
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000251 StatInt_sigaction,
Dmitry Vyukovd91d0672012-05-21 08:26:51 +0000252 StatInt_signal,
253 StatInt_raise,
254 StatInt_kill,
255 StatInt_pthread_kill,
Dmitry Vyukov84853112012-08-31 17:27:49 +0000256 StatInt_sleep,
257 StatInt_usleep,
258 StatInt_nanosleep,
Dmitry Vyukovaad173b2012-11-09 19:55:06 +0000259 StatInt_gettimeofday,
Dmitry Vyukov4554b7a2012-12-18 14:44:44 +0000260 StatInt_fork,
Evgeniy Stepanov996c4f22013-01-18 11:17:23 +0000261 StatInt_vscanf,
262 StatInt_vsscanf,
263 StatInt_vfscanf,
264 StatInt_scanf,
265 StatInt_sscanf,
266 StatInt_fscanf,
Evgeniy Stepanov86edb3b2013-02-12 12:02:49 +0000267 StatInt___isoc99_vscanf,
268 StatInt___isoc99_vsscanf,
269 StatInt___isoc99_vfscanf,
270 StatInt___isoc99_scanf,
271 StatInt___isoc99_sscanf,
272 StatInt___isoc99_fscanf,
Dmitry Vyukov31c05ea2013-01-29 13:05:30 +0000273 StatInt_on_exit,
274 StatInt___cxa_atexit,
Evgeniy Stepanov9358c582013-02-19 09:19:16 +0000275 StatInt_localtime,
276 StatInt_localtime_r,
277 StatInt_gmtime,
278 StatInt_gmtime_r,
279 StatInt_ctime,
280 StatInt_ctime_r,
281 StatInt_asctime,
282 StatInt_asctime_r,
Evgeniy Stepanov7cbbb292013-03-14 11:34:39 +0000283 StatInt_frexp,
284 StatInt_frexpf,
285 StatInt_frexpl,
Evgeniy Stepanove4bdda52013-04-01 14:47:21 +0000286 StatInt_getpwnam,
287 StatInt_getpwuid,
Evgeniy Stepanov103a63e2013-04-23 12:01:20 +0000288 StatInt_getgrnam,
289 StatInt_getgrgid,
Evgeniy Stepanove4bdda52013-04-01 14:47:21 +0000290 StatInt_getpwnam_r,
291 StatInt_getpwuid_r,
Evgeniy Stepanov103a63e2013-04-23 12:01:20 +0000292 StatInt_getgrnam_r,
293 StatInt_getgrgid_r,
Evgeniy Stepanove4bdda52013-04-01 14:47:21 +0000294 StatInt_clock_getres,
295 StatInt_clock_gettime,
296 StatInt_clock_settime,
297 StatInt_getitimer,
298 StatInt_setitimer,
Evgeniy Stepanovcc24ec92013-04-08 08:46:25 +0000299 StatInt_time,
Evgeniy Stepanova1c2a552013-04-09 11:35:13 +0000300 StatInt_glob,
301 StatInt_glob64,
Evgeniy Stepanov897a4ae2013-04-09 14:34:59 +0000302 StatInt_wait,
303 StatInt_waitid,
304 StatInt_waitpid,
305 StatInt_wait3,
306 StatInt_wait4,
Evgeniy Stepanov9530eb72013-04-23 14:05:15 +0000307 StatInt_inet_ntop,
308 StatInt_inet_pton,
Evgeniy Stepanov447ef192013-05-22 12:50:26 +0000309 StatInt_getaddrinfo,
Evgeniy Stepanov9f58c5c2013-05-22 13:46:22 +0000310 StatInt_getsockname,
Evgeniy Stepanov0a2cc372013-05-23 11:10:23 +0000311 StatInt_gethostent,
312 StatInt_gethostbyname,
313 StatInt_gethostbyname2,
314 StatInt_gethostbyaddr,
315 StatInt_gethostent_r,
316 StatInt_gethostbyname_r,
317 StatInt_gethostbyname2_r,
318 StatInt_gethostbyaddr_r,
Evgeniy Stepanovf32be422013-05-23 11:38:08 +0000319 StatInt_getsockopt,
Evgeniy Stepanovc87088b2013-05-29 10:03:11 +0000320 StatInt_modf,
321 StatInt_modff,
322 StatInt_modfl,
Evgeniy Stepanovbc33e132013-05-29 11:49:25 +0000323 StatInt_getpeername,
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000324
325 // Dynamic annotations.
326 StatAnnotation,
327 StatAnnotateHappensBefore,
328 StatAnnotateHappensAfter,
329 StatAnnotateCondVarSignal,
330 StatAnnotateCondVarSignalAll,
331 StatAnnotateMutexIsNotPHB,
332 StatAnnotateCondVarWait,
333 StatAnnotateRWLockCreate,
Dmitry Vyukovc20e9ba2012-08-16 13:29:41 +0000334 StatAnnotateRWLockCreateStatic,
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000335 StatAnnotateRWLockDestroy,
336 StatAnnotateRWLockAcquired,
337 StatAnnotateRWLockReleased,
338 StatAnnotateTraceMemory,
339 StatAnnotateFlushState,
340 StatAnnotateNewMemory,
341 StatAnnotateNoOp,
342 StatAnnotateFlushExpectedRaces,
343 StatAnnotateEnableRaceDetection,
344 StatAnnotateMutexIsUsedAsCondVar,
345 StatAnnotatePCQGet,
346 StatAnnotatePCQPut,
347 StatAnnotatePCQDestroy,
348 StatAnnotatePCQCreate,
349 StatAnnotateExpectRace,
350 StatAnnotateBenignRaceSized,
351 StatAnnotateBenignRace,
352 StatAnnotateIgnoreReadsBegin,
353 StatAnnotateIgnoreReadsEnd,
354 StatAnnotateIgnoreWritesBegin,
355 StatAnnotateIgnoreWritesEnd,
356 StatAnnotatePublishMemoryRange,
357 StatAnnotateUnpublishMemoryRange,
358 StatAnnotateThreadName,
359
360 // Internal mutex contentionz.
361 StatMtxTotal,
362 StatMtxTrace,
363 StatMtxThreads,
364 StatMtxReport,
365 StatMtxSyncVar,
366 StatMtxSyncTab,
367 StatMtxSlab,
368 StatMtxAnnotations,
369 StatMtxAtExit,
Dmitry Vyukovad9da372012-12-06 12:16:15 +0000370 StatMtxMBlock,
Dmitry Vyukovf4e4f932012-12-21 11:30:14 +0000371 StatMtxJavaMBlock,
Dmitry Vyukov52c70e52013-02-04 08:06:32 +0000372 StatMtxFD,
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000373
374 // This must be the last.
Alexey Samsonov2135d8a2012-09-13 11:54:41 +0000375 StatCnt
Kostya Serebryany7ac41482012-05-10 13:48:04 +0000376};
377
378} // namespace __tsan
379
380#endif // TSAN_STAT_H