• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 namespace __tsan {
18 
19 enum 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   StatShadowProcessed,
31   StatShadowZero,
32   StatShadowNonZero,  // Derived.
33   StatShadowSameSize,
34   StatShadowIntersect,
35   StatShadowNotIntersect,
36   StatShadowSameThread,
37   StatShadowAnotherThread,
38   StatShadowReplace,
39 
40   // Func processing.
41   StatFuncEnter,
42   StatFuncExit,
43 
44   // Trace processing.
45   StatEvents,
46 
47   // Threads.
48   StatThreadCreate,
49   StatThreadFinish,
50   StatThreadReuse,
51   StatThreadMaxTid,
52   StatThreadMaxAlive,
53 
54   // Mutexes.
55   StatMutexCreate,
56   StatMutexDestroy,
57   StatMutexLock,
58   StatMutexUnlock,
59   StatMutexRecLock,
60   StatMutexRecUnlock,
61   StatMutexReadLock,
62   StatMutexReadUnlock,
63 
64   // Synchronization.
65   StatSyncCreated,
66   StatSyncDestroyed,
67   StatSyncAcquire,
68   StatSyncRelease,
69 
70   // Atomics.
71   StatAtomic,
72   StatAtomicLoad,
73   StatAtomicStore,
74   StatAtomicExchange,
75   StatAtomicFetchAdd,
76   StatAtomicFetchSub,
77   StatAtomicFetchAnd,
78   StatAtomicFetchOr,
79   StatAtomicFetchXor,
80   StatAtomicFetchNand,
81   StatAtomicCAS,
82   StatAtomicFence,
83   StatAtomicRelaxed,
84   StatAtomicConsume,
85   StatAtomicAcquire,
86   StatAtomicRelease,
87   StatAtomicAcq_Rel,
88   StatAtomicSeq_Cst,
89   StatAtomic1,
90   StatAtomic2,
91   StatAtomic4,
92   StatAtomic8,
93   StatAtomic16,
94 
95   // Interceptors.
96   StatInterceptor,
97   StatInt_longjmp,
98   StatInt_siglongjmp,
99   StatInt_malloc,
100   StatInt___libc_memalign,
101   StatInt_calloc,
102   StatInt_realloc,
103   StatInt_free,
104   StatInt_cfree,
105   StatInt_malloc_usable_size,
106   StatInt_mmap,
107   StatInt_mmap64,
108   StatInt_munmap,
109   StatInt_memalign,
110   StatInt_valloc,
111   StatInt_pvalloc,
112   StatInt_posix_memalign,
113   StatInt__Znwm,
114   StatInt__ZnwmRKSt9nothrow_t,
115   StatInt__Znam,
116   StatInt__ZnamRKSt9nothrow_t,
117   StatInt__ZdlPv,
118   StatInt__ZdlPvRKSt9nothrow_t,
119   StatInt__ZdaPv,
120   StatInt__ZdaPvRKSt9nothrow_t,
121   StatInt_strlen,
122   StatInt_memset,
123   StatInt_memcpy,
124   StatInt_strcmp,
125   StatInt_memchr,
126   StatInt_memrchr,
127   StatInt_memmove,
128   StatInt_memcmp,
129   StatInt_strchr,
130   StatInt_strchrnul,
131   StatInt_strrchr,
132   StatInt_strncmp,
133   StatInt_strcpy,
134   StatInt_strncpy,
135   StatInt_strstr,
136   StatInt_atexit,
137   StatInt___cxa_guard_acquire,
138   StatInt___cxa_guard_release,
139   StatInt___cxa_guard_abort,
140   StatInt_pthread_create,
141   StatInt_pthread_join,
142   StatInt_pthread_detach,
143   StatInt_pthread_mutex_init,
144   StatInt_pthread_mutex_destroy,
145   StatInt_pthread_mutex_lock,
146   StatInt_pthread_mutex_trylock,
147   StatInt_pthread_mutex_timedlock,
148   StatInt_pthread_mutex_unlock,
149   StatInt_pthread_spin_init,
150   StatInt_pthread_spin_destroy,
151   StatInt_pthread_spin_lock,
152   StatInt_pthread_spin_trylock,
153   StatInt_pthread_spin_unlock,
154   StatInt_pthread_rwlock_init,
155   StatInt_pthread_rwlock_destroy,
156   StatInt_pthread_rwlock_rdlock,
157   StatInt_pthread_rwlock_tryrdlock,
158   StatInt_pthread_rwlock_timedrdlock,
159   StatInt_pthread_rwlock_wrlock,
160   StatInt_pthread_rwlock_trywrlock,
161   StatInt_pthread_rwlock_timedwrlock,
162   StatInt_pthread_rwlock_unlock,
163   StatInt_pthread_cond_init,
164   StatInt_pthread_cond_destroy,
165   StatInt_pthread_cond_signal,
166   StatInt_pthread_cond_broadcast,
167   StatInt_pthread_cond_wait,
168   StatInt_pthread_cond_timedwait,
169   StatInt_pthread_barrier_init,
170   StatInt_pthread_barrier_destroy,
171   StatInt_pthread_barrier_wait,
172   StatInt_pthread_once,
173   StatInt_sem_init,
174   StatInt_sem_destroy,
175   StatInt_sem_wait,
176   StatInt_sem_trywait,
177   StatInt_sem_timedwait,
178   StatInt_sem_post,
179   StatInt_sem_getvalue,
180   StatInt_stat,
181   StatInt___xstat,
182   StatInt_stat64,
183   StatInt___xstat64,
184   StatInt_lstat,
185   StatInt___lxstat,
186   StatInt_lstat64,
187   StatInt___lxstat64,
188   StatInt_fstat,
189   StatInt___fxstat,
190   StatInt_fstat64,
191   StatInt___fxstat64,
192   StatInt_open,
193   StatInt_open64,
194   StatInt_creat,
195   StatInt_creat64,
196   StatInt_dup,
197   StatInt_dup2,
198   StatInt_dup3,
199   StatInt_eventfd,
200   StatInt_signalfd,
201   StatInt_inotify_init,
202   StatInt_inotify_init1,
203   StatInt_socket,
204   StatInt_socketpair,
205   StatInt_connect,
206   StatInt_bind,
207   StatInt_listen,
208   StatInt_accept,
209   StatInt_accept4,
210   StatInt_epoll_create,
211   StatInt_epoll_create1,
212   StatInt_close,
213   StatInt___close,
214   StatInt___res_iclose,
215   StatInt_pipe,
216   StatInt_pipe2,
217   StatInt_read,
218   StatInt_prctl,
219   StatInt_pread,
220   StatInt_pread64,
221   StatInt_readv,
222   StatInt_preadv64,
223   StatInt_write,
224   StatInt_pwrite,
225   StatInt_pwrite64,
226   StatInt_writev,
227   StatInt_pwritev64,
228   StatInt_send,
229   StatInt_sendmsg,
230   StatInt_recv,
231   StatInt_recvmsg,
232   StatInt_unlink,
233   StatInt_fopen,
234   StatInt_freopen,
235   StatInt_fclose,
236   StatInt_fread,
237   StatInt_fwrite,
238   StatInt_puts,
239   StatInt_rmdir,
240   StatInt_opendir,
241   StatInt_epoll_ctl,
242   StatInt_epoll_wait,
243   StatInt_poll,
244   StatInt_sigaction,
245   StatInt_signal,
246   StatInt_raise,
247   StatInt_kill,
248   StatInt_pthread_kill,
249   StatInt_sleep,
250   StatInt_usleep,
251   StatInt_nanosleep,
252   StatInt_gettimeofday,
253   StatInt_fork,
254   StatInt_vscanf,
255   StatInt_vsscanf,
256   StatInt_vfscanf,
257   StatInt_scanf,
258   StatInt_sscanf,
259   StatInt_fscanf,
260   StatInt___isoc99_vscanf,
261   StatInt___isoc99_vsscanf,
262   StatInt___isoc99_vfscanf,
263   StatInt___isoc99_scanf,
264   StatInt___isoc99_sscanf,
265   StatInt___isoc99_fscanf,
266   StatInt_on_exit,
267   StatInt___cxa_atexit,
268   StatInt_localtime,
269   StatInt_localtime_r,
270   StatInt_gmtime,
271   StatInt_gmtime_r,
272   StatInt_ctime,
273   StatInt_ctime_r,
274   StatInt_asctime,
275   StatInt_asctime_r,
276   StatInt_frexp,
277   StatInt_frexpf,
278   StatInt_frexpl,
279 
280   // Dynamic annotations.
281   StatAnnotation,
282   StatAnnotateHappensBefore,
283   StatAnnotateHappensAfter,
284   StatAnnotateCondVarSignal,
285   StatAnnotateCondVarSignalAll,
286   StatAnnotateMutexIsNotPHB,
287   StatAnnotateCondVarWait,
288   StatAnnotateRWLockCreate,
289   StatAnnotateRWLockCreateStatic,
290   StatAnnotateRWLockDestroy,
291   StatAnnotateRWLockAcquired,
292   StatAnnotateRWLockReleased,
293   StatAnnotateTraceMemory,
294   StatAnnotateFlushState,
295   StatAnnotateNewMemory,
296   StatAnnotateNoOp,
297   StatAnnotateFlushExpectedRaces,
298   StatAnnotateEnableRaceDetection,
299   StatAnnotateMutexIsUsedAsCondVar,
300   StatAnnotatePCQGet,
301   StatAnnotatePCQPut,
302   StatAnnotatePCQDestroy,
303   StatAnnotatePCQCreate,
304   StatAnnotateExpectRace,
305   StatAnnotateBenignRaceSized,
306   StatAnnotateBenignRace,
307   StatAnnotateIgnoreReadsBegin,
308   StatAnnotateIgnoreReadsEnd,
309   StatAnnotateIgnoreWritesBegin,
310   StatAnnotateIgnoreWritesEnd,
311   StatAnnotatePublishMemoryRange,
312   StatAnnotateUnpublishMemoryRange,
313   StatAnnotateThreadName,
314 
315   // Internal mutex contentionz.
316   StatMtxTotal,
317   StatMtxTrace,
318   StatMtxThreads,
319   StatMtxReport,
320   StatMtxSyncVar,
321   StatMtxSyncTab,
322   StatMtxSlab,
323   StatMtxAnnotations,
324   StatMtxAtExit,
325   StatMtxMBlock,
326   StatMtxJavaMBlock,
327   StatMtxFD,
328 
329   // This must be the last.
330   StatCnt
331 };
332 
333 }  // namespace __tsan
334 
335 #endif  // TSAN_STAT_H
336