tsan_stat.h revision 3cae6040ebb4ce14123b8ba000b79b4383dbd48a
1//===-- 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  StatMopRodata,
31  StatMopRangeRodata,
32  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,
78  StatAtomicFetchSub,
79  StatAtomicFetchAnd,
80  StatAtomicFetchOr,
81  StatAtomicFetchXor,
82  StatAtomicFetchNand,
83  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,
95  StatAtomic16,
96
97  // Interceptors.
98  StatInterceptor,
99  StatInt_longjmp,
100  StatInt_siglongjmp,
101  StatInt_malloc,
102  StatInt___libc_memalign,
103  StatInt_calloc,
104  StatInt_realloc,
105  StatInt_free,
106  StatInt_cfree,
107  StatInt_malloc_usable_size,
108  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_strcasecmp,
138  StatInt_strncasecmp,
139  StatInt_strstr,
140  StatInt_atexit,
141  StatInt___cxa_guard_acquire,
142  StatInt___cxa_guard_release,
143  StatInt___cxa_guard_abort,
144  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,
177  StatInt_pthread_getschedparam,
178  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,
185  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,
197  StatInt_open,
198  StatInt_open64,
199  StatInt_creat,
200  StatInt_creat64,
201  StatInt_dup,
202  StatInt_dup2,
203  StatInt_dup3,
204  StatInt_eventfd,
205  StatInt_signalfd,
206  StatInt_inotify_init,
207  StatInt_inotify_init1,
208  StatInt_socket,
209  StatInt_socketpair,
210  StatInt_connect,
211  StatInt_bind,
212  StatInt_listen,
213  StatInt_accept,
214  StatInt_accept4,
215  StatInt_epoll_create,
216  StatInt_epoll_create1,
217  StatInt_close,
218  StatInt___close,
219  StatInt___res_iclose,
220  StatInt_pipe,
221  StatInt_pipe2,
222  StatInt_read,
223  StatInt_prctl,
224  StatInt_pread,
225  StatInt_pread64,
226  StatInt_readv,
227  StatInt_preadv,
228  StatInt_preadv64,
229  StatInt_write,
230  StatInt_pwrite,
231  StatInt_pwrite64,
232  StatInt_writev,
233  StatInt_pwritev,
234  StatInt_pwritev64,
235  StatInt_send,
236  StatInt_sendmsg,
237  StatInt_recv,
238  StatInt_recvmsg,
239  StatInt_unlink,
240  StatInt_fopen,
241  StatInt_freopen,
242  StatInt_fclose,
243  StatInt_fread,
244  StatInt_fwrite,
245  StatInt_fflush,
246  StatInt_abort,
247  StatInt_puts,
248  StatInt_rmdir,
249  StatInt_opendir,
250  StatInt_epoll_ctl,
251  StatInt_epoll_wait,
252  StatInt_poll,
253  StatInt_sigaction,
254  StatInt_signal,
255  StatInt_raise,
256  StatInt_kill,
257  StatInt_pthread_kill,
258  StatInt_sleep,
259  StatInt_usleep,
260  StatInt_nanosleep,
261  StatInt_gettimeofday,
262  StatInt_fork,
263  StatInt_vscanf,
264  StatInt_vsscanf,
265  StatInt_vfscanf,
266  StatInt_scanf,
267  StatInt_sscanf,
268  StatInt_fscanf,
269  StatInt___isoc99_vscanf,
270  StatInt___isoc99_vsscanf,
271  StatInt___isoc99_vfscanf,
272  StatInt___isoc99_scanf,
273  StatInt___isoc99_sscanf,
274  StatInt___isoc99_fscanf,
275  StatInt_on_exit,
276  StatInt___cxa_atexit,
277  StatInt_localtime,
278  StatInt_localtime_r,
279  StatInt_gmtime,
280  StatInt_gmtime_r,
281  StatInt_ctime,
282  StatInt_ctime_r,
283  StatInt_asctime,
284  StatInt_asctime_r,
285  StatInt_frexp,
286  StatInt_frexpf,
287  StatInt_frexpl,
288  StatInt_getpwnam,
289  StatInt_getpwuid,
290  StatInt_getgrnam,
291  StatInt_getgrgid,
292  StatInt_getpwnam_r,
293  StatInt_getpwuid_r,
294  StatInt_getgrnam_r,
295  StatInt_getgrgid_r,
296  StatInt_clock_getres,
297  StatInt_clock_gettime,
298  StatInt_clock_settime,
299  StatInt_getitimer,
300  StatInt_setitimer,
301  StatInt_time,
302  StatInt_glob,
303  StatInt_glob64,
304  StatInt_wait,
305  StatInt_waitid,
306  StatInt_waitpid,
307  StatInt_wait3,
308  StatInt_wait4,
309  StatInt_inet_ntop,
310  StatInt_inet_pton,
311  StatInt_inet_aton,
312  StatInt_getaddrinfo,
313  StatInt_getnameinfo,
314  StatInt_getsockname,
315  StatInt_gethostent,
316  StatInt_gethostbyname,
317  StatInt_gethostbyname2,
318  StatInt_gethostbyaddr,
319  StatInt_gethostent_r,
320  StatInt_gethostbyname_r,
321  StatInt_gethostbyname2_r,
322  StatInt_gethostbyaddr_r,
323  StatInt_getsockopt,
324  StatInt_modf,
325  StatInt_modff,
326  StatInt_modfl,
327  StatInt_getpeername,
328  StatInt_ioctl,
329  StatInt_sysinfo,
330  StatInt_readdir,
331  StatInt_readdir64,
332  StatInt_readdir_r,
333  StatInt_readdir64_r,
334  StatInt_ptrace,
335  StatInt_setlocale,
336
337  // Dynamic annotations.
338  StatAnnotation,
339  StatAnnotateHappensBefore,
340  StatAnnotateHappensAfter,
341  StatAnnotateCondVarSignal,
342  StatAnnotateCondVarSignalAll,
343  StatAnnotateMutexIsNotPHB,
344  StatAnnotateCondVarWait,
345  StatAnnotateRWLockCreate,
346  StatAnnotateRWLockCreateStatic,
347  StatAnnotateRWLockDestroy,
348  StatAnnotateRWLockAcquired,
349  StatAnnotateRWLockReleased,
350  StatAnnotateTraceMemory,
351  StatAnnotateFlushState,
352  StatAnnotateNewMemory,
353  StatAnnotateNoOp,
354  StatAnnotateFlushExpectedRaces,
355  StatAnnotateEnableRaceDetection,
356  StatAnnotateMutexIsUsedAsCondVar,
357  StatAnnotatePCQGet,
358  StatAnnotatePCQPut,
359  StatAnnotatePCQDestroy,
360  StatAnnotatePCQCreate,
361  StatAnnotateExpectRace,
362  StatAnnotateBenignRaceSized,
363  StatAnnotateBenignRace,
364  StatAnnotateIgnoreReadsBegin,
365  StatAnnotateIgnoreReadsEnd,
366  StatAnnotateIgnoreWritesBegin,
367  StatAnnotateIgnoreWritesEnd,
368  StatAnnotatePublishMemoryRange,
369  StatAnnotateUnpublishMemoryRange,
370  StatAnnotateThreadName,
371
372  // Internal mutex contentionz.
373  StatMtxTotal,
374  StatMtxTrace,
375  StatMtxThreads,
376  StatMtxReport,
377  StatMtxSyncVar,
378  StatMtxSyncTab,
379  StatMtxSlab,
380  StatMtxAnnotations,
381  StatMtxAtExit,
382  StatMtxMBlock,
383  StatMtxJavaMBlock,
384  StatMtxFD,
385
386  // This must be the last.
387  StatCnt
388};
389
390}  // namespace __tsan
391
392#endif  // TSAN_STAT_H
393