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