| /llvm-project/compiler-rt/lib/tsan/rtl/ |
| H A D | tsan_rtl.h | 108 // In C++ it is tied to an OS thread just like ThreadState, however ideally 111 // ThreadState's (which are tied to Gs). 112 // A ThreadState must be wired with a Processor to handle events. 114 ThreadState *thr; // currently wired thread, or nullptr 143 ThreadState *thr; 159 struct alignas(SANITIZER_CACHE_LINE_SIZE) ThreadState { struct 174 ThreadState* current; argument 236 explicit ThreadState(Tid tid); argument 241 ThreadState *cur_thread(); 242 void set_cur_thread(ThreadState *th 176 pending_signalsThreadState global() argument 178 clockThreadState global() argument 183 ignore_reads_and_writesThreadState global() argument 184 suppress_reportsThreadState global() argument 187 mop_ignore_setThreadState global() argument 188 sync_ignore_setThreadState global() argument 190 shadow_stackThreadState global() argument 191 shadow_stack_endThreadState global() argument 193 jmp_bufsThreadState global() argument 194 in_symbolizerThreadState global() argument 195 in_blocking_funcThreadState global() argument 196 in_ignored_libThreadState global() argument 197 is_initedThreadState global() argument 199 msetThreadState global() argument 200 is_deadThreadState global() argument 201 tidThreadState global() argument 202 stk_addrThreadState global() argument 203 stk_sizeThreadState global() argument 204 tls_addrThreadState global() argument 205 tls_sizeThreadState global() argument 206 tctxThreadState global() argument 208 dd_ltThreadState global() argument 210 slotThreadState global() argument 211 slot_epochThreadState global() argument 212 slot_lockedThreadState global() argument [all...] |
| H A D | tsan_fd.h | 41 void FdAcquire(ThreadState *thr, uptr pc, int fd); 42 void FdRelease(ThreadState *thr, uptr pc, int fd); 43 void FdAccess(ThreadState *thr, uptr pc, int fd); 44 void FdClose(ThreadState *thr, uptr pc, int fd, bool write = true); 45 void FdFileCreate(ThreadState *thr, uptr pc, int fd); 46 void FdDup(ThreadState *thr, uptr pc, int oldfd, int newfd, bool write); 47 void FdPipeCreate(ThreadState *thr, uptr pc, int rfd, int wfd); 48 void FdEventCreate(ThreadState *thr, uptr pc, int fd); 49 void FdSignalCreate(ThreadState *thr, uptr pc, int fd); 50 void FdInotifyCreate(ThreadState *thr, uptr pc, int fd); [all …]
|
| H A D | tsan_platform_mac.cpp | 50 ThreadState)]; 51 static ThreadState *dead_thread_state; 55 // reference to the ThreadState object alive in TLS: 77 auto dts = (ThreadState *)MmapOrDie(sizeof(ThreadState), "ThreadState"); in InitializeThreadStateStorage() 82 res = internal_mprotect(dts, sizeof(ThreadState), PROT_READ); // immutable in InitializeThreadStateStorage() 87 ThreadState *cur_thread() { in cur_thread() 91 return (ThreadState *)main_thread_state; in cur_thread() 96 ThreadState *th in cur_thread() [all...] |
| H A D | tsan_rtl_thread.cpp | 74 static void ThreadCheckIgnore(ThreadState *thr) { in ThreadCheckIgnore() 83 static void ThreadCheckIgnore(ThreadState *thr) {} in ThreadCheckIgnore() 86 void ThreadFinalize(ThreadState *thr) { in ThreadFinalize() 104 int ThreadCount(ThreadState *thr) { in ThreadCount() 116 Tid ThreadCreate(ThreadState *thr, uptr pc, uptr uid, bool detached) { in ThreadCreate() 145 ThreadState *thr; 152 void ThreadStart(ThreadState *thr, Tid tid, tid_t os_id, in ThreadStart() 210 thr = new (arg) ThreadState(tid); in OnStarted() 216 void ThreadFinish(ThreadState *thr) { in ThreadFinish() 252 thr->~ThreadState(); [all...] |
| H A D | tsan_mman.h | 33 void *user_alloc_internal(ThreadState *thr, uptr pc, uptr sz, 36 void user_free(ThreadState *thr, uptr pc, void *p, bool signal = true); 38 void *user_alloc(ThreadState *thr, uptr pc, uptr sz); 39 void *user_calloc(ThreadState *thr, uptr pc, uptr sz, uptr n); 40 void *user_realloc(ThreadState *thr, uptr pc, void *p, uptr sz); 41 void *user_reallocarray(ThreadState *thr, uptr pc, void *p, uptr sz, uptr n); 42 void *user_memalign(ThreadState *thr, uptr pc, uptr align, uptr sz); 43 int user_posix_memalign(ThreadState *thr, uptr pc, void **memptr, uptr align, 45 void *user_aligned_alloc(ThreadState *thr, uptr pc, uptr align, uptr sz); 46 void *user_valloc(ThreadState *thr, uptr pc, uptr sz); [all …]
|
| H A D | tsan_fd.cpp | 56 static FdSync *allocsync(ThreadState *thr, uptr pc) { in allocsync() 69 static void unref(ThreadState *thr, uptr pc, FdSync *s) { in unref() 80 static FdDesc *fddesc(ThreadState *thr, uptr pc, int fd) { in fddesc() 101 static void init(ThreadState *thr, uptr pc, int fd, FdSync *s, in init() 145 void FdOnFork(ThreadState *thr, uptr pc) { in FdOnFork() 178 void FdAcquire(ThreadState *thr, uptr pc, int fd) { in FdAcquire() 189 void FdRelease(ThreadState *thr, uptr pc, int fd) { in FdRelease() 202 void FdAccess(ThreadState *thr, uptr pc, int fd) { in FdAccess() 210 void FdClose(ThreadState *thr, uptr pc, int fd, bool write) { in FdClose() 253 void FdFileCreate(ThreadState *thr, uptr pc, int fd) { in FdFileCreate() [all …]
|
| H A D | tsan_mman.cpp | 90 ThreadState *thr = cur_thread(); in ScopedGlobalProcessor() 113 ThreadState *thr = cur_thread(); in ~ScopedGlobalProcessor() 177 static void SignalUnsafeCall(ThreadState *thr, uptr pc) { in SignalUnsafeCall() 192 void *user_alloc_internal(ThreadState *thr, uptr pc, uptr sz, uptr align, in user_alloc_internal() 224 void user_free(ThreadState *thr, uptr pc, void *p, bool signal) { in user_free() 233 void *user_alloc(ThreadState *thr, uptr pc, uptr sz) { in user_alloc() 237 void *user_calloc(ThreadState *thr, uptr pc, uptr size, uptr n) { in user_calloc() 250 void *user_reallocarray(ThreadState *thr, uptr pc, void *p, uptr size, uptr n) { in user_reallocarray() 260 void OnUserAlloc(ThreadState *thr, uptr pc, uptr p, uptr sz, bool write) { in OnUserAlloc() 278 void OnUserFree(ThreadState *th [all...] |
| H A D | tsan_interface.cpp | 31 ThreadState *thr = cur_thread(); in __tsan_read16_pc() 38 ThreadState *thr = cur_thread(); in __tsan_write16_pc() 47 ThreadState *thr = cur_thread(); in __tsan_unaligned_read16() 54 ThreadState *thr = cur_thread(); in __tsan_unaligned_write16() 72 FiberDestroy(cur_thread(), CALLERPC, static_cast<ThreadState *>(fiber)); in __tsan_destroy_fiber() 77 FiberSwitch(cur_thread(), CALLERPC, static_cast<ThreadState *>(fiber), flags); in __tsan_switch_to_fiber() 82 ThreadSetName(static_cast<ThreadState *>(fiber), name); in __tsan_set_fiber_name()
|
| H A D | tsan_rtl_mutex.cpp | 25 void ReportDeadlock(ThreadState *thr, uptr pc, DDReport *r); 26 void ReportDestroyLocked(ThreadState *thr, uptr pc, uptr addr, 30 ThreadState *thr; 33 Callback(ThreadState *thr, uptr pc) in Callback() 44 void DDMutexInit(ThreadState *thr, uptr pc, SyncVar *s) { in DDMutexInit() 50 static void ReportMutexMisuse(ThreadState *thr, uptr pc, ReportType typ, in ReportMutexMisuse() 68 static void RecordMutexLock(ThreadState *thr, uptr pc, uptr addr, in RecordMutexLock() 80 static void RecordMutexUnlock(ThreadState *thr, uptr addr) { in RecordMutexUnlock() 86 void MutexCreate(ThreadState *thr, uptr pc, uptr addr, u32 flagz) { in MutexCreate() 98 void MutexDestroy(ThreadState *thr, uptr pc, uptr addr, u32 flagz) { in MutexDestroy() [all …]
|
| H A D | tsan_rtl_access.cpp | 18 ALWAYS_INLINE USED bool TryTraceMemoryAccess(ThreadState* thr, uptr pc, in TryTraceMemoryAccess() 57 bool TryTraceMemoryAccessRange(ThreadState* thr, uptr pc, uptr addr, uptr size, in TryTraceMemoryAccessRange() 78 void TraceMemoryAccessRange(ThreadState* thr, uptr pc, uptr addr, uptr size, in TraceMemoryAccessRange() 87 void TraceFunc(ThreadState* thr, uptr pc) { in TraceFunc() 95 NOINLINE void TraceRestartFuncEntry(ThreadState* thr, uptr pc) { in TraceRestartFuncEntry() 100 NOINLINE void TraceRestartFuncExit(ThreadState* thr) { in TraceRestartFuncExit() 105 void TraceMutexLock(ThreadState* thr, EventType type, uptr pc, uptr addr, in TraceMutexLock() 122 void TraceMutexUnlock(ThreadState* thr, uptr addr) { in TraceMutexUnlock() 134 void TraceTime(ThreadState* thr) { in TraceTime() 148 NOINLINE void DoReportRace(ThreadState* th [all...] |
| H A D | tsan_platform_linux.cpp | 567 void ImitateTlsWrite(ThreadState *thr, uptr tls_addr, uptr tls_size) { in ImitateTlsWrite() 604 static ThreadState *dead_thread_state = nullptr; in cur_thread() 606 ThreadState *cur_thread() { in cur_thread() 607 ThreadState* thr = reinterpret_cast<ThreadState*>(*get_android_tls_ptr()); in cur_thread() 613 thr = reinterpret_cast<ThreadState*>(*get_android_tls_ptr()); in cur_thread() 615 thr = reinterpret_cast<ThreadState*>(MmapOrDie(sizeof(ThreadState), in cur_thread() 616 "ThreadState")); in cur_thread() 619 dead_thread_state = reinterpret_cast<ThreadState*>( in cur_thread() [all...] |
| H A D | tsan_rtl.cpp | 52 "initial-exec"))) char cur_thread_placeholder[sizeof(ThreadState)]; 80 static TracePart* TracePartAlloc(ThreadState* thr) { 233 void DoReset(ThreadState* thr, uptr epoch) SANITIZER_NO_THREAD_SAFETY_ANALYSIS { 252 static TidSlot* FindSlotAndLock(ThreadState* thr) 296 void SlotAttachAndLock(ThreadState* thr) { 320 static void SlotDetachImpl(ThreadState* thr, bool exiting) { 352 void SlotDetach(ThreadState* thr) { 357 void SlotLock(ThreadState* thr) SANITIZER_NO_THREAD_SAFETY_ANALYSIS { 377 void SlotUnlock(ThreadState* thr) { 407 ThreadState 408 ThreadState::ThreadState(Tid tid) ThreadState() function in __tsan::ThreadState [all...] |
| H A D | tsan_interface_atomic.cpp | 228 static T AtomicRMW(ThreadState *thr, uptr pc, volatile T *a, T v, morder mo) { in AtomicLoad() 263 static T Atomic(ThreadState *thr, uptr pc, morder mo, const volatile T *a) { in AtomicStore() 304 static void Atomic(ThreadState *thr, uptr pc, morder mo, volatile T *a, T v) { in AtomicRMW() 333 static T Atomic(ThreadState *thr, uptr pc, morder mo, volatile T *a, T v) { in NoTsanAtomicFetchXor() 345 static T Atomic(ThreadState *thr, uptr pc, morder mo, volatile T *a, T v) { in AtomicExchange() 357 static T Atomic(ThreadState *thr, uptr pc, morder mo, volatile T *a, T v) { in AtomicFetchSub() 369 static T Atomic(ThreadState *thr, uptr pc, morder mo, volatile T *a, T v) { in AtomicFetchOr() 381 static T Atomic(ThreadState *thr, uptr pc, morder mo, volatile T *a, T v) { in AtomicFetchNand() 393 static T Atomic(ThreadState *thr, uptr pc, morder mo, volatile T *a, T v) { in NoTsanAtomicCAS() 405 static T Atomic(ThreadState *th in NoTsanAtomicCAS() [all...] |
| H A D | tsan_interface.h | 231 struct ThreadState; 411 void __tsan_go_atomic32_load(ThreadState *thr, uptr cpc, uptr pc, u8 *a); 413 void __tsan_go_atomic64_load(ThreadState *thr, uptr cpc, uptr pc, u8 *a); 415 void __tsan_go_atomic32_store(ThreadState *thr, uptr cpc, uptr pc, u8 *a); 417 void __tsan_go_atomic64_store(ThreadState *thr, uptr cpc, uptr pc, u8 *a); 419 void __tsan_go_atomic32_fetch_add(ThreadState *thr, uptr cpc, uptr pc, u8 *a); 421 void __tsan_go_atomic64_fetch_add(ThreadState *thr, uptr cpc, uptr pc, u8 *a); 423 void __tsan_go_atomic32_fetch_and(ThreadState *thr, uptr cpc, uptr pc, u8 *a); 425 void __tsan_go_atomic64_fetch_and(ThreadState *thr, uptr cpc, uptr pc, u8 *a); 427 void __tsan_go_atomic32_fetch_or(ThreadState *th [all...] |
| H A D | tsan_interceptors.h | 11 ScopedInterceptor(ThreadState *thr, const char *fname, uptr pc); 23 ThreadState *const thr_; 33 ThreadState *thr; 45 inline bool MustIgnoreInterceptor(ThreadState *thr) { in MustIgnoreInterceptor() 52 ThreadState *thr = cur_thread_init(); \
|
| H A D | tsan_sync.h | 67 void Init(ThreadState *thr, uptr pc, uptr addr, bool save_stack); 97 void AllocBlock(ThreadState *thr, uptr pc, uptr p, uptr sz); 114 SyncVar *GetSyncOrCreate(ThreadState *thr, uptr pc, uptr addr, in GetSyncOrCreate() 142 SyncVar *GetSync(ThreadState *thr, uptr pc, uptr addr, bool create,
|
| H A D | tsan_interceptors_posix.cpp | 183 void EnterBlockingFunc(ThreadState *thr) { in EnterBlockingFunc() 265 static ThreadSignalContext *SigCtx(ThreadState *thr) { in SigCtx() 283 ScopedInterceptor::ScopedInterceptor(ThreadState *thr, const char *fname, in ScopedInterceptor() 372 explicit BlockingCall(ThreadState *thr) in BlockingCall() 388 ThreadState *thr; in TSAN_INTERCEPTOR() 432 ThreadState *thr = cur_thread(); in cxa_at_exit_callback_installed_at() 441 ThreadState *thr = cur_thread(); 450 static int setup_at_exit_wrapper(ThreadState *thr, uptr pc, void(*f)(), in TSAN_INTERCEPTOR() 471 static int setup_at_exit_wrapper(ThreadState *thr, uptr pc, void(*f)(), in setup_at_exit_wrapper() 507 ThreadState *th in on_exit_callback_installed_at() [all...] |
| H A D | tsan_external.cpp | 62 static void PushTag(ThreadState *thr, uptr tag) { in PushTag() 65 static void PopTag(ThreadState *thr) { FuncExit(thr); } in PopTag() 74 ThreadState *thr = cur_thread(); in ExternalAccess()
|
| H A D | tsan_rtl_proc.cpp | 45 void ProcWire(Processor *proc, ThreadState *thr) { in ProcWire() 52 void ProcUnwire(Processor *proc, ThreadState *thr) { in ProcUnwire()
|
| H A D | tsan_sync.cpp | 19 void DDMutexInit(ThreadState *thr, uptr pc, SyncVar *s); 23 void SyncVar::Init(ThreadState *thr, uptr pc, uptr addr, bool save_stack) { in Init() 47 void MetaMap::AllocBlock(ThreadState *thr, uptr pc, uptr p, uptr sz) { in AllocBlock() 204 SyncVar *MetaMap::GetSync(ThreadState *thr, uptr pc, uptr addr, bool create, in GetSync()
|
| /llvm-project/compiler-rt/lib/tsan/go/ |
| H A D | tsan_go.cpp | 121 static ThreadState *main_thr; 136 Processor *ThreadState::proc() { in proc() 142 static ThreadState *AllocGoroutine() { in AllocGoroutine() 143 auto *thr = (ThreadState *)Alloc(sizeof(ThreadState)); in AllocGoroutine() 148 void __tsan_init(ThreadState **thrp, Processor **procp, in __tsan_init() 151 ThreadState *thr = AllocGoroutine(); in __tsan_init() 160 ThreadState *thr = main_thr; in __tsan_fini() 169 void __tsan_read(ThreadState *thr, void *addr, void *pc) { in __tsan_read() 173 void __tsan_read_pc(ThreadState *thr, void *addr, uptr callpc, uptr pc) { in __tsan_read_pc() 181 void __tsan_write(ThreadState *thr, void *addr, void *pc) { in __tsan_write() [all …]
|
| /llvm-project/compiler-rt/lib/tsan/tests/unit/ |
| H A D | tsan_mman_test.cpp | 37 ThreadState *thr = cur_thread(); in TEST() 51 ThreadState *thr = cur_thread(); in TEST() 98 ThreadState *thr = cur_thread(); in TEST() 111 ThreadState *thr = cur_thread(); in TEST() 140 ThreadState *thr = cur_thread(); in TEST() 162 ThreadState *thr = cur_thread(); in TEST() 179 ThreadState *thr = cur_thread(); in TEST() 189 ThreadState *thr = cur_thread(); in TEST()
|
| H A D | tsan_sync_test.cpp | 19 ThreadState *thr = cur_thread(); in TEST() 35 ThreadState *thr = cur_thread(); in TEST() 56 ThreadState *thr = cur_thread(); in TEST() 79 ThreadState *thr = cur_thread(); in TEST() 114 ThreadState *thr = cur_thread(); in TEST()
|
| H A D | tsan_trace_test.cpp | 38 thr = static_cast<ThreadState *>( in ThreadArray() 39 MmapOrDie(sizeof(ThreadState), "ThreadState")); in ThreadArray() 61 UnmapOrDie(thr, sizeof(ThreadState)); in Finish() 64 ThreadState *threads[N]; 65 ThreadState *operator[](uptr i) { return threads[i]; } in operator []() 66 ThreadState *operator->() { return threads[0]; } in operator ->() 67 operator ThreadState *() { return threads[0]; } in operator ThreadState*() 273 auto check_thread = [&](ThreadState *thr, uptr size, uptr count, in TRACE_TEST()
|
| /llvm-project/compiler-rt/lib/scudo/standalone/ |
| H A D | tsd_exclusive.h | 18 struct ThreadState { struct 97 if (LIKELY(State.InitState != ThreadState::NotInitialized)) in initThreadMaybe() 136 if (LIKELY(State.InitState == ThreadState::Initialized && in getTSDAndLock() 156 State.InitState = ThreadState::Initialized; in initThread() 165 static thread_local ThreadState State; 174 thread_local ThreadState TSDRegistryExT<Allocator>::State; 193 TSDRegistryT::State.InitState = ThreadState::TornDown; in teardownThread()
|