blob: 94a80516e0b45377119c24ce4e59ea741c8a8b8a [file] [log] [blame]
Kostya Serebryany4ad375f2012-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,
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,
Dmitry Vyukovb96a7b52012-10-04 10:08:23 +000076 StatAtomicFetchSub,
Dmitry Vyukov572c5b22012-05-14 15:33:00 +000077 StatAtomicFetchAnd,
78 StatAtomicFetchOr,
79 StatAtomicFetchXor,
Dmitry Vyukov3b450122012-11-26 09:42:56 +000080 StatAtomicFetchNand,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +000081 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,
Dmitry Vyukov59d58662012-11-27 07:41:27 +000093 StatAtomic16,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +000094
95 // Interceptors.
96 StatInterceptor,
Dmitry Vyukov95a5c5c2012-05-31 18:03:59 +000097 StatInt_longjmp,
98 StatInt_siglongjmp,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +000099 StatInt_malloc,
100 StatInt_calloc,
101 StatInt_realloc,
102 StatInt_free,
103 StatInt_cfree,
104 StatInt_mmap,
105 StatInt_mmap64,
106 StatInt_munmap,
107 StatInt_memalign,
108 StatInt_valloc,
109 StatInt_pvalloc,
110 StatInt_posix_memalign,
111 StatInt__Znwm,
112 StatInt__ZnwmRKSt9nothrow_t,
113 StatInt__Znam,
114 StatInt__ZnamRKSt9nothrow_t,
115 StatInt__ZdlPv,
116 StatInt__ZdlPvRKSt9nothrow_t,
117 StatInt__ZdaPv,
118 StatInt__ZdaPvRKSt9nothrow_t,
119 StatInt_strlen,
120 StatInt_memset,
121 StatInt_memcpy,
122 StatInt_strcmp,
123 StatInt_memchr,
124 StatInt_memrchr,
125 StatInt_memmove,
126 StatInt_memcmp,
127 StatInt_strchr,
128 StatInt_strchrnul,
129 StatInt_strrchr,
130 StatInt_strncmp,
131 StatInt_strcpy,
132 StatInt_strncpy,
133 StatInt_strstr,
134 StatInt_atexit,
135 StatInt___cxa_guard_acquire,
136 StatInt___cxa_guard_release,
137 StatInt_pthread_create,
138 StatInt_pthread_join,
139 StatInt_pthread_detach,
140 StatInt_pthread_mutex_init,
141 StatInt_pthread_mutex_destroy,
142 StatInt_pthread_mutex_lock,
143 StatInt_pthread_mutex_trylock,
144 StatInt_pthread_mutex_timedlock,
145 StatInt_pthread_mutex_unlock,
146 StatInt_pthread_spin_init,
147 StatInt_pthread_spin_destroy,
148 StatInt_pthread_spin_lock,
149 StatInt_pthread_spin_trylock,
150 StatInt_pthread_spin_unlock,
151 StatInt_pthread_rwlock_init,
152 StatInt_pthread_rwlock_destroy,
153 StatInt_pthread_rwlock_rdlock,
154 StatInt_pthread_rwlock_tryrdlock,
155 StatInt_pthread_rwlock_timedrdlock,
156 StatInt_pthread_rwlock_wrlock,
157 StatInt_pthread_rwlock_trywrlock,
158 StatInt_pthread_rwlock_timedwrlock,
159 StatInt_pthread_rwlock_unlock,
160 StatInt_pthread_cond_init,
161 StatInt_pthread_cond_destroy,
162 StatInt_pthread_cond_signal,
163 StatInt_pthread_cond_broadcast,
164 StatInt_pthread_cond_wait,
165 StatInt_pthread_cond_timedwait,
166 StatInt_pthread_barrier_init,
167 StatInt_pthread_barrier_destroy,
168 StatInt_pthread_barrier_wait,
169 StatInt_pthread_once,
170 StatInt_sem_init,
171 StatInt_sem_destroy,
172 StatInt_sem_wait,
173 StatInt_sem_trywait,
174 StatInt_sem_timedwait,
175 StatInt_sem_post,
176 StatInt_sem_getvalue,
177 StatInt_read,
178 StatInt_pread,
179 StatInt_pread64,
180 StatInt_readv,
181 StatInt_preadv64,
182 StatInt_write,
183 StatInt_pwrite,
184 StatInt_pwrite64,
185 StatInt_writev,
186 StatInt_pwritev64,
187 StatInt_send,
188 StatInt_sendmsg,
189 StatInt_recv,
190 StatInt_recvmsg,
191 StatInt_unlink,
192 StatInt_fopen,
193 StatInt_fread,
194 StatInt_fwrite,
195 StatInt_puts,
196 StatInt_rmdir,
197 StatInt_opendir,
198 StatInt_epoll_ctl,
199 StatInt_epoll_wait,
Dmitry Vyukov262465c2012-11-15 17:40:49 +0000200 StatInt_poll,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000201 StatInt_sigaction,
Dmitry Vyukov98953b72012-05-21 08:26:51 +0000202 StatInt_signal,
203 StatInt_raise,
204 StatInt_kill,
205 StatInt_pthread_kill,
Dmitry Vyukov318f7772012-08-31 17:27:49 +0000206 StatInt_sleep,
207 StatInt_usleep,
208 StatInt_nanosleep,
Dmitry Vyukov317f3922012-11-09 19:55:06 +0000209 StatInt_gettimeofday,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000210
211 // Dynamic annotations.
212 StatAnnotation,
213 StatAnnotateHappensBefore,
214 StatAnnotateHappensAfter,
215 StatAnnotateCondVarSignal,
216 StatAnnotateCondVarSignalAll,
217 StatAnnotateMutexIsNotPHB,
218 StatAnnotateCondVarWait,
219 StatAnnotateRWLockCreate,
Dmitry Vyukov4723e6b2012-08-16 13:29:41 +0000220 StatAnnotateRWLockCreateStatic,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000221 StatAnnotateRWLockDestroy,
222 StatAnnotateRWLockAcquired,
223 StatAnnotateRWLockReleased,
224 StatAnnotateTraceMemory,
225 StatAnnotateFlushState,
226 StatAnnotateNewMemory,
227 StatAnnotateNoOp,
228 StatAnnotateFlushExpectedRaces,
229 StatAnnotateEnableRaceDetection,
230 StatAnnotateMutexIsUsedAsCondVar,
231 StatAnnotatePCQGet,
232 StatAnnotatePCQPut,
233 StatAnnotatePCQDestroy,
234 StatAnnotatePCQCreate,
235 StatAnnotateExpectRace,
236 StatAnnotateBenignRaceSized,
237 StatAnnotateBenignRace,
238 StatAnnotateIgnoreReadsBegin,
239 StatAnnotateIgnoreReadsEnd,
240 StatAnnotateIgnoreWritesBegin,
241 StatAnnotateIgnoreWritesEnd,
242 StatAnnotatePublishMemoryRange,
243 StatAnnotateUnpublishMemoryRange,
244 StatAnnotateThreadName,
245
246 // Internal mutex contentionz.
247 StatMtxTotal,
248 StatMtxTrace,
249 StatMtxThreads,
250 StatMtxReport,
251 StatMtxSyncVar,
252 StatMtxSyncTab,
253 StatMtxSlab,
254 StatMtxAnnotations,
255 StatMtxAtExit,
256
257 // This must be the last.
Alexey Samsonov046248c2012-09-13 11:54:41 +0000258 StatCnt
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000259};
260
261} // namespace __tsan
262
263#endif // TSAN_STAT_H