blob: 3b81acafcf6bb630dc4f4f49b3152262c31e3482 [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,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +000080 StatAtomicCAS,
81 StatAtomicFence,
82 StatAtomicRelaxed,
83 StatAtomicConsume,
84 StatAtomicAcquire,
85 StatAtomicRelease,
86 StatAtomicAcq_Rel,
87 StatAtomicSeq_Cst,
88 StatAtomic1,
89 StatAtomic2,
90 StatAtomic4,
91 StatAtomic8,
92
93 // Interceptors.
94 StatInterceptor,
Dmitry Vyukov95a5c5c2012-05-31 18:03:59 +000095 StatInt_longjmp,
96 StatInt_siglongjmp,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +000097 StatInt_malloc,
98 StatInt_calloc,
99 StatInt_realloc,
100 StatInt_free,
101 StatInt_cfree,
102 StatInt_mmap,
103 StatInt_mmap64,
104 StatInt_munmap,
105 StatInt_memalign,
106 StatInt_valloc,
107 StatInt_pvalloc,
108 StatInt_posix_memalign,
109 StatInt__Znwm,
110 StatInt__ZnwmRKSt9nothrow_t,
111 StatInt__Znam,
112 StatInt__ZnamRKSt9nothrow_t,
113 StatInt__ZdlPv,
114 StatInt__ZdlPvRKSt9nothrow_t,
115 StatInt__ZdaPv,
116 StatInt__ZdaPvRKSt9nothrow_t,
117 StatInt_strlen,
118 StatInt_memset,
119 StatInt_memcpy,
120 StatInt_strcmp,
121 StatInt_memchr,
122 StatInt_memrchr,
123 StatInt_memmove,
124 StatInt_memcmp,
125 StatInt_strchr,
126 StatInt_strchrnul,
127 StatInt_strrchr,
128 StatInt_strncmp,
129 StatInt_strcpy,
130 StatInt_strncpy,
131 StatInt_strstr,
132 StatInt_atexit,
133 StatInt___cxa_guard_acquire,
134 StatInt___cxa_guard_release,
135 StatInt_pthread_create,
136 StatInt_pthread_join,
137 StatInt_pthread_detach,
138 StatInt_pthread_mutex_init,
139 StatInt_pthread_mutex_destroy,
140 StatInt_pthread_mutex_lock,
141 StatInt_pthread_mutex_trylock,
142 StatInt_pthread_mutex_timedlock,
143 StatInt_pthread_mutex_unlock,
144 StatInt_pthread_spin_init,
145 StatInt_pthread_spin_destroy,
146 StatInt_pthread_spin_lock,
147 StatInt_pthread_spin_trylock,
148 StatInt_pthread_spin_unlock,
149 StatInt_pthread_rwlock_init,
150 StatInt_pthread_rwlock_destroy,
151 StatInt_pthread_rwlock_rdlock,
152 StatInt_pthread_rwlock_tryrdlock,
153 StatInt_pthread_rwlock_timedrdlock,
154 StatInt_pthread_rwlock_wrlock,
155 StatInt_pthread_rwlock_trywrlock,
156 StatInt_pthread_rwlock_timedwrlock,
157 StatInt_pthread_rwlock_unlock,
158 StatInt_pthread_cond_init,
159 StatInt_pthread_cond_destroy,
160 StatInt_pthread_cond_signal,
161 StatInt_pthread_cond_broadcast,
162 StatInt_pthread_cond_wait,
163 StatInt_pthread_cond_timedwait,
164 StatInt_pthread_barrier_init,
165 StatInt_pthread_barrier_destroy,
166 StatInt_pthread_barrier_wait,
167 StatInt_pthread_once,
168 StatInt_sem_init,
169 StatInt_sem_destroy,
170 StatInt_sem_wait,
171 StatInt_sem_trywait,
172 StatInt_sem_timedwait,
173 StatInt_sem_post,
174 StatInt_sem_getvalue,
175 StatInt_read,
176 StatInt_pread,
177 StatInt_pread64,
178 StatInt_readv,
179 StatInt_preadv64,
180 StatInt_write,
181 StatInt_pwrite,
182 StatInt_pwrite64,
183 StatInt_writev,
184 StatInt_pwritev64,
185 StatInt_send,
186 StatInt_sendmsg,
187 StatInt_recv,
188 StatInt_recvmsg,
189 StatInt_unlink,
190 StatInt_fopen,
191 StatInt_fread,
192 StatInt_fwrite,
193 StatInt_puts,
194 StatInt_rmdir,
195 StatInt_opendir,
196 StatInt_epoll_ctl,
197 StatInt_epoll_wait,
198 StatInt_sigaction,
Dmitry Vyukov98953b72012-05-21 08:26:51 +0000199 StatInt_signal,
200 StatInt_raise,
201 StatInt_kill,
202 StatInt_pthread_kill,
Dmitry Vyukov318f7772012-08-31 17:27:49 +0000203 StatInt_sleep,
204 StatInt_usleep,
205 StatInt_nanosleep,
Dmitry Vyukov317f3922012-11-09 19:55:06 +0000206 StatInt_gettimeofday,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000207
208 // Dynamic annotations.
209 StatAnnotation,
210 StatAnnotateHappensBefore,
211 StatAnnotateHappensAfter,
212 StatAnnotateCondVarSignal,
213 StatAnnotateCondVarSignalAll,
214 StatAnnotateMutexIsNotPHB,
215 StatAnnotateCondVarWait,
216 StatAnnotateRWLockCreate,
Dmitry Vyukov4723e6b2012-08-16 13:29:41 +0000217 StatAnnotateRWLockCreateStatic,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000218 StatAnnotateRWLockDestroy,
219 StatAnnotateRWLockAcquired,
220 StatAnnotateRWLockReleased,
221 StatAnnotateTraceMemory,
222 StatAnnotateFlushState,
223 StatAnnotateNewMemory,
224 StatAnnotateNoOp,
225 StatAnnotateFlushExpectedRaces,
226 StatAnnotateEnableRaceDetection,
227 StatAnnotateMutexIsUsedAsCondVar,
228 StatAnnotatePCQGet,
229 StatAnnotatePCQPut,
230 StatAnnotatePCQDestroy,
231 StatAnnotatePCQCreate,
232 StatAnnotateExpectRace,
233 StatAnnotateBenignRaceSized,
234 StatAnnotateBenignRace,
235 StatAnnotateIgnoreReadsBegin,
236 StatAnnotateIgnoreReadsEnd,
237 StatAnnotateIgnoreWritesBegin,
238 StatAnnotateIgnoreWritesEnd,
239 StatAnnotatePublishMemoryRange,
240 StatAnnotateUnpublishMemoryRange,
241 StatAnnotateThreadName,
242
243 // Internal mutex contentionz.
244 StatMtxTotal,
245 StatMtxTrace,
246 StatMtxThreads,
247 StatMtxReport,
248 StatMtxSyncVar,
249 StatMtxSyncTab,
250 StatMtxSlab,
251 StatMtxAnnotations,
252 StatMtxAtExit,
253
254 // This must be the last.
Alexey Samsonov046248c2012-09-13 11:54:41 +0000255 StatCnt
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000256};
257
258} // namespace __tsan
259
260#endif // TSAN_STAT_H