| /llvm-project-15.0.7/compiler-rt/lib/tsan/rtl-old/ |
| H A D | tsan_rtl_mutex.cpp | 32 : thr(thr) in Callback() 493 thr->clock.set(thr->fast_state.epoch()); in AcquireImpl() 494 thr->clock.acquire(&thr->proc()->clock_cache, c); in AcquireImpl() 500 thr->clock.set(thr->fast_state.epoch()); in ReleaseStoreAcquireImpl() 501 thr->fast_synch_epoch = thr->fast_state.epoch(); in ReleaseStoreAcquireImpl() 508 thr->clock.set(thr->fast_state.epoch()); in ReleaseImpl() 509 thr->fast_synch_epoch = thr->fast_state.epoch(); in ReleaseImpl() 516 thr->clock.set(thr->fast_state.epoch()); in ReleaseStoreImpl() 517 thr->fast_synch_epoch = thr->fast_state.epoch(); in ReleaseStoreImpl() 524 thr->clock.set(thr->fast_state.epoch()); in AcquireReleaseImpl() [all …]
|
| H A D | tsan_rtl_thread.cpp | 82 ReportIgnoresEnabled(thr->tctx, &thr->mop_ignore_set); in ThreadCheckIgnore() 128 thr = 0; in OnCreated() 196 thr = args->thr; in OnStarted() 201 new (thr) in OnStarted() 209 TraceAddEvent(thr, thr->fast_state, EventTypeMop, 0); in OnStarted() 225 if (thr->stk_addr && thr->stk_size) in ThreadFinish() 226 DontNeedShadowFor(thr->stk_addr, thr->stk_size); in ThreadFinish() 227 if (thr->tls_addr && thr->tls_size) in ThreadFinish() 228 DontNeedShadowFor(thr->tls_addr, thr->tls_size); in ThreadFinish() 257 thr->clock.ResetCached(&thr->proc()->clock_cache); in OnFinished() [all …]
|
| H A D | tsan_rtl.h | 239 thr->current = thr; in cur_thread_init() 253 ThreadState *thr; variable 413 uptr size = thr->shadow_stack_pos - thr->shadow_stack; 665 Initialize(thr); in LazyInitialize() 758 TraceAddEvent(thr, thr->fast_state, EventTypeFuncEnter, pc); in FuncEntry() 763 DCHECK_GE(thr->shadow_stack_pos, thr->shadow_stack); in FuncEntry() 765 DCHECK_LT(thr->shadow_stack_pos, thr->shadow_stack_end); in FuncEntry() 767 if (thr->shadow_stack_pos == thr->shadow_stack_end) in FuncEntry() 779 TraceAddEvent(thr, thr->fast_state, EventTypeFuncExit, 0); in FuncExit() 782 DCHECK_GT(thr->shadow_stack_pos, thr->shadow_stack); in FuncExit() [all …]
|
| H A D | tsan_fd.cpp | 100 unref(thr, pc, d->sync); in init() 104 unref(thr, pc, s); in init() 108 unref(thr, pc, s); in init() 111 d->creation_tid = thr->tid; in init() 212 unref(thr, pc, d->sync); in FdClose() 239 init(thr, pc, rfd, ref(s)); in FdPipeCreate() 241 unref(thr, pc, s); in FdPipeCreate() 248 init(thr, pc, fd, allocsync(thr, pc)); in FdEventCreate() 255 init(thr, pc, fd, 0); in FdSignalCreate() 262 init(thr, pc, fd, 0); in FdInotifyCreate() [all …]
|
| H A D | tsan_mman.cpp | 86 if (thr->proc()) in ScopedGlobalProcessor() 103 ProcWire(gp->proc, thr); in ScopedGlobalProcessor() 168 OutputReport(thr, rep); in SignalUnsafeCall() 243 if (write && thr->ignore_reads_and_writes == 0 && thr->is_inited) in OnUserAlloc() 253 if (write && thr->ignore_reads_and_writes == 0 && thr->is_inited) in OnUserFree() 263 user_free(thr, pc, p); in user_realloc() 270 user_free(thr, pc, p); in user_realloc() 359 if (thr->nomalloc) { in Alloc() 369 if (thr->nomalloc) { in FreeImpl() 416 thr->clock.ResetCached(&thr->proc()->clock_cache); in __tsan_on_thread_idle() [all …]
|
| H A D | tsan_rtl.cpp | 589 const int sz = thr->shadow_stack_end - thr->shadow_stack; in GrowShadowStack() 605 DCHECK_LT(thr->shadow_stack_pos, thr->shadow_stack_end); in CurrentStackId() 607 if (thr->shadow_stack_pos == thr->shadow_stack_end) in CurrentStackId() 614 StackTrace(thr->shadow_stack, thr->shadow_stack_pos - thr->shadow_stack)); in CurrentStackId() 673 TraceTime(thr); in TraceSwitchPart() 690 thr->nomalloc++; in TraceSwitch() 698 thr->nomalloc--; in TraceSwitch() 734 thr->mop_ignore_set.Add(CurrentStackId(thr, pc)); in ThreadIgnoreBegin() 754 return thr->shadow_stack_pos - thr->shadow_stack; in __tsan_testonly_shadow_stack_current_size() 760 thr->ignore_sync++; in ThreadIgnoreSyncBegin() [all …]
|
| H A D | tsan_interceptors_posix.cpp | 319 : thr(thr) in BlockingCall() 341 ThreadState *thr; member 390 FuncExit(thr); in at_exit_callback_installed_at() 400 FuncExit(thr); in cxa_at_exit_callback_installed_at() 466 FuncExit(thr); in on_exit_callback_installed_at() 1179 ThreadState *thr; member 1249 thr, pc, &si, in INTERCEPTOR() 1260 thr, pc, &si, in INTERCEPTOR() 2297 cbdata.thr = thr; in TSAN_INTERCEPTOR() 2558 explicit ScopedSyscall(ThreadState *thr) : thr(thr) { LazyInitialize(thr); } in ScopedSyscall() [all …]
|
| H A D | tsan_rtl_access.cpp | 31 thr->trace_prev_pc = pc; in TryTraceMemoryAccess() 74 TraceRelease(thr, ev); in TryTraceMemoryAccessRange() 82 TraceSwitchPart(thr); in TraceMemoryAccessRange() 90 TraceSwitchPart(thr); in TraceFunc() 109 TraceEvent(thr, ev); in TraceMutexLock() 121 TraceEvent(thr, ev); in TraceMutexUnlock() 134 TraceEvent(thr, ev); in TraceTime() 166 ReportRace(thr); in HandleRace() 420 (void)thr; in MemoryRangeSet() 491 TraceAddEvent(thr, thr->fast_state, EventTypeMop, pc); in MemoryRangeFreed() [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); 45 void FdFileCreate(ThreadState *thr, uptr pc, int fd); 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); 51 void FdPollCreate(ThreadState *thr, uptr pc, int fd); 52 void FdSocketCreate(ThreadState *thr, uptr pc, int fd); 55 void FdSocketConnect(ThreadState *thr, uptr pc, int fd); [all …]
|
| H A D | tsan_interface.cpp | 31 ThreadState *thr = cur_thread(); in __tsan_read16() local 32 MemoryAccess(thr, pc, (uptr)addr, 8, kAccessRead); in __tsan_read16() 33 MemoryAccess(thr, pc, (uptr)addr + 8, 8, kAccessRead); in __tsan_read16() 38 ThreadState *thr = cur_thread(); in __tsan_write16() local 39 MemoryAccess(thr, pc, (uptr)addr, 8, kAccessWrite); in __tsan_write16() 40 MemoryAccess(thr, pc, (uptr)addr + 8, 8, kAccessWrite); in __tsan_write16() 45 ThreadState *thr = cur_thread(); in __tsan_read16_pc() local 46 MemoryAccess(thr, pc_no_pac, (uptr)addr, 8, kAccessRead); in __tsan_read16_pc() 52 ThreadState *thr = cur_thread(); in __tsan_write16_pc() local 61 ThreadState *thr = cur_thread(); in __tsan_unaligned_read16() local [all …]
|
| /llvm-project-15.0.7/compiler-rt/lib/tsan/rtl/ |
| H A D | tsan_rtl_mutex.cpp | 30 ThreadState *thr; member 34 : thr(thr) in Callback() 45 Callback cb(thr, pc); in DDMutexInit() 65 OutputReport(thr, rep); in ReportMutexMisuse() 146 Callback cb(thr, pc); in MutexPreLock() 270 Callback cb(thr, pc); in MutexPreReadLock() 473 IncrementEpoch(thr); in Release() 486 IncrementEpoch(thr); in ReleaseStore() 499 IncrementEpoch(thr); in ReleaseStoreAcquire() 511 TraceTime(thr); in IncrementEpoch() [all …]
|
| H A D | tsan_rtl_thread.cpp | 78 ReportIgnoresEnabled(thr->tctx, &thr->mop_ignore_set); in ThreadCheckIgnore() 80 ReportIgnoresEnabled(thr->tctx, &thr->sync_ignore_set); in ThreadCheckIgnore() 120 if (thr) { in ThreadCreate() 158 thr->clock.Acquire(thr->tctx->sync); in ThreadStart() 217 if (thr->stk_addr && thr->stk_size) in ThreadFinish() 218 DontNeedShadowFor(thr->stk_addr, thr->stk_size); in ThreadFinish() 219 if (thr->tls_addr && thr->tls_size) in ThreadFinish() 220 DontNeedShadowFor(thr->tls_addr, thr->tls_size); in ThreadFinish() 233 thr->clock.ReleaseStore(&thr->tctx->sync); in ThreadFinish() 248 SlotDetach(thr); in ThreadFinish() [all …]
|
| H A D | tsan_fd.cpp | 109 unref(thr, pc, in init() 114 unref(thr, pc, s); in init() 118 unref(thr, pc, s); in init() 127 SlotLocker locker(thr); in init() 239 unref(thr, pc, d->sync); in FdClose() 241 unref(thr, pc, in FdClose() 272 unref(thr, pc, s); in FdPipeCreate() 279 init(thr, pc, fd, allocsync(thr, pc)); in FdEventCreate() 286 init(thr, pc, fd, 0); in FdSignalCreate() 293 init(thr, pc, fd, 0); in FdInotifyCreate() [all …]
|
| H A D | tsan_rtl.h | 142 ThreadState *thr; member 252 thr->current = thr; in cur_thread_init() 266 ThreadState *thr; variable 465 uptr size = thr->shadow_stack_pos - thr->shadow_stack; 610 void SlotLock(ThreadState *thr) SANITIZER_ACQUIRE(thr->slot->mtx); 647 SlotUnlocker(ThreadState *thr) : thr_(thr), locked_(thr->slot_locked) { in SlotUnlocker() argument 773 DCHECK_GE(thr->shadow_stack_pos, thr->shadow_stack); in FuncEntry() 775 DCHECK_LT(thr->shadow_stack_pos, thr->shadow_stack_end); in FuncEntry() 777 if (thr->shadow_stack_pos == thr->shadow_stack_end) in FuncEntry() 789 DCHECK_GT(thr->shadow_stack_pos, thr->shadow_stack); in FuncExit() [all …]
|
| H A D | tsan_rtl.cpp | 151 bool attached = tctx->thr && tctx->thr->slot; in DoResetImpl() 180 if (tctx->thr && !tctx->thr->slot) { in DoResetImpl() 297 slot->thr = thr; in SlotAttachAndLock() 319 if (thr != slot->thr) { in SlotDetachImpl() 365 if (LIKELY(thr == slot->thr && thr->fast_state.epoch() != kEpochLast)) in SlotLock() 873 const int sz = thr->shadow_stack_end - thr->shadow_stack; in GrowShadowStack() 893 if (thr->shadow_stack_pos == thr->shadow_stack_end) in CurrentStackId() 900 StackTrace(thr->shadow_stack, thr->shadow_stack_pos - thr->shadow_stack)); in CurrentStackId() 1037 thr->mop_ignore_set.Add(CurrentStackId(thr, pc)); in ThreadIgnoreBegin() 1057 return thr->shadow_stack_pos - thr->shadow_stack; in __tsan_testonly_shadow_stack_current_size() [all …]
|
| H A D | tsan_mman.cpp | 86 if (thr->proc()) in ScopedGlobalProcessor() 103 ProcWire(gp->proc, thr); in ScopedGlobalProcessor() 109 if (thr->proc() != gp->proc) in ~ScopedGlobalProcessor() 111 ProcUnwire(gp->proc, thr); in ~ScopedGlobalProcessor() 174 OutputReport(thr, rep); in SignalUnsafeCall() 266 if (!thr->slot) { in OnUserFree() 272 SlotLocker locker(thr); in OnUserFree() 285 user_free(thr, pc, p); in user_realloc() 292 user_free(thr, pc, p); in user_realloc() 381 if (thr->nomalloc) { in Alloc() [all …]
|
| H A D | tsan_interceptors_posix.cpp | 324 : thr(thr) in BlockingCall() 346 ThreadState *thr; member 395 FuncExit(thr); in at_exit_callback_installed_at() 405 FuncExit(thr); in cxa_at_exit_callback_installed_at() 471 FuncExit(thr); in on_exit_callback_installed_at() 1184 ThreadState *thr; member 1254 thr, pc, &si, in INTERCEPTOR() 1265 thr, pc, &si, in INTERCEPTOR() 2303 cbdata.thr = thr; in TSAN_INTERCEPTOR() 2564 explicit ScopedSyscall(ThreadState *thr) : thr(thr) { LazyInitialize(thr); } in ScopedSyscall() [all …]
|
| H A D | tsan_rtl_access.cpp | 82 TraceSwitchPart(thr); in TraceMemoryAccessRange() 90 TraceSwitchPart(thr); in TraceFunc() 96 TraceSwitchPart(thr); in TraceRestartFuncEntry() 97 FuncEntry(thr, pc); in TraceRestartFuncEntry() 101 TraceSwitchPart(thr); in TraceRestartFuncExit() 102 FuncExit(thr); in TraceRestartFuncExit() 119 TraceEvent(thr, ev); in TraceMutexLock() 131 TraceEvent(thr, ev); in TraceMutexUnlock() 145 TraceEvent(thr, ev); in TraceTime() 165 SlotUnlock(thr); in DoReportRace() [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); 45 void FdFileCreate(ThreadState *thr, uptr pc, int fd); 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); 51 void FdPollCreate(ThreadState *thr, uptr pc, int fd); 53 void FdSocketCreate(ThreadState *thr, uptr pc, int fd); 56 void FdSocketConnect(ThreadState *thr, uptr pc, int fd); [all …]
|
| /llvm-project-15.0.7/compiler-rt/lib/tsan/go/ |
| H A D | tsan_go.cpp | 144 internal_memset(thr, 0, sizeof(*thr)); in AllocGoroutine() 145 return thr; in AllocGoroutine() 153 Initialize(thr); in __tsan_init() 154 *procp = thr->proc1; in __tsan_init() 178 FuncExit(thr); in __tsan_read_pc() 190 FuncExit(thr); in __tsan_write_pc() 206 FuncExit(thr); in __tsan_func_exit() 211 if (thr && pc) in __tsan_malloc() 222 *pthr = thr; in __tsan_go_start() 228 ThreadFinish(thr); in __tsan_go_end() [all …]
|
| /llvm-project-15.0.7/compiler-rt/lib/tsan/tests/unit/ |
| H A D | tsan_mman_test.cpp | 46 user_free(thr, pc, p); in TEST() 47 user_free(thr, pc, p2); in TEST() 58 user_free(thr, pc, p); in TEST() 105 user_free(thr, pc, p); in TEST() 131 user_free(thr, 0, p); in TEST() 145 user_free(thr, 0, p); in TEST() 149 user_free(thr, 0, p); in TEST() 154 user_free(thr, 0, p); in TEST() 166 user_free(thr, 0, p); in TEST() 185 user_free(thr, 0, p); in TEST() [all …]
|
| H A D | tsan_trace_test.cpp | 42 ProcWire(proc, thr); in ThreadArray() 58 ThreadFinish(thr); in Finish() 74 ThreadArray<1> thr; in TRACE_TEST() local 75 TraceFunc(thr, 0x1000); in TRACE_TEST() 76 TraceFunc(thr, 0x1001); in TRACE_TEST() 80 TraceFunc(thr); in TRACE_TEST() 83 TraceFunc(thr, 0x1002); in TRACE_TEST() 172 ThreadArray<1> thr; in TRACE_TEST() local 202 ThreadArray<1> thr; in TRACE_TEST() local 215 FuncExit(thr); in TRACE_TEST() [all …]
|
| H A D | tsan_sync_test.cpp | 19 ThreadState *thr = cur_thread(); in TEST() local 20 SlotLocker locker(thr); in TEST() 27 CHECK_EQ(mb->tid, thr->tid); in TEST() 35 ThreadState *thr = cur_thread(); in TEST() local 36 SlotLocker locker(thr); in TEST() 56 ThreadState *thr = cur_thread(); in TEST() local 57 SlotLocker locker(thr); in TEST() 74 m->OnProcIdle(thr->proc()); in TEST() 79 ThreadState *thr = cur_thread(); in TEST() local 80 SlotLocker locker(thr); in TEST() [all …]
|
| /llvm-project-15.0.7/compiler-rt/lib/tsan/dd/ |
| H A D | dd_rtl.cpp | 23 thr->ignore_interceptors = true; in CurrentStackTrace() 57 Callback::Callback(Thread *thr) in Callback() argument 58 : thr(thr) { in Callback() 59 lt = thr->dd_lt; in Callback() 60 pt = thr->dd_pt; in Callback() 99 void ThreadInit(Thread *thr) { in ThreadInit() argument 112 if (thr->ignore_interceptors) in MutexBeforeLock() 114 Callback cb(thr); in MutexBeforeLock() 127 Callback cb(thr); in MutexAfterLock() 140 Callback cb(thr); in MutexBeforeUnlock() [all …]
|
| H A D | dd_interceptors.cpp | 19 static __thread Thread *thr; variable 29 if (thr != 0) in InitThread() 36 thr = (Thread*)InternalAlloc(sizeof(*thr)); in InitThread() 37 internal_memset(thr, 0, sizeof(*thr)); in InitThread() 38 ThreadInit(thr); in InitThread() 45 MutexDestroy(thr, (uptr)m); in INTERCEPTOR() 51 MutexBeforeLock(thr, (uptr)m, true); in INTERCEPTOR() 74 MutexDestroy(thr, (uptr)m); in INTERCEPTOR() 80 MutexBeforeLock(thr, (uptr)m, true); in INTERCEPTOR() 102 MutexDestroy(thr, (uptr)m); in INTERCEPTOR() [all …]
|