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