/external/compiler-rt/lib/tsan/rtl/ |
D | tsan_rtl_mutex.cc | 26 void ReportDeadlock(ThreadState *thr, uptr pc, DDReport *r); 29 ThreadState *thr; member 32 Callback(ThreadState *thr, uptr pc) in Callback() 33 : thr(thr) in Callback() 35 DDCallback::pt = thr->proc()->dd_pt; in Callback() 36 DDCallback::lt = thr->dd_lt; in Callback() 39 u32 Unwind() override { return CurrentStackId(thr, pc); } in Unwind() 40 int UniqueTid() override { return thr->unique_id; } in UniqueTid() 43 void DDMutexInit(ThreadState *thr, uptr pc, SyncVar *s) { in DDMutexInit() argument 44 Callback cb(thr, pc); in DDMutexInit() [all …]
|
D | tsan_rtl_thread.cc | 27 , thr() in ThreadContext() 49 ThreadState *thr; member 54 thr = 0; in OnCreated() 58 if (!args->thr) // GCD workers don't have a parent thread. in OnCreated() 60 args->thr->fast_state.IncrementEpoch(); in OnCreated() 62 TraceAddEvent(args->thr, args->thr->fast_state, EventTypeMop, 0); in OnCreated() 63 ReleaseImpl(args->thr, 0, &sync); in OnCreated() 64 creation_stack_id = CurrentStackId(args->thr, args->pc); in OnCreated() 66 StatInc(args->thr, StatThreadMaxTid); in OnCreated() 81 ThreadState *thr; member [all …]
|
D | tsan_fd.cc | 50 static FdSync *allocsync(ThreadState *thr, uptr pc) { in allocsync() argument 51 FdSync *s = (FdSync*)user_alloc(thr, pc, sizeof(FdSync), kDefaultAlignment, in allocsync() 63 static void unref(ThreadState *thr, uptr pc, FdSync *s) { in unref() argument 69 user_free(thr, pc, s, false); in unref() 74 static FdDesc *fddesc(ThreadState *thr, uptr pc, int fd) { in fddesc() argument 82 void *p = user_alloc(thr, pc, size, kDefaultAlignment, false); in fddesc() 84 MemoryResetRange(thr, (uptr)&fddesc, (uptr)p, size); in fddesc() 88 user_free(thr, pc, p, false); in fddesc() 94 static void init(ThreadState *thr, uptr pc, int fd, FdSync *s, in init() argument 96 FdDesc *d = fddesc(thr, pc, fd); in init() [all …]
|
D | tsan_rtl.cc | 308 void Initialize(ThreadState *thr) { in Initialize() argument 336 ProcWire(proc, thr); in Initialize() 365 int tid = ThreadCreate(thr, 0, 0, true); in Initialize() 367 ThreadStart(thr, tid, internal_getpid()); in Initialize() 387 int Finalize(ThreadState *thr) { in Finalize() argument 390 if (flags()->atexit_sleep_ms > 0 && ThreadCount(thr) > 1) in Finalize() 403 ThreadFinalize(thr); in Finalize() 430 StatAggregate(ctx->stat, thr->stat); in Finalize() 438 void ForkBefore(ThreadState *thr, uptr pc) { in ForkBefore() argument 443 void ForkParentAfter(ThreadState *thr, uptr pc) { in ForkParentAfter() argument [all …]
|
D | tsan_mman.cc | 83 ThreadState *thr = cur_thread(); in ScopedGlobalProcessor() local 84 if (thr->proc()) in ScopedGlobalProcessor() 101 ProcWire(gp->proc, thr); in ScopedGlobalProcessor() 106 ThreadState *thr = cur_thread(); in ~ScopedGlobalProcessor() local 107 if (thr->proc() != gp->proc) in ~ScopedGlobalProcessor() 109 ProcUnwire(gp->proc, thr); in ~ScopedGlobalProcessor() 135 static void SignalUnsafeCall(ThreadState *thr, uptr pc) { in SignalUnsafeCall() argument 136 if (atomic_load_relaxed(&thr->in_signal_handler) == 0 || in SignalUnsafeCall() 140 ObtainCurrentStack(thr, pc, &stack); in SignalUnsafeCall() 146 OutputReport(thr, rep); in SignalUnsafeCall() [all …]
|
D | tsan_interceptors.cc | 241 static ThreadSignalContext *SigCtx(ThreadState *thr) { in SigCtx() argument 242 ThreadSignalContext *ctx = (ThreadSignalContext*)thr->signal_ctx; in SigCtx() 243 if (ctx == 0 && !thr->is_dead) { in SigCtx() 245 MemoryResetRange(thr, (uptr)&SigCtx, (uptr)ctx, sizeof(*ctx)); in SigCtx() 246 thr->signal_ctx = ctx; in SigCtx() 255 ScopedInterceptor::ScopedInterceptor(ThreadState *thr, const char *fname, in ScopedInterceptor() argument 257 : thr_(thr) in ScopedInterceptor() 260 Initialize(thr); in ScopedInterceptor() 264 FuncEntry(thr, pc); in ScopedInterceptor() 312 #define READ_STRING_OF_LEN(thr, pc, s, len, n) \ argument [all …]
|
D | tsan_rtl.h | 337 ThreadState *thr; // currently wired thread, or nullptr member 464 ThreadState *thr; variable 591 void ObtainCurrentStack(ThreadState *thr, uptr toppc, StackTraceTy *stack) { in ObtainCurrentStack() argument 592 uptr size = thr->shadow_stack_pos - thr->shadow_stack; in ObtainCurrentStack() 598 stack->Init(&thr->shadow_stack[start], size, toppc); in ObtainCurrentStack() 607 void ALWAYS_INLINE StatInc(ThreadState *thr, StatType typ, u64 n = 1) { 609 thr->stat[typ] += n; 612 void ALWAYS_INLINE StatSet(ThreadState *thr, StatType typ, u64 n) { in StatSet() argument 614 thr->stat[typ] = n; in StatSet() 626 void ForkBefore(ThreadState *thr, uptr pc); [all …]
|
D | tsan_interface_java.cc | 41 ScopedJavaFunc(ThreadState *thr, uptr pc) in ScopedJavaFunc() argument 42 : thr_(thr) { in ScopedJavaFunc() 44 FuncEntry(thr, pc); in ScopedJavaFunc() 62 ThreadState *thr = cur_thread(); \ 66 ScopedJavaFunc scoped(thr, caller_pc); \ 71 DPrintf("#%d: java_init(%p, %p)\n", thr->tid, heap_begin, heap_size); in __tsan_java_init() 83 DPrintf("#%d: java_fini()\n", thr->tid); in __tsan_java_fini() 86 int status = Finalize(thr); in __tsan_java_fini() 87 DPrintf("#%d: java_fini() = %d\n", thr->tid, status); in __tsan_java_fini() 93 DPrintf("#%d: java_alloc(%p, %p)\n", thr->tid, ptr, size); in __tsan_java_alloc() [all …]
|
D | tsan_fd.h | 42 void FdAcquire(ThreadState *thr, uptr pc, int fd); 43 void FdRelease(ThreadState *thr, uptr pc, int fd); 44 void FdAccess(ThreadState *thr, uptr pc, int fd); 45 void FdClose(ThreadState *thr, uptr pc, int fd, bool write = true); 46 void FdFileCreate(ThreadState *thr, uptr pc, int fd); 47 void FdDup(ThreadState *thr, uptr pc, int oldfd, int newfd, bool write); 48 void FdPipeCreate(ThreadState *thr, uptr pc, int rfd, int wfd); 49 void FdEventCreate(ThreadState *thr, uptr pc, int fd); 50 void FdSignalCreate(ThreadState *thr, uptr pc, int fd); 51 void FdInotifyCreate(ThreadState *thr, uptr pc, int fd); [all …]
|
/external/llvm-project/compiler-rt/lib/tsan/rtl/ |
D | tsan_rtl_mutex.cpp | 25 void ReportDeadlock(ThreadState *thr, uptr pc, DDReport *r); 28 ThreadState *thr; member 31 Callback(ThreadState *thr, uptr pc) in Callback() 32 : thr(thr) in Callback() 34 DDCallback::pt = thr->proc()->dd_pt; in Callback() 35 DDCallback::lt = thr->dd_lt; in Callback() 38 u32 Unwind() override { return CurrentStackId(thr, pc); } in Unwind() 39 int UniqueTid() override { return thr->unique_id; } in UniqueTid() 42 void DDMutexInit(ThreadState *thr, uptr pc, SyncVar *s) { in DDMutexInit() argument 43 Callback cb(thr, pc); in DDMutexInit() [all …]
|
D | tsan_rtl_thread.cpp | 26 , thr() in ThreadContext() 48 ThreadState *thr; member 53 thr = 0; in OnCreated() 57 if (!args->thr) // GCD workers don't have a parent thread. in OnCreated() 59 args->thr->fast_state.IncrementEpoch(); in OnCreated() 61 TraceAddEvent(args->thr, args->thr->fast_state, EventTypeMop, 0); in OnCreated() 62 ReleaseImpl(args->thr, 0, &sync); in OnCreated() 63 creation_stack_id = CurrentStackId(args->thr, args->pc); in OnCreated() 65 StatInc(args->thr, StatThreadMaxTid); in OnCreated() 81 ThreadState *thr; member [all …]
|
D | tsan_fd.cpp | 49 static FdSync *allocsync(ThreadState *thr, uptr pc) { in allocsync() argument 50 FdSync *s = (FdSync*)user_alloc_internal(thr, pc, sizeof(FdSync), in allocsync() 62 static void unref(ThreadState *thr, uptr pc, FdSync *s) { in unref() argument 68 user_free(thr, pc, s, false); in unref() 73 static FdDesc *fddesc(ThreadState *thr, uptr pc, int fd) { in fddesc() argument 81 void *p = user_alloc_internal(thr, pc, size, kDefaultAlignment, false); in fddesc() 83 MemoryResetRange(thr, (uptr)&fddesc, (uptr)p, size); in fddesc() 87 user_free(thr, pc, p, false); in fddesc() 94 static void init(ThreadState *thr, uptr pc, int fd, FdSync *s, in init() argument 96 FdDesc *d = fddesc(thr, pc, fd); in init() [all …]
|
D | tsan_mman.cpp | 86 ThreadState *thr = cur_thread(); in ScopedGlobalProcessor() local 87 if (thr->proc()) in ScopedGlobalProcessor() 104 ProcWire(gp->proc, thr); in ScopedGlobalProcessor() 109 ThreadState *thr = cur_thread(); in ~ScopedGlobalProcessor() local 110 if (thr->proc() != gp->proc) in ~ScopedGlobalProcessor() 112 ProcUnwire(gp->proc, thr); in ~ScopedGlobalProcessor() 146 static void SignalUnsafeCall(ThreadState *thr, uptr pc) { in SignalUnsafeCall() argument 147 if (atomic_load_relaxed(&thr->in_signal_handler) == 0 || in SignalUnsafeCall() 151 ObtainCurrentStack(thr, pc, &stack); in SignalUnsafeCall() 157 OutputReport(thr, rep); in SignalUnsafeCall() [all …]
|
D | tsan_rtl.cpp | 244 void UnmapShadow(ThreadState *thr, uptr addr, uptr size) { in UnmapShadow() argument 248 ctx->metamap.ResetRange(thr->proc(), addr, size); in UnmapShadow() 354 void Initialize(ThreadState *thr) { in Initialize() argument 386 ProcWire(proc, thr); in Initialize() 409 int tid = ThreadCreate(thr, 0, 0, true); in Initialize() 411 ThreadStart(thr, tid, GetTid(), ThreadType::Regular); in Initialize() 446 int Finalize(ThreadState *thr) { in Finalize() argument 452 if (flags()->atexit_sleep_ms > 0 && ThreadCount(thr) > 1) in Finalize() 464 ThreadFinalize(thr); in Finalize() 491 StatAggregate(ctx->stat, thr->stat); in Finalize() [all …]
|
D | tsan_interceptors_posix.cpp | 242 static ThreadSignalContext *SigCtx(ThreadState *thr) { in SigCtx() argument 243 ThreadSignalContext *ctx = (ThreadSignalContext*)thr->signal_ctx; in SigCtx() 244 if (ctx == 0 && !thr->is_dead) { in SigCtx() 246 MemoryResetRange(thr, (uptr)&SigCtx, (uptr)ctx, sizeof(*ctx)); in SigCtx() 247 thr->signal_ctx = ctx; in SigCtx() 252 ScopedInterceptor::ScopedInterceptor(ThreadState *thr, const char *fname, in ScopedInterceptor() argument 254 : thr_(thr), pc_(pc), in_ignored_lib_(false), ignoring_(false) { in ScopedInterceptor() 255 Initialize(thr); in ScopedInterceptor() 257 if (!thr_->ignore_interceptors) FuncEntry(thr, pc); in ScopedInterceptor() 314 #define READ_STRING_OF_LEN(thr, pc, s, len, n) \ argument [all …]
|
D | tsan_rtl.h | 343 ThreadState *thr; // currently wired thread, or nullptr member 459 void set_cur_thread(ThreadState *thr); 469 ThreadState *thr = reinterpret_cast<ThreadState *>(cur_thread_placeholder); in cur_thread_init() local 470 if (UNLIKELY(!thr->current)) in cur_thread_init() 471 thr->current = thr; in cur_thread_init() 473 inline void set_cur_thread(ThreadState *thr) { in set_cur_thread() argument 474 reinterpret_cast<ThreadState *>(cur_thread_placeholder)->current = thr; in set_cur_thread() 484 ThreadState *thr; variable 647 void ObtainCurrentStack(ThreadState *thr, uptr toppc, StackTraceTy *stack, 649 uptr size = thr->shadow_stack_pos - thr->shadow_stack; [all …]
|
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 …]
|
/external/llvm-project/compiler-rt/lib/tsan/go/ |
D | tsan_go.cpp | 145 ThreadState *thr = (ThreadState*)internal_alloc(MBlockThreadContex, in AllocGoroutine() local 147 internal_memset(thr, 0, sizeof(*thr)); in AllocGoroutine() 148 return thr; in AllocGoroutine() 154 ThreadState *thr = AllocGoroutine(); in __tsan_init() local 155 main_thr = *thrp = thr; in __tsan_init() 156 Initialize(thr); in __tsan_init() 157 *procp = thr->proc1; in __tsan_init() 163 ThreadState *thr = main_thr; in __tsan_fini() local 164 int res = Finalize(thr); in __tsan_fini() 172 void __tsan_read(ThreadState *thr, void *addr, void *pc) { in __tsan_read() argument [all …]
|
/external/compiler-rt/lib/tsan/go/ |
D | tsan_go.cc | 135 ThreadState *thr = (ThreadState*)internal_alloc(MBlockThreadContex, in AllocGoroutine() local 137 internal_memset(thr, 0, sizeof(*thr)); in AllocGoroutine() 138 return thr; in AllocGoroutine() 144 ThreadState *thr = AllocGoroutine(); in __tsan_init() local 145 main_thr = *thrp = thr; in __tsan_init() 146 Initialize(thr); in __tsan_init() 147 *procp = thr->proc1; in __tsan_init() 153 ThreadState *thr = main_thr; in __tsan_fini() local 154 int res = Finalize(thr); in __tsan_fini() 162 void __tsan_read(ThreadState *thr, void *addr, void *pc) { in __tsan_read() argument [all …]
|
/external/llvm-project/compiler-rt/lib/tsan/tests/unit/ |
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 …]
|
/external/compiler-rt/lib/tsan/dd/ |
D | dd_rtl.cc | 22 static u32 CurrentStackTrace(Thread *thr, uptr skip) { in CurrentStackTrace() argument 24 thr->ignore_interceptors = true; in CurrentStackTrace() 26 thr->ignore_interceptors = false; in CurrentStackTrace() 32 static void PrintStackTrace(Thread *thr, u32 stk) { in PrintStackTrace() argument 34 thr->ignore_interceptors = true; in PrintStackTrace() 36 thr->ignore_interceptors = false; in PrintStackTrace() 39 static void ReportDeadlock(Thread *thr, DDReport *rep) { in ReportDeadlock() argument 48 PrintStackTrace(thr, rep->loop[i].stk[1]); in ReportDeadlock() 52 PrintStackTrace(thr, rep->loop[i].stk[0]); in ReportDeadlock() 58 Callback::Callback(Thread *thr) in Callback() argument [all …]
|
D | dd_interceptors.cc | 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 …]
|
/external/llvm-project/compiler-rt/lib/tsan/dd/ |
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 [all …]
|
D | dd_interceptors.cpp | 18 static __thread Thread *thr; variable 28 if (thr != 0) in InitThread() 35 thr = (Thread*)InternalAlloc(sizeof(*thr)); in InitThread() 36 internal_memset(thr, 0, sizeof(*thr)); in InitThread() 37 ThreadInit(thr); in InitThread() 44 MutexDestroy(thr, (uptr)m); in INTERCEPTOR() 50 MutexBeforeLock(thr, (uptr)m, true); in INTERCEPTOR() 52 MutexAfterLock(thr, (uptr)m, true, false); in INTERCEPTOR() 60 MutexAfterLock(thr, (uptr)m, true, true); in INTERCEPTOR() 66 MutexBeforeUnlock(thr, (uptr)m, true); in INTERCEPTOR() [all …]
|
/external/compiler-rt/lib/tsan/tests/unit/ |
D | tsan_mman_test.cc | 38 ThreadState *thr = cur_thread(); in TEST() local 40 char *p = (char*)user_alloc(thr, pc, 10); in TEST() 42 char *p2 = (char*)user_alloc(thr, pc, 20); in TEST() 47 user_free(thr, pc, p); in TEST() 48 user_free(thr, pc, p2); in TEST() 52 ThreadState *thr = cur_thread(); in TEST() local 55 void *p = user_realloc(thr, pc, 0, 0); in TEST() 61 void *p = user_realloc(thr, pc, 0, 100); in TEST() 64 user_free(thr, pc, p); in TEST() 67 void *p = user_alloc(thr, pc, 100); in TEST() [all …]
|