tsan_stat.h revision 369a9a6d4297af031227db1c6fedd21ee7033dc1
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_strdup,
141  StatInt_atexit,
142  StatInt__exit,
143  StatInt___cxa_guard_acquire,
144  StatInt___cxa_guard_release,
145  StatInt___cxa_guard_abort,
146  StatInt_pthread_create,
147  StatInt_pthread_join,
148  StatInt_pthread_detach,
149  StatInt_pthread_mutex_init,
150  StatInt_pthread_mutex_destroy,
151  StatInt_pthread_mutex_lock,
152  StatInt_pthread_mutex_trylock,
153  StatInt_pthread_mutex_timedlock,
154  StatInt_pthread_mutex_unlock,
155  StatInt_pthread_spin_init,
156  StatInt_pthread_spin_destroy,
157  StatInt_pthread_spin_lock,
158  StatInt_pthread_spin_trylock,
159  StatInt_pthread_spin_unlock,
160  StatInt_pthread_rwlock_init,
161  StatInt_pthread_rwlock_destroy,
162  StatInt_pthread_rwlock_rdlock,
163  StatInt_pthread_rwlock_tryrdlock,
164  StatInt_pthread_rwlock_timedrdlock,
165  StatInt_pthread_rwlock_wrlock,
166  StatInt_pthread_rwlock_trywrlock,
167  StatInt_pthread_rwlock_timedwrlock,
168  StatInt_pthread_rwlock_unlock,
169  StatInt_pthread_cond_init,
170  StatInt_pthread_cond_destroy,
171  StatInt_pthread_cond_signal,
172  StatInt_pthread_cond_broadcast,
173  StatInt_pthread_cond_wait,
174  StatInt_pthread_cond_timedwait,
175  StatInt_pthread_barrier_init,
176  StatInt_pthread_barrier_destroy,
177  StatInt_pthread_barrier_wait,
178  StatInt_pthread_once,
179  StatInt_pthread_getschedparam,
180  StatInt_sem_init,
181  StatInt_sem_destroy,
182  StatInt_sem_wait,
183  StatInt_sem_trywait,
184  StatInt_sem_timedwait,
185  StatInt_sem_post,
186  StatInt_sem_getvalue,
187  StatInt_stat,
188  StatInt___xstat,
189  StatInt_stat64,
190  StatInt___xstat64,
191  StatInt_lstat,
192  StatInt___lxstat,
193  StatInt_lstat64,
194  StatInt___lxstat64,
195  StatInt_fstat,
196  StatInt___fxstat,
197  StatInt_fstat64,
198  StatInt___fxstat64,
199  StatInt_open,
200  StatInt_open64,
201  StatInt_creat,
202  StatInt_creat64,
203  StatInt_dup,
204  StatInt_dup2,
205  StatInt_dup3,
206  StatInt_eventfd,
207  StatInt_signalfd,
208  StatInt_inotify_init,
209  StatInt_inotify_init1,
210  StatInt_socket,
211  StatInt_socketpair,
212  StatInt_connect,
213  StatInt_bind,
214  StatInt_listen,
215  StatInt_accept,
216  StatInt_accept4,
217  StatInt_epoll_create,
218  StatInt_epoll_create1,
219  StatInt_close,
220  StatInt___close,
221  StatInt___res_iclose,
222  StatInt_pipe,
223  StatInt_pipe2,
224  StatInt_read,
225  StatInt_prctl,
226  StatInt_pread,
227  StatInt_pread64,
228  StatInt_readv,
229  StatInt_preadv,
230  StatInt_preadv64,
231  StatInt_write,
232  StatInt_pwrite,
233  StatInt_pwrite64,
234  StatInt_writev,
235  StatInt_pwritev,
236  StatInt_pwritev64,
237  StatInt_send,
238  StatInt_sendmsg,
239  StatInt_recv,
240  StatInt_recvmsg,
241  StatInt_unlink,
242  StatInt_fopen,
243  StatInt_freopen,
244  StatInt_fclose,
245  StatInt_fread,
246  StatInt_fwrite,
247  StatInt_fflush,
248  StatInt_abort,
249  StatInt_puts,
250  StatInt_rmdir,
251  StatInt_opendir,
252  StatInt_epoll_ctl,
253  StatInt_epoll_wait,
254  StatInt_poll,
255  StatInt_ppoll,
256  StatInt_sigaction,
257  StatInt_signal,
258  StatInt_sigsuspend,
259  StatInt_raise,
260  StatInt_kill,
261  StatInt_pthread_kill,
262  StatInt_sleep,
263  StatInt_usleep,
264  StatInt_nanosleep,
265  StatInt_gettimeofday,
266  StatInt_fork,
267  StatInt_vscanf,
268  StatInt_vsscanf,
269  StatInt_vfscanf,
270  StatInt_scanf,
271  StatInt_sscanf,
272  StatInt_fscanf,
273  StatInt___isoc99_vscanf,
274  StatInt___isoc99_vsscanf,
275  StatInt___isoc99_vfscanf,
276  StatInt___isoc99_scanf,
277  StatInt___isoc99_sscanf,
278  StatInt___isoc99_fscanf,
279  StatInt_on_exit,
280  StatInt___cxa_atexit,
281  StatInt_localtime,
282  StatInt_localtime_r,
283  StatInt_gmtime,
284  StatInt_gmtime_r,
285  StatInt_ctime,
286  StatInt_ctime_r,
287  StatInt_asctime,
288  StatInt_asctime_r,
289  StatInt_frexp,
290  StatInt_frexpf,
291  StatInt_frexpl,
292  StatInt_getpwnam,
293  StatInt_getpwuid,
294  StatInt_getgrnam,
295  StatInt_getgrgid,
296  StatInt_getpwnam_r,
297  StatInt_getpwuid_r,
298  StatInt_getgrnam_r,
299  StatInt_getgrgid_r,
300  StatInt_clock_getres,
301  StatInt_clock_gettime,
302  StatInt_clock_settime,
303  StatInt_getitimer,
304  StatInt_setitimer,
305  StatInt_time,
306  StatInt_glob,
307  StatInt_glob64,
308  StatInt_wait,
309  StatInt_waitid,
310  StatInt_waitpid,
311  StatInt_wait3,
312  StatInt_wait4,
313  StatInt_inet_ntop,
314  StatInt_inet_pton,
315  StatInt_inet_aton,
316  StatInt_getaddrinfo,
317  StatInt_getnameinfo,
318  StatInt_getsockname,
319  StatInt_gethostent,
320  StatInt_gethostbyname,
321  StatInt_gethostbyname2,
322  StatInt_gethostbyaddr,
323  StatInt_gethostent_r,
324  StatInt_gethostbyname_r,
325  StatInt_gethostbyname2_r,
326  StatInt_gethostbyaddr_r,
327  StatInt_getsockopt,
328  StatInt_modf,
329  StatInt_modff,
330  StatInt_modfl,
331  StatInt_getpeername,
332  StatInt_ioctl,
333  StatInt_sysinfo,
334  StatInt_readdir,
335  StatInt_readdir64,
336  StatInt_readdir_r,
337  StatInt_readdir64_r,
338  StatInt_ptrace,
339  StatInt_setlocale,
340  StatInt_getcwd,
341  StatInt_get_current_dir_name,
342  StatInt_strtoimax,
343  StatInt_strtoumax,
344  StatInt_mbstowcs,
345  StatInt_mbsrtowcs,
346  StatInt_mbsnrtowcs,
347  StatInt_wcstombs,
348  StatInt_wcsrtombs,
349  StatInt_wcsnrtombs,
350  StatInt_tcgetattr,
351  StatInt_realpath,
352  StatInt_canonicalize_file_name,
353  StatInt_confstr,
354  StatInt_sched_getaffinity,
355  StatInt_strerror,
356  StatInt_strerror_r,
357  StatInt_scandir,
358  StatInt_scandir64,
359  StatInt_getgroups,
360  StatInt_wordexp,
361  StatInt_sigwait,
362  StatInt_sigwaitinfo,
363  StatInt_sigtimedwait,
364  StatInt_sigemptyset,
365  StatInt_sigfillset,
366  StatInt_sigpending,
367  StatInt_sigprocmask,
368  StatInt_backtrace,
369  StatInt_backtrace_symbols,
370  StatInt_dlopen,
371  StatInt_dlclose,
372  StatInt_getmntent,
373  StatInt_getmntent_r,
374  StatInt_statfs,
375  StatInt_statfs64,
376  StatInt_fstatfs,
377  StatInt_fstatfs64,
378  StatInt_statvfs,
379  StatInt_statvfs64,
380  StatInt_fstatvfs,
381  StatInt_fstatvfs64,
382  StatInt_initgroups,
383  StatInt_ether_ntoa,
384  StatInt_ether_aton,
385  StatInt_ether_ntoa_r,
386  StatInt_ether_aton_r,
387  StatInt_ether_ntohost,
388  StatInt_ether_hostton,
389  StatInt_ether_line,
390
391  // Dynamic annotations.
392  StatAnnotation,
393  StatAnnotateHappensBefore,
394  StatAnnotateHappensAfter,
395  StatAnnotateCondVarSignal,
396  StatAnnotateCondVarSignalAll,
397  StatAnnotateMutexIsNotPHB,
398  StatAnnotateCondVarWait,
399  StatAnnotateRWLockCreate,
400  StatAnnotateRWLockCreateStatic,
401  StatAnnotateRWLockDestroy,
402  StatAnnotateRWLockAcquired,
403  StatAnnotateRWLockReleased,
404  StatAnnotateTraceMemory,
405  StatAnnotateFlushState,
406  StatAnnotateNewMemory,
407  StatAnnotateNoOp,
408  StatAnnotateFlushExpectedRaces,
409  StatAnnotateEnableRaceDetection,
410  StatAnnotateMutexIsUsedAsCondVar,
411  StatAnnotatePCQGet,
412  StatAnnotatePCQPut,
413  StatAnnotatePCQDestroy,
414  StatAnnotatePCQCreate,
415  StatAnnotateExpectRace,
416  StatAnnotateBenignRaceSized,
417  StatAnnotateBenignRace,
418  StatAnnotateIgnoreReadsBegin,
419  StatAnnotateIgnoreReadsEnd,
420  StatAnnotateIgnoreWritesBegin,
421  StatAnnotateIgnoreWritesEnd,
422  StatAnnotateIgnoreSyncBegin,
423  StatAnnotateIgnoreSyncEnd,
424  StatAnnotatePublishMemoryRange,
425  StatAnnotateUnpublishMemoryRange,
426  StatAnnotateThreadName,
427
428  // Internal mutex contentionz.
429  StatMtxTotal,
430  StatMtxTrace,
431  StatMtxThreads,
432  StatMtxReport,
433  StatMtxSyncVar,
434  StatMtxSyncTab,
435  StatMtxSlab,
436  StatMtxAnnotations,
437  StatMtxAtExit,
438  StatMtxMBlock,
439  StatMtxJavaMBlock,
440  StatMtxFD,
441
442  // This must be the last.
443  StatCnt
444};
445
446}  // namespace __tsan
447
448#endif  // TSAN_STAT_H
449