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