blob: 16c43f13cc5a3f07fce30c32f075d445465d2fbe [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,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000206
207 // Dynamic annotations.
208 StatAnnotation,
209 StatAnnotateHappensBefore,
210 StatAnnotateHappensAfter,
211 StatAnnotateCondVarSignal,
212 StatAnnotateCondVarSignalAll,
213 StatAnnotateMutexIsNotPHB,
214 StatAnnotateCondVarWait,
215 StatAnnotateRWLockCreate,
Dmitry Vyukov4723e6b2012-08-16 13:29:41 +0000216 StatAnnotateRWLockCreateStatic,
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000217 StatAnnotateRWLockDestroy,
218 StatAnnotateRWLockAcquired,
219 StatAnnotateRWLockReleased,
220 StatAnnotateTraceMemory,
221 StatAnnotateFlushState,
222 StatAnnotateNewMemory,
223 StatAnnotateNoOp,
224 StatAnnotateFlushExpectedRaces,
225 StatAnnotateEnableRaceDetection,
226 StatAnnotateMutexIsUsedAsCondVar,
227 StatAnnotatePCQGet,
228 StatAnnotatePCQPut,
229 StatAnnotatePCQDestroy,
230 StatAnnotatePCQCreate,
231 StatAnnotateExpectRace,
232 StatAnnotateBenignRaceSized,
233 StatAnnotateBenignRace,
234 StatAnnotateIgnoreReadsBegin,
235 StatAnnotateIgnoreReadsEnd,
236 StatAnnotateIgnoreWritesBegin,
237 StatAnnotateIgnoreWritesEnd,
238 StatAnnotatePublishMemoryRange,
239 StatAnnotateUnpublishMemoryRange,
240 StatAnnotateThreadName,
241
242 // Internal mutex contentionz.
243 StatMtxTotal,
244 StatMtxTrace,
245 StatMtxThreads,
246 StatMtxReport,
247 StatMtxSyncVar,
248 StatMtxSyncTab,
249 StatMtxSlab,
250 StatMtxAnnotations,
251 StatMtxAtExit,
252
253 // This must be the last.
Alexey Samsonov046248c2012-09-13 11:54:41 +0000254 StatCnt
Kostya Serebryany4ad375f2012-05-10 13:48:04 +0000255};
256
257} // namespace __tsan
258
259#endif // TSAN_STAT_H