tsan_stat.h revision fae2bff6de8be5a319ca17fd713731ce8a887476
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_ppoll,
254  StatInt_sigaction,
255  StatInt_signal,
256  StatInt_sigsuspend,
257  StatInt_raise,
258  StatInt_kill,
259  StatInt_pthread_kill,
260  StatInt_sleep,
261  StatInt_usleep,
262  StatInt_nanosleep,
263  StatInt_gettimeofday,
264  StatInt_fork,
265  StatInt_vscanf,
266  StatInt_vsscanf,
267  StatInt_vfscanf,
268  StatInt_scanf,
269  StatInt_sscanf,
270  StatInt_fscanf,
271  StatInt___isoc99_vscanf,
272  StatInt___isoc99_vsscanf,
273  StatInt___isoc99_vfscanf,
274  StatInt___isoc99_scanf,
275  StatInt___isoc99_sscanf,
276  StatInt___isoc99_fscanf,
277  StatInt_on_exit,
278  StatInt___cxa_atexit,
279  StatInt_localtime,
280  StatInt_localtime_r,
281  StatInt_gmtime,
282  StatInt_gmtime_r,
283  StatInt_ctime,
284  StatInt_ctime_r,
285  StatInt_asctime,
286  StatInt_asctime_r,
287  StatInt_frexp,
288  StatInt_frexpf,
289  StatInt_frexpl,
290  StatInt_getpwnam,
291  StatInt_getpwuid,
292  StatInt_getgrnam,
293  StatInt_getgrgid,
294  StatInt_getpwnam_r,
295  StatInt_getpwuid_r,
296  StatInt_getgrnam_r,
297  StatInt_getgrgid_r,
298  StatInt_clock_getres,
299  StatInt_clock_gettime,
300  StatInt_clock_settime,
301  StatInt_getitimer,
302  StatInt_setitimer,
303  StatInt_time,
304  StatInt_glob,
305  StatInt_glob64,
306  StatInt_wait,
307  StatInt_waitid,
308  StatInt_waitpid,
309  StatInt_wait3,
310  StatInt_wait4,
311  StatInt_inet_ntop,
312  StatInt_inet_pton,
313  StatInt_inet_aton,
314  StatInt_getaddrinfo,
315  StatInt_getnameinfo,
316  StatInt_getsockname,
317  StatInt_gethostent,
318  StatInt_gethostbyname,
319  StatInt_gethostbyname2,
320  StatInt_gethostbyaddr,
321  StatInt_gethostent_r,
322  StatInt_gethostbyname_r,
323  StatInt_gethostbyname2_r,
324  StatInt_gethostbyaddr_r,
325  StatInt_getsockopt,
326  StatInt_modf,
327  StatInt_modff,
328  StatInt_modfl,
329  StatInt_getpeername,
330  StatInt_ioctl,
331  StatInt_sysinfo,
332  StatInt_readdir,
333  StatInt_readdir64,
334  StatInt_readdir_r,
335  StatInt_readdir64_r,
336  StatInt_ptrace,
337  StatInt_setlocale,
338  StatInt_getcwd,
339  StatInt_get_current_dir_name,
340  StatInt_strtoimax,
341  StatInt_strtoumax,
342  StatInt_mbstowcs,
343  StatInt_mbsrtowcs,
344  StatInt_mbsnrtowcs,
345  StatInt_wcstombs,
346  StatInt_wcsrtombs,
347  StatInt_wcsnrtombs,
348  StatInt_tcgetattr,
349  StatInt_realpath,
350  StatInt_canonicalize_file_name,
351  StatInt_confstr,
352  StatInt_sched_getaffinity,
353  StatInt_strerror,
354  StatInt_strerror_r,
355  StatInt_scandir,
356  StatInt_scandir64,
357  StatInt_getgroups,
358
359  // Dynamic annotations.
360  StatAnnotation,
361  StatAnnotateHappensBefore,
362  StatAnnotateHappensAfter,
363  StatAnnotateCondVarSignal,
364  StatAnnotateCondVarSignalAll,
365  StatAnnotateMutexIsNotPHB,
366  StatAnnotateCondVarWait,
367  StatAnnotateRWLockCreate,
368  StatAnnotateRWLockCreateStatic,
369  StatAnnotateRWLockDestroy,
370  StatAnnotateRWLockAcquired,
371  StatAnnotateRWLockReleased,
372  StatAnnotateTraceMemory,
373  StatAnnotateFlushState,
374  StatAnnotateNewMemory,
375  StatAnnotateNoOp,
376  StatAnnotateFlushExpectedRaces,
377  StatAnnotateEnableRaceDetection,
378  StatAnnotateMutexIsUsedAsCondVar,
379  StatAnnotatePCQGet,
380  StatAnnotatePCQPut,
381  StatAnnotatePCQDestroy,
382  StatAnnotatePCQCreate,
383  StatAnnotateExpectRace,
384  StatAnnotateBenignRaceSized,
385  StatAnnotateBenignRace,
386  StatAnnotateIgnoreReadsBegin,
387  StatAnnotateIgnoreReadsEnd,
388  StatAnnotateIgnoreWritesBegin,
389  StatAnnotateIgnoreWritesEnd,
390  StatAnnotatePublishMemoryRange,
391  StatAnnotateUnpublishMemoryRange,
392  StatAnnotateThreadName,
393
394  // Internal mutex contentionz.
395  StatMtxTotal,
396  StatMtxTrace,
397  StatMtxThreads,
398  StatMtxReport,
399  StatMtxSyncVar,
400  StatMtxSyncTab,
401  StatMtxSlab,
402  StatMtxAnnotations,
403  StatMtxAtExit,
404  StatMtxMBlock,
405  StatMtxJavaMBlock,
406  StatMtxFD,
407
408  // This must be the last.
409  StatCnt
410};
411
412}  // namespace __tsan
413
414#endif  // TSAN_STAT_H
415