/llvm-project/compiler-rt/lib/tsan/rtl/ |
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; member 33 Callback(ThreadState *thr, uptr pc) in Callback() 34 : thr(thr) in Callback() 36 DDCallback::pt = thr->proc()->dd_pt; in Callback() 37 DDCallback::lt = thr->dd_lt; in Callback() 40 StackID Unwind() override { return CurrentStackId(thr, pc); } in Unwind() 41 int UniqueTid() override { return thr->tid; } in UniqueTid() 44 void DDMutexInit(ThreadState *thr, uptr pc, SyncVar *s) { in DDMutexInit() argument [all …]
|
H A D | tsan_rtl_thread.cpp | 24 ThreadContext::ThreadContext(Tid tid) : ThreadContextBase(tid), thr(), sync() {} in ThreadContext() 74 static void ThreadCheckIgnore(ThreadState *thr) { in ThreadCheckIgnore() argument 77 if (thr->ignore_reads_and_writes) in ThreadCheckIgnore() 78 ReportIgnoresEnabled(thr->tctx, &thr->mop_ignore_set); in ThreadCheckIgnore() 79 if (thr->ignore_sync) in ThreadCheckIgnore() 80 ReportIgnoresEnabled(thr->tctx, &thr->sync_ignore_set); in ThreadCheckIgnore() 83 static void ThreadCheckIgnore(ThreadState *thr) {} in ThreadCheckIgnore() argument 86 void ThreadFinalize(ThreadState *thr) { in ThreadFinalize() argument 104 ThreadCount(ThreadState * thr) ThreadCount() argument 116 ThreadCreate(ThreadState * thr,uptr pc,uptr uid,bool detached) ThreadCreate() argument 145 ThreadState *thr; global() member 152 ThreadStart(ThreadState * thr,Tid tid,tid_t os_id,ThreadType thread_type) ThreadStart() argument 214 ThreadFinish(ThreadState * thr) ThreadFinish() argument 284 ThreadConsumeTid(ThreadState * thr,uptr pc,uptr uid) ThreadConsumeTid() argument 293 ThreadJoin(ThreadState * thr,uptr pc,Tid tid) ThreadJoin() argument 316 ThreadDetach(ThreadState * thr,uptr pc,Tid tid) ThreadDetach() argument 323 ThreadNotJoined(ThreadState * thr,uptr pc,Tid tid,uptr uid) ThreadNotJoined() argument 328 ThreadSetName(ThreadState * thr,const char * name) ThreadSetName() argument 340 FiberCreate(ThreadState * thr,uptr pc,unsigned flags) FiberCreate() argument 351 FiberDestroy(ThreadState * thr,uptr pc,ThreadState * fiber) FiberDestroy() argument 358 FiberSwitch(ThreadState * thr,uptr pc,ThreadState * fiber,unsigned flags) FiberSwitch() argument [all...] |
H A D | tsan_fd.cpp | 56 static FdSync *allocsync(ThreadState *thr, uptr pc) { in allocsync() argument 57 FdSync *s = (FdSync*)user_alloc_internal(thr, pc, sizeof(FdSync), in allocsync() 69 static void unref(ThreadState *thr, uptr pc, FdSync *s) { in unref() argument 75 user_free(thr, pc, s, false); in unref() 80 static FdDesc *fddesc(ThreadState *thr, uptr pc, int fd) { in fddesc() argument 88 void *p = user_alloc_internal(thr, pc, size, kDefaultAlignment, false); in fddesc() 90 MemoryResetRange(thr, (uptr)&fddesc, (uptr)p, size); in fddesc() 94 user_free(thr, pc, p, false); in fddesc() 101 static void init(ThreadState *thr, uptr pc, int fd, FdSync *s, in init() argument 103 FdDesc *d = fddesc(thr, pc, fd); in init() [all …]
|
H A D | tsan_rtl.h | 114 ThreadState *thr; // currently wired thread, or nullptr member 143 ThreadState *thr; member 242 void set_cur_thread(ThreadState *thr); 252 ThreadState *thr = reinterpret_cast<ThreadState *>(cur_thread_placeholder); in cur_thread_init() local 253 if (UNLIKELY(!thr->current)) in cur_thread_init() 254 thr->current = thr; in cur_thread_init() 255 return thr->current; in cur_thread_init() 257 inline void set_cur_thread(ThreadState *thr) { in set_cur_thread() argument 258 reinterpret_cast<ThreadState *>(cur_thread_placeholder)->current = thr; in set_cur_thread() 268 ThreadState *thr; global() variable 477 GET_STACK_TRACE_FATAL(thr,pc) global() argument 536 MemoryAccessRange(ThreadState * thr,uptr pc,uptr addr,uptr size,bool is_write) MemoryAccessRange() argument 632 thr_(thr) thr_() argument 657 SlotUnlocker(ThreadState * thr) SlotUnlocker() argument 672 ProcessPendingSignals(ThreadState * thr) ProcessPendingSignals() argument 680 LazyInitialize(ThreadState * thr) LazyInitialize() argument 699 TraceAcquire(ThreadState * thr,EventT ** ev) TraceAcquire() argument 729 TraceRelease(ThreadState * thr,EventT * evp) TraceRelease() argument 735 TraceEvent(ThreadState * thr,EventT ev) TraceEvent() argument 780 FuncEntry(ThreadState * thr,uptr pc) FuncEntry() argument 796 FuncExit(ThreadState * thr) FuncExit() argument [all...] |
H A D | tsan_rtl.cpp | 80 static TracePart* TracePartAlloc(ThreadState* thr) { 85 Trace* trace = &thr->tctx->trace; in TracePartAlloc() 89 DPrintf("#%d: TracePartAlloc: part=%p\n", thr->tid, part); in TracePartAlloc() 152 bool attached = tctx->thr && tctx->thr->slot; in DoResetImpl() 172 &tctx->thr->trace_pos, in DoResetImpl() 181 if (tctx->thr && !tctx->thr->slot) { in DoResetImpl() 182 atomic_store_relaxed(&tctx->thr->trace_pos, 0); in DoResetImpl() 183 tctx->thr in DoResetImpl() 81 TracePartAlloc(ThreadState * thr) TracePartAlloc() argument 234 DoReset(ThreadState * thr,uptr epoch) DoReset() argument 253 FindSlotAndLock(ThreadState * thr) FindSlotAndLock() argument 297 SlotAttachAndLock(ThreadState * thr) SlotAttachAndLock() argument 321 SlotDetachImpl(ThreadState * thr,bool exiting) SlotDetachImpl() argument 353 SlotDetach(ThreadState * thr) SlotDetach() argument 358 SlotLock(ThreadState * thr) SlotLock() argument 378 SlotUnlock(ThreadState * thr) SlotUnlock() argument 570 UnmapShadow(ThreadState * thr,uptr addr,uptr size) UnmapShadow() argument 671 ThreadState* thr = cur_thread(); CheckUnwind() local 682 Initialize(ThreadState * thr) Initialize() argument 769 Finalize(ThreadState * thr) Finalize() argument 809 ForkBefore(ThreadState * thr,uptr pc) ForkBefore() argument 838 ForkAfter(ThreadState * thr,bool child) ForkAfter() argument 853 ForkParentAfter(ThreadState * thr,uptr pc) ForkParentAfter() argument 855 ForkChildAfter(ThreadState * thr,uptr pc,bool start_thread) ForkChildAfter() argument 880 GrowShadowStack(ThreadState * thr) GrowShadowStack() argument 892 CurrentStackId(ThreadState * thr,uptr pc) CurrentStackId() argument 914 TraceSkipGap(ThreadState * thr) TraceSkipGap() argument 945 TraceSwitchPart(ThreadState * thr) TraceSwitchPart() argument 962 TraceSwitchPartImpl(ThreadState * thr) TraceSwitchPartImpl() argument 1038 ThreadIgnoreBegin(ThreadState * thr,uptr pc) ThreadIgnoreBegin() argument 1049 ThreadIgnoreEnd(ThreadState * thr) ThreadIgnoreEnd() argument 1064 ThreadState *thr = cur_thread(); __tsan_testonly_shadow_stack_current_size() local 1069 ThreadIgnoreSyncBegin(ThreadState * thr,uptr pc) ThreadIgnoreSyncBegin() argument 1079 ThreadIgnoreSyncEnd(ThreadState * thr) ThreadIgnoreSyncEnd() argument [all...] |
H A D | tsan_mman.cpp | 90 ThreadState *thr = cur_thread(); in ScopedGlobalProcessor() local 91 if (thr->proc()) in ScopedGlobalProcessor() 108 ProcWire(gp->proc, thr); in ScopedGlobalProcessor() 113 ThreadState *thr = cur_thread(); in ~ScopedGlobalProcessor() local 114 if (thr->proc() != gp->proc) in ~ScopedGlobalProcessor() 116 ProcUnwire(gp->proc, thr); in ~ScopedGlobalProcessor() 177 static void SignalUnsafeCall(ThreadState *thr, uptr pc) { in SignalUnsafeCall() argument 178 if (atomic_load_relaxed(&thr->in_signal_handler) == 0 || in SignalUnsafeCall() 179 !ShouldReport(thr, ReportTypeSignalUnsafe)) in SignalUnsafeCall() 182 ObtainCurrentStack(thr, p in SignalUnsafeCall() 192 user_alloc_internal(ThreadState * thr,uptr pc,uptr sz,uptr align,bool signal) user_alloc_internal() argument 224 user_free(ThreadState * thr,uptr pc,void * p,bool signal) user_free() argument 233 user_alloc(ThreadState * thr,uptr pc,uptr sz) user_alloc() argument 237 user_calloc(ThreadState * thr,uptr pc,uptr size,uptr n) user_calloc() argument 250 user_reallocarray(ThreadState * thr,uptr pc,void * p,uptr size,uptr n) user_reallocarray() argument 260 OnUserAlloc(ThreadState * thr,uptr pc,uptr p,uptr sz,bool write) OnUserAlloc() argument 278 OnUserFree(ThreadState * thr,uptr pc,uptr p,bool write) OnUserFree() argument 293 user_realloc(ThreadState * thr,uptr pc,void * p,uptr sz) user_realloc() argument 311 user_memalign(ThreadState * thr,uptr pc,uptr align,uptr sz) user_memalign() argument 322 user_posix_memalign(ThreadState * thr,uptr pc,void ** memptr,uptr align,uptr sz) user_posix_memalign() argument 339 user_aligned_alloc(ThreadState * thr,uptr pc,uptr align,uptr sz) user_aligned_alloc() argument 350 user_valloc(ThreadState * thr,uptr pc,uptr sz) user_valloc() argument 354 user_pvalloc(ThreadState * thr,uptr pc,uptr sz) user_pvalloc() argument 405 ThreadState *thr = cur_thread(); invoke_malloc_hook() local 412 ThreadState *thr = cur_thread(); invoke_free_hook() local 419 ThreadState *thr = cur_thread(); Alloc() local 429 ThreadState *thr = cur_thread(); FreeImpl() local 491 ThreadState *thr = cur_thread(); __tsan_on_thread_idle() local [all...] |
H A D | tsan_interceptors_posix.cpp | 183 void EnterBlockingFunc(ThreadState *thr) { in EnterBlockingFunc() 189 atomic_store(&thr->in_blocking_func, 1, memory_order_relaxed); in EnterBlockingFunc() 190 if (atomic_load(&thr->pending_signals, memory_order_relaxed) == 0) in EnterBlockingFunc() 192 atomic_store(&thr->in_blocking_func, 0, memory_order_relaxed); in EnterBlockingFunc() 193 ProcessPendingSignals(thr); in EnterBlockingFunc() 265 static ThreadSignalContext *SigCtx(ThreadState *thr) { in SigCtx() 268 uptr ctx = atomic_load(&thr->signal_ctx, memory_order_relaxed); in SigCtx() 269 if (ctx == 0 && !thr->is_dead) { in SigCtx() 272 MemoryResetRange(thr, (uptr)&SigCtx, pctx, sizeof(ThreadSignalContext)); in SigCtx() 273 if (atomic_compare_exchange_strong(&thr in SigCtx() 182 EnterBlockingFunc(ThreadState * thr) EnterBlockingFunc() argument 257 SigCtx(ThreadState * thr) SigCtx() argument 275 ScopedInterceptor(ThreadState * thr,const char * fname,uptr pc) ScopedInterceptor() argument 354 READ_STRING_OF_LEN(thr,pc,s,len,n) global() argument 358 READ_STRING(thr,pc,s,n) global() argument 380 ThreadState *thr; global() member 424 ThreadState *thr = cur_thread(); at_exit_callback_installed_at() local 433 ThreadState *thr = cur_thread(); cxa_at_exit_callback_installed_at() local 463 setup_at_exit_wrapper(ThreadState * thr,uptr pc,void (* f)(),void * arg,void * dso) setup_at_exit_wrapper() argument 499 ThreadState *thr = cur_thread(); on_exit_callback_installed_at() local 530 JmpBufGarbageCollect(ThreadState * thr,uptr sp) JmpBufGarbageCollect() argument 542 SetJmp(ThreadState * thr,uptr sp) SetJmp() argument 558 LongJmp(ThreadState * thr,uptr * env) LongJmp() argument 784 mmap_interceptor(ThreadState * thr,uptr pc,Mmap real_mmap,void * addr,SIZE_T sz,int prot,int flags,int fd,OFF64_T off) mmap_interceptor() argument 802 munmap_interceptor(ThreadState * thr,uptr pc,Munmap real_munmap,void * addr,SIZE_T sz) munmap_interceptor() argument 875 guard_acquire(ThreadState * thr,uptr pc,atomic_uint32_t * g,bool blocking_hooks=true) guard_acquire() argument 903 guard_release(ThreadState * thr,uptr pc,atomic_uint32_t * g,u32 v) guard_release() argument 947 ThreadState *thr = cur_thread(); DestroyThreadState() local 956 PlatformCleanUpThreadState(ThreadState * thr) PlatformCleanUpThreadState() argument 995 ThreadState *thr = cur_thread_init(); __tsan_thread_start_func() local 1196 ThreadState *thr; global() member 1230 cond_wait(ThreadState * thr,uptr pc,ScopedInterceptor * si,const Fn & fn,void * c,void * m) cond_wait() argument 2062 ReportErrnoSpoiling(ThreadState * thr,uptr pc,int sig) ReportErrnoSpoiling() argument 2076 CallUserSignalHandler(ThreadState * thr,bool sync,bool acquire,int sig,__sanitizer_siginfo * info,void * uctx) CallUserSignalHandler() argument 2140 ProcessPendingSignalsImpl(ThreadState * thr) ProcessPendingSignalsImpl() argument 2180 ThreadState *thr = cur_thread_init(); sighandler() local 2294 ThreadState *thr = cur_thread(); atfork_prepare() local 2302 ThreadState *thr = cur_thread(); atfork_parent() local 2310 ThreadState *thr = cur_thread(); atfork_child() local 2345 auto *thr = cur_thread(); TSAN_INTERCEPTOR() local 2370 ThreadState *thr; global() member 2412 OnExit(ThreadState * thr) OnExit() argument 2419 HandleRecvmsg(ThreadState * thr,uptr pc,__sanitizer_msghdr * msg) HandleRecvmsg() argument 2637 ThreadState *thr; global() member 2665 auto *thr = cur_thread(); syscall_fd_close() local 2683 ThreadState *thr = cur_thread(); sycall_blocking_start() local 2695 ThreadState *thr = cur_thread(); sycall_blocking_end() local 2703 ThreadState *thr = cur_thread(); syscall_post_fork() local 2763 ThreadState *thr = cur_thread(); handle_tls_addr() local 2866 ThreadState *thr = cur_thread(); finalize() local [all...] |
H A D | tsan_rtl_access.cpp | 18 ALWAYS_INLINE USED bool TryTraceMemoryAccess(ThreadState* thr, uptr pc, in TryTraceMemoryAccess() argument 25 if (UNLIKELY(!TraceAcquire(thr, &ev))) in TryTraceMemoryAccess() 28 uptr pc_delta = pc - thr->trace_prev_pc + (1 << (EventAccess::kPCBits - 1)); in TryTraceMemoryAccess() 29 thr->trace_prev_pc = pc; in TryTraceMemoryAccess() 38 TraceRelease(thr, ev); in TryTraceMemoryAccess() 52 TraceRelease(thr, evex); in TryTraceMemoryAccess() 57 bool TryTraceMemoryAccessRange(ThreadState* thr, uptr pc, uptr addr, uptr size, in TryTraceMemoryAccessRange() argument 62 if (UNLIKELY(!TraceAcquire(thr, &ev))) in TryTraceMemoryAccessRange() 64 thr->trace_prev_pc = pc; in TryTraceMemoryAccessRange() 74 TraceRelease(thr, e in TryTraceMemoryAccessRange() 78 TraceMemoryAccessRange(ThreadState * thr,uptr pc,uptr addr,uptr size,AccessType typ) TraceMemoryAccessRange() argument 87 TraceFunc(ThreadState * thr,uptr pc) TraceFunc() argument 95 TraceRestartFuncEntry(ThreadState * thr,uptr pc) TraceRestartFuncEntry() argument 100 TraceRestartFuncExit(ThreadState * thr) TraceRestartFuncExit() argument 105 TraceMutexLock(ThreadState * thr,EventType type,uptr pc,uptr addr,StackID stk) TraceMutexLock() argument 122 TraceMutexUnlock(ThreadState * thr,uptr addr) TraceMutexUnlock() argument 134 TraceTime(ThreadState * thr) TraceTime() argument 148 DoReportRace(ThreadState * thr,RawShadow * shadow_mem,Shadow cur,Shadow old,AccessType typ) DoReportRace() argument 195 CheckRaces(ThreadState * thr,RawShadow * shadow_mem,Shadow cur,int unused0,int unused1,AccessType typ) CheckRaces() argument 274 DoReportRaceV(ThreadState * thr,RawShadow * shadow_mem,Shadow cur,u32 race_mask,m128 shadow,AccessType typ) DoReportRaceV() argument 305 CheckRaces(ThreadState * thr,RawShadow * shadow_mem,Shadow cur,m128 shadow,m128 access,AccessType typ) CheckRaces() argument 414 TraceRestartMemoryAccess(ThreadState * thr,uptr pc,uptr addr,uptr size,AccessType typ) TraceRestartMemoryAccess() argument 420 MemoryAccess(ThreadState * thr,uptr pc,uptr addr,uptr size,AccessType typ) MemoryAccess() argument 448 RestartMemoryAccess16(ThreadState * thr,uptr pc,uptr addr,AccessType typ) RestartMemoryAccess16() argument 454 MemoryAccess16(ThreadState * thr,uptr pc,uptr addr,AccessType typ) MemoryAccess16() argument 484 RestartUnalignedMemoryAccess(ThreadState * thr,uptr pc,uptr addr,uptr size,AccessType typ) RestartUnalignedMemoryAccess() argument 490 UnalignedMemoryAccess(ThreadState * thr,uptr pc,uptr addr,uptr size,AccessType typ) UnalignedMemoryAccess() argument 583 MemoryResetRange(ThreadState * thr,uptr pc,uptr addr,uptr size) MemoryResetRange() argument 589 MemoryRangeFreed(ThreadState * thr,uptr pc,uptr addr,uptr size) MemoryRangeFreed() argument 633 MemoryRangeImitateWrite(ThreadState * thr,uptr pc,uptr addr,uptr size) MemoryRangeImitateWrite() argument 641 MemoryRangeImitateWriteOrResetRange(ThreadState * thr,uptr pc,uptr addr,uptr size) MemoryRangeImitateWriteOrResetRange() argument 650 MemoryAccessRangeOne(ThreadState * thr,RawShadow * shadow_mem,Shadow cur,AccessType typ) MemoryAccessRangeOne() argument 659 RestartMemoryAccessRange(ThreadState * thr,uptr pc,uptr addr,uptr size) RestartMemoryAccessRange() argument 666 MemoryAccessRangeT(ThreadState * thr,uptr pc,uptr addr,uptr size) MemoryAccessRangeT() argument [all...] |
H A D | tsan_interface_ann.cpp | 32 ScopedAnnotation(ThreadState *thr, const char *aname, uptr pc) in ScopedAnnotation() argument 33 : thr_(thr) { in ScopedAnnotation() 49 ThreadState *thr = cur_thread(); \ 51 ScopedAnnotation sa(thr, __func__, caller_pc); \ 152 Release(thr, pc, addr); in AnnotateHappensBefore() 157 Acquire(thr, pc, addr); in AnnotateHappensAfter() 175 MutexCreate(thr, pc, m, MutexFlagWriteReentrant); in AnnotateRWLockCreate() 180 MutexCreate(thr, pc, m, MutexFlagWriteReentrant | MutexFlagLinkerInit); in AnnotateRWLockCreateStatic() 185 MutexDestroy(thr, pc, m); in AnnotateRWLockDestroy() 192 MutexPostLock(thr, p in AnnotateRWLockAcquired() 439 ReportMutexHeldWrongContext(ThreadState * thr,uptr pc) ReportMutexHeldWrongContext() 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_interface_java.cpp | 60 ThreadState *thr = cur_thread(); \ 61 (void)thr; 65 Initialize(thr); in __tsan_java_init() 66 DPrintf("#%d: java_init(0x%zx, 0x%zx)\n", thr->tid, heap_begin, heap_size); in __tsan_java_init() 78 DPrintf("#%d: java_fini()\n", thr->tid); in __tsan_java_fini() 81 int status = Finalize(thr); in __tsan_java_fini() 82 DPrintf("#%d: java_fini() = %d\n", thr->tid, status); in __tsan_java_fini() 88 DPrintf("#%d: java_alloc(0x%zx, 0x%zx)\n", thr->tid, ptr, size); in __tsan_java_alloc() 96 OnUserAlloc(thr, 0, ptr, size, false); in __tsan_java_alloc() 101 DPrintf("#%d: java_free(0x%zx, 0x%zx)\n", thr->tid, ptr, size); in __tsan_java_free() [all …]
|
H A D | tsan_rtl_proc.cpp | 24 proc->thr = nullptr; in ProcCreate() 34 CHECK_EQ(proc->thr, nullptr); in ProcDestroy() 45 void ProcWire(Processor *proc, ThreadState *thr) { in ProcWire() argument 46 CHECK_EQ(thr->proc1, nullptr); in ProcWire() 47 CHECK_EQ(proc->thr, nullptr); in ProcWire() 48 thr->proc1 = proc; in ProcWire() 49 proc->thr = thr; in ProcWire() 52 void ProcUnwire(Processor *proc, ThreadState *thr) { in ProcUnwire() argument 53 CHECK_EQ(thr->proc1, proc); in ProcUnwire() 54 CHECK_EQ(proc->thr, thr); in ProcUnwire() [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() 229 MemoryAccess(thr, pc, (uptr)a, AccessSize<T>(), kAccessWrite | kAccessAtomic); in AtomicLoad() 232 SlotLocker locker(thr); in AtomicLoad() 234 auto s = ctx->metamap.GetSyncOrCreate(thr, pc, (uptr)a, false); in AtomicLoad() 237 thr->clock.ReleaseAcquire(&s->clock); in AtomicLoad() 239 thr->clock.Release(&s->clock); in AtomicLoad() 241 thr->clock.Acquire(s->clock); in AtomicLoad() 245 IncrementEpoch(thr); in AtomicLoad() 263 static T Atomic(ThreadState *thr, uptr pc, morder mo, const volatile T *a) { in AtomicStore() 268 MemoryAccess(thr, p in AtomicStore() 224 AtomicLoad(ThreadState * thr,uptr pc,const volatile T * a,morder mo) AtomicLoad() argument 262 AtomicStore(ThreadState * thr,uptr pc,volatile T * a,T v,morder mo) AtomicStore() argument 285 AtomicRMW(ThreadState * thr,uptr pc,volatile T * a,T v,morder mo) AtomicRMW() argument 342 AtomicExchange(ThreadState * thr,uptr pc,volatile T * a,T v,morder mo) AtomicExchange() argument 348 AtomicFetchAdd(ThreadState * thr,uptr pc,volatile T * a,T v,morder mo) AtomicFetchAdd() argument 354 AtomicFetchSub(ThreadState * thr,uptr pc,volatile T * a,T v,morder mo) AtomicFetchSub() argument 360 AtomicFetchAnd(ThreadState * thr,uptr pc,volatile T * a,T v,morder mo) AtomicFetchAnd() argument 366 AtomicFetchOr(ThreadState * thr,uptr pc,volatile T * a,T v,morder mo) AtomicFetchOr() argument 372 AtomicFetchXor(ThreadState * thr,uptr pc,volatile T * a,T v,morder mo) AtomicFetchXor() argument 378 AtomicFetchNand(ThreadState * thr,uptr pc,volatile T * a,T v,morder mo) AtomicFetchNand() argument 407 AtomicCAS(ThreadState * thr,uptr pc,volatile T * a,T * c,T v,morder mo,morder fmo) AtomicCAS() argument 449 AtomicCAS(ThreadState * thr,uptr pc,volatile T * a,T c,T v,morder mo,morder fmo) AtomicCAS() argument 460 AtomicFence(ThreadState * thr,uptr pc,morder mo) AtomicFence() argument 868 __tsan_go_atomic32_load(ThreadState * thr,uptr cpc,uptr pc,u8 * a) __tsan_go_atomic32_load() argument 873 __tsan_go_atomic64_load(ThreadState * thr,uptr cpc,uptr pc,u8 * a) __tsan_go_atomic64_load() argument 878 __tsan_go_atomic32_store(ThreadState * thr,uptr cpc,uptr pc,u8 * a) __tsan_go_atomic32_store() argument 883 __tsan_go_atomic64_store(ThreadState * thr,uptr cpc,uptr pc,u8 * a) __tsan_go_atomic64_store() argument 888 __tsan_go_atomic32_fetch_add(ThreadState * thr,uptr cpc,uptr pc,u8 * a) __tsan_go_atomic32_fetch_add() argument 893 __tsan_go_atomic64_fetch_add(ThreadState * thr,uptr cpc,uptr pc,u8 * a) __tsan_go_atomic64_fetch_add() argument 898 __tsan_go_atomic32_fetch_and(ThreadState * thr,uptr cpc,uptr pc,u8 * a) __tsan_go_atomic32_fetch_and() argument 904 __tsan_go_atomic64_fetch_and(ThreadState * thr,uptr cpc,uptr pc,u8 * a) __tsan_go_atomic64_fetch_and() argument 910 __tsan_go_atomic32_fetch_or(ThreadState * thr,uptr cpc,uptr pc,u8 * a) __tsan_go_atomic32_fetch_or() argument 916 __tsan_go_atomic64_fetch_or(ThreadState * thr,uptr cpc,uptr pc,u8 * a) __tsan_go_atomic64_fetch_or() argument 922 __tsan_go_atomic32_exchange(ThreadState * thr,uptr cpc,uptr pc,u8 * a) __tsan_go_atomic32_exchange() argument 927 __tsan_go_atomic64_exchange(ThreadState * thr,uptr cpc,uptr pc,u8 * a) __tsan_go_atomic64_exchange() argument 933 __tsan_go_atomic32_compare_exchange(ThreadState * thr,uptr cpc,uptr pc,u8 * a) __tsan_go_atomic32_compare_exchange() argument 942 __tsan_go_atomic64_compare_exchange(ThreadState * thr,uptr cpc,uptr pc,u8 * a) __tsan_go_atomic64_compare_exchange() argument [all...] |
H A D | tsan_platform_mac.cpp | 64 static void ThreadStateDestructor(void *thr) { in ThreadStateDestructor() argument 65 int res = pthread_setspecific(thread_state_key, thr); in ThreadStateDestructor() 96 ThreadState *thr = (ThreadState *)pthread_getspecific(thread_state_key); in cur_thread() local 97 if (UNLIKELY(!thr)) { in cur_thread() 98 thr = (ThreadState *)MmapOrDie(sizeof(ThreadState), "ThreadState"); in cur_thread() 99 int res = pthread_setspecific(thread_state_key, thr); in cur_thread() 102 return thr; in cur_thread() 105 void set_cur_thread(ThreadState *thr) { in set_cur_thread() argument 106 int res = pthread_setspecific(thread_state_key, thr); in set_cur_thread() 111 ThreadState *thr in cur_thread_finalize() local 207 ThreadState *thr = cur_thread(); ThreadCreateCallback() local 219 ThreadState *thr = cur_thread(); ThreadTerminateCallback() local 281 ImitateTlsWrite(ThreadState * thr,uptr tls_addr,uptr tls_size) ImitateTlsWrite() argument [all...] |
H A D | tsan_interface.cpp | 31 ThreadState *thr = cur_thread(); in __tsan_read16_pc() local 32 MemoryAccess(thr, pc_no_pac, (uptr)addr, 8, kAccessRead); in __tsan_read16_pc() 33 MemoryAccess(thr, pc_no_pac, (uptr)addr + 8, 8, kAccessRead); in __tsan_read16_pc() 38 ThreadState *thr = cur_thread(); in __tsan_write16_pc() local 39 MemoryAccess(thr, pc_no_pac, (uptr)addr, 8, kAccessWrite); in __tsan_write16_pc() 40 MemoryAccess(thr, pc_no_pac, (uptr)addr + 8, 8, kAccessWrite); in __tsan_write16_pc() 47 ThreadState *thr = cur_thread(); in __tsan_unaligned_read16() local 48 UnalignedMemoryAccess(thr, pc, (uptr)addr, 8, kAccessRead); in __tsan_unaligned_read16() 49 UnalignedMemoryAccess(thr, pc, (uptr)addr + 8, 8, kAccessRead); in __tsan_unaligned_read16() 54 ThreadState *thr = cur_thread(); in __tsan_unaligned_write16() local [all …]
|
H A D | tsan_interceptors_libdispatch.cpp | 81 static block_context_t *AllocContext(ThreadState *thr, uptr pc, in AllocContext() argument 85 (block_context_t *)user_alloc_internal(thr, pc, sizeof(block_context_t)); in AllocContext() 103 static void dispatch_sync_pre_execute(ThreadState *thr, uptr pc, in dispatch_sync_pre_execute() argument 106 Acquire(thr, pc, submit_sync); in dispatch_sync_pre_execute() 111 if (serial_sync) Acquire(thr, pc, serial_sync); in dispatch_sync_pre_execute() 112 if (serial_task && concurrent_sync) Acquire(thr, pc, concurrent_sync); in dispatch_sync_pre_execute() 118 static void dispatch_sync_post_execute(ThreadState *thr, uptr pc, in dispatch_sync_post_execute() argument 121 if (context->submitted_synchronously) Release(thr, pc, submit_sync); in dispatch_sync_post_execute() 126 if (serial_task && serial_sync) Release(thr, pc, serial_sync); in dispatch_sync_post_execute() 127 if (!serial_task && concurrent_sync) Release(thr, pc, concurrent_sync); in dispatch_sync_post_execute() [all …]
|
/llvm-project/compiler-rt/lib/tsan/go/ |
H A D | tsan_go.cpp | 143 auto *thr = (ThreadState *)Alloc(sizeof(ThreadState)); in AllocGoroutine() local 144 internal_memset(thr, 0, sizeof(*thr)); in AllocGoroutine() 145 return thr; in AllocGoroutine() 151 ThreadState *thr = AllocGoroutine(); in __tsan_init() local 152 main_thr = *thrp = thr; in __tsan_init() 153 Initialize(thr); in __tsan_init() 154 *procp = thr->proc1; in __tsan_init() 160 ThreadState *thr = main_thr; in __tsan_fini() local 161 int res = Finalize(thr); in __tsan_fini() 169 void __tsan_read(ThreadState *thr, void *addr, void *pc) { in __tsan_read() argument [all …]
|
H A D | test.c | 18 void __tsan_init(void **thr, void **proc, void (*cb)(long, void*)); 21 void __tsan_go_start(void *thr, void **chthr, void *pc); 22 void __tsan_go_end(void *thr); 25 void __tsan_proc_wire(void *proc, void *thr); 26 void __tsan_proc_unwire(void *proc, void *thr); 27 void __tsan_read(void *thr, void *addr, void *pc); 28 void __tsan_write(void *thr, void *addr, void *pc); 29 void __tsan_func_enter(void *thr, void *pc); 30 void __tsan_func_exit(void *thr); 31 void __tsan_malloc(void *thr, void *pc, void *p, unsigned long sz); [all …]
|
/llvm-project/compiler-rt/lib/tsan/tests/unit/ |
H A D | tsan_mman_test.cpp | 37 ThreadState *thr = cur_thread(); in TEST() local 39 char *p = (char*)user_alloc(thr, pc, 10); in TEST() 41 char *p2 = (char*)user_alloc(thr, pc, 20); in TEST() 46 user_free(thr, pc, p); in TEST() 47 user_free(thr, pc, p2); in TEST() 51 ThreadState *thr = cur_thread(); in TEST() local 54 void *p = user_realloc(thr, pc, 0, 0); in TEST() 58 user_free(thr, pc, p); in TEST() 61 void *p = user_realloc(thr, pc, 0, 100); in TEST() 64 user_free(thr, pc, p); in TEST() [all …]
|
H A D | tsan_trace_test.cpp | 37 for (auto *&thr : threads) { in ThreadArray() local 38 thr = static_cast<ThreadState *>( in ThreadArray() 42 ProcWire(proc, thr); in ThreadArray() 43 ThreadStart(thr, tid, 0, ThreadType::Fiber); in ThreadArray() 55 auto *thr = threads[i]; in Finish() local 57 Processor *proc = thr->proc(); in Finish() 58 ThreadFinish(thr); in Finish() 59 ProcUnwire(proc, thr); in Finish() 61 UnmapOrDie(thr, sizeof(ThreadState)); in Finish() 74 ThreadArray<1> thr; in TRACE_TEST() local [all …]
|
H A D | tsan_sync_test.cpp | 19 ThreadState *thr = cur_thread(); in TEST() local 20 SlotLocker locker(thr); in TEST() 23 m->AllocBlock(thr, 0, (uptr)&block[0], 1 * sizeof(u64)); in TEST() 27 CHECK_EQ(mb->tid, thr->tid); in TEST() 28 uptr sz = m->FreeBlock(thr->proc(), (uptr)&block[0], true); in TEST() 35 ThreadState *thr = cur_thread(); in TEST() local 36 SlotLocker locker(thr); in TEST() 39 m->AllocBlock(thr, 0, (uptr)&block[0], 1 * sizeof(u64)); in TEST() 40 m->AllocBlock(thr, 0, (uptr)&block[1], 3 * sizeof(u64)); in TEST() 45 m->FreeRange(thr->proc(), (uptr)&block[0], 4 * sizeof(u64), true); in TEST() [all …]
|
H A D | tsan_stack_test.cpp | 21 ThreadState thr(kMainTid); in TestStackTrace() local 23 ObtainCurrentStack(&thr, 0, trace); in TestStackTrace() 26 ObtainCurrentStack(&thr, 42, trace); in TestStackTrace() 30 *thr.shadow_stack_pos++ = 100; in TestStackTrace() 31 *thr.shadow_stack_pos++ = 101; in TestStackTrace() 32 ObtainCurrentStack(&thr, 0, trace); in TestStackTrace() 37 ObtainCurrentStack(&thr, 42, trace); in TestStackTrace() 46 ThreadState thr(kMainTid); in TestTrim() local 49 *thr.shadow_stack_pos++ = 100 + i; in TestTrim() 51 ObtainCurrentStack(&thr, 0, trace); in TestTrim() [all …]
|
/llvm-project/compiler-rt/lib/tsan/dd/ |
H A D | dd_rtl.cpp | 21 static u32 CurrentStackTrace(Thread *thr, uptr skip) { in CurrentStackTrace() argument 23 thr->ignore_interceptors = true; in CurrentStackTrace() 25 thr->ignore_interceptors = false; in CurrentStackTrace() 31 static void PrintStackTrace(Thread *thr, u32 stk) { in PrintStackTrace() argument 33 thr->ignore_interceptors = true; in PrintStackTrace() 35 thr->ignore_interceptors = false; in PrintStackTrace() 38 static void ReportDeadlock(Thread *thr, DDReport *rep) { in ReportDeadlock() argument 47 PrintStackTrace(thr, rep->loop[i].stk[1]); in ReportDeadlock() 51 PrintStackTrace(thr, rep->loop[i].stk[0]); in ReportDeadlock() 57 Callback::Callback(Thread *thr) in Callback() argument 99 ThreadInit(Thread * thr) ThreadInit() argument 106 ThreadDestroy(Thread * thr) ThreadDestroy() argument 111 MutexBeforeLock(Thread * thr,uptr m,bool writelock) MutexBeforeLock() argument 124 MutexAfterLock(Thread * thr,uptr m,bool writelock,bool trylock) MutexAfterLock() argument 137 MutexBeforeUnlock(Thread * thr,uptr m,bool writelock) MutexBeforeUnlock() argument 148 MutexDestroy(Thread * thr,uptr m) MutexDestroy() argument [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() 53 MutexAfterLock(thr, (uptr)m, true, false); in INTERCEPTOR() 61 MutexAfterLock(thr, (uptr)m, true, true); in INTERCEPTOR() 67 MutexBeforeUnlock(thr, (uptr)m, true); in INTERCEPTOR() [all …]
|
/llvm-project/openmp/runtime/src/ |
H A D | ompt-specific.cpp | 52 kmp_info_t *thr = ompt_get_thread(); in __ompt_get_teaminfo() local 54 if (thr) { in __ompt_get_teaminfo() 55 kmp_team *team = thr->th.th_team; in __ompt_get_teaminfo() 105 kmp_info_t *thr = ompt_get_thread(); in __ompt_get_task_info_object() local 107 if (thr) { in __ompt_get_task_info_object() 108 kmp_taskdata_t *taskdata = thr->th.th_current_task; in __ompt_get_task_info_object() 145 kmp_info_t *thr = ompt_get_thread(); in __ompt_get_scheduling_taskinfo() local 147 if (thr) { in __ompt_get_scheduling_taskinfo() 148 kmp_taskdata_t *taskdata = thr->th.th_current_task; in __ompt_get_scheduling_taskinfo() 260 void __ompt_lw_taskteam_init(ompt_lw_taskteam_t *lwt, kmp_info_t *thr, in argument 274 __ompt_lw_taskteam_link(ompt_lw_taskteam_t * lwt,kmp_info_t * thr,int on_heap,bool always) __ompt_lw_taskteam_link() argument 318 __ompt_lw_taskteam_unlink(kmp_info_t * thr) __ompt_lw_taskteam_unlink() argument 348 kmp_info_t *thr = ompt_get_thread(); __ompt_get_task_data() local 371 kmp_info_t *thr = ompt_get_thread(); __ompt_get_task_info_internal() local 468 kmp_info_t *thr = ompt_get_thread(); __ompt_get_task_memory_internal() local 505 __ompt_get_barrier_kind(enum barrier_type bt,kmp_info_t * thr) __ompt_get_barrier_kind() argument [all...] |