Home
last modified time | relevance | path

Searched refs:thr (Results 1 – 25 of 85) sorted by relevance

1234

/external/compiler-rt/lib/tsan/rtl/
Dtsan_rtl_mutex.cc26 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->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 …]
Dtsan_rtl_thread.cc27 , thr() in ThreadContext()
49 ThreadState *thr; member
54 thr = 0; in OnCreated()
58 args->thr->fast_state.IncrementEpoch(); in OnCreated()
60 TraceAddEvent(args->thr, args->thr->fast_state, EventTypeMop, 0); in OnCreated()
61 ReleaseImpl(args->thr, 0, &sync); in OnCreated()
62 creation_stack_id = CurrentStackId(args->thr, args->pc); in OnCreated()
64 StatInc(args->thr, StatThreadMaxTid); in OnCreated()
79 ThreadState *thr; member
88 thr = args->thr; in OnStarted()
[all …]
Dtsan_fd.cc50 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
95 FdDesc *d = fddesc(thr, pc, fd); in init()
[all …]
Dtsan_rtl.cc303 void Initialize(ThreadState *thr) { in Initialize() argument
350 int tid = ThreadCreate(thr, 0, 0, true); in Initialize()
352 ThreadStart(thr, tid, internal_getpid()); in Initialize()
365 int Finalize(ThreadState *thr) { in Finalize() argument
368 if (flags()->atexit_sleep_ms > 0 && ThreadCount(thr) > 1) in Finalize()
381 ThreadFinalize(thr); in Finalize()
408 StatAggregate(ctx->stat, thr->stat); in Finalize()
416 void ForkBefore(ThreadState *thr, uptr pc) { in ForkBefore() argument
421 void ForkParentAfter(ThreadState *thr, uptr pc) { in ForkParentAfter() argument
426 void ForkChildAfter(ThreadState *thr, uptr pc) { in ForkChildAfter() argument
[all …]
Dtsan_mman.cc51 void AllocatorThreadStart(ThreadState *thr) { in AllocatorThreadStart() argument
52 allocator()->InitCache(&thr->alloc_cache); in AllocatorThreadStart()
53 internal_allocator()->InitCache(&thr->internal_alloc_cache); in AllocatorThreadStart()
56 void AllocatorThreadFinish(ThreadState *thr) { in AllocatorThreadFinish() argument
57 allocator()->DestroyCache(&thr->alloc_cache); in AllocatorThreadFinish()
58 internal_allocator()->DestroyCache(&thr->internal_alloc_cache); in AllocatorThreadFinish()
65 static void SignalUnsafeCall(ThreadState *thr, uptr pc) { in SignalUnsafeCall() argument
66 if (atomic_load(&thr->in_signal_handler, memory_order_relaxed) == 0 || in SignalUnsafeCall()
70 ObtainCurrentStack(thr, pc, &stack); in SignalUnsafeCall()
75 OutputReport(thr, rep); in SignalUnsafeCall()
[all …]
Dtsan_interceptors.cc203 static ThreadSignalContext *SigCtx(ThreadState *thr) { in SigCtx() argument
204 ThreadSignalContext *ctx = (ThreadSignalContext*)thr->signal_ctx; in SigCtx()
205 if (ctx == 0 && !thr->is_dead) { in SigCtx()
207 MemoryResetRange(thr, (uptr)&SigCtx, (uptr)ctx, sizeof(*ctx)); in SigCtx()
208 thr->signal_ctx = ctx; in SigCtx()
217 ScopedInterceptor(ThreadState *thr, const char *fname, uptr pc);
225 ScopedInterceptor::ScopedInterceptor(ThreadState *thr, const char *fname, in ScopedInterceptor() argument
227 : thr_(thr) in ScopedInterceptor()
231 Initialize(thr); in ScopedInterceptor()
232 FuncEntry(thr, pc); in ScopedInterceptor()
[all …]
Dtsan_rtl.h424 ThreadState *thr; variable
549 void ObtainCurrentStack(ThreadState *thr, uptr toppc, StackTraceTy *stack) { in ObtainCurrentStack() argument
550 uptr size = thr->shadow_stack_pos - thr->shadow_stack; in ObtainCurrentStack()
556 stack->Init(&thr->shadow_stack[start], size, toppc); in ObtainCurrentStack()
565 void ALWAYS_INLINE StatInc(ThreadState *thr, StatType typ, u64 n = 1) {
567 thr->stat[typ] += n;
570 void ALWAYS_INLINE StatSet(ThreadState *thr, StatType typ, u64 n) { in StatSet() argument
572 thr->stat[typ] = n; in StatSet()
584 void ForkBefore(ThreadState *thr, uptr pc);
585 void ForkParentAfter(ThreadState *thr, uptr pc);
[all …]
Dtsan_interface_java.cc41 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 …]
Dtsan_fd.h42 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);
46 void FdFileCreate(ThreadState *thr, uptr pc, int fd);
47 void FdDup(ThreadState *thr, uptr pc, int oldfd, int newfd);
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 …]
Dtsan_sync.cc20 void DDMutexInit(ThreadState *thr, uptr pc, SyncVar *s);
27 void SyncVar::Init(ThreadState *thr, uptr pc, uptr addr, u64 uid) { in Init() argument
34 creation_stack_id = CurrentStackId(thr, pc); in Init()
36 DDMutexInit(thr, pc, this); in Init()
39 void SyncVar::Reset(ThreadState *thr) { in Reset() argument
50 if (thr == 0) { in Reset()
54 clock.Reset(&thr->clock_cache); in Reset()
55 read_clock.Reset(&thr->clock_cache); in Reset()
63 void MetaMap::AllocBlock(ThreadState *thr, uptr pc, uptr p, uptr sz) { in AllocBlock() argument
64 u32 idx = block_alloc_.Alloc(&thr->block_cache); in AllocBlock()
[all …]
Dtsan_update_shadow_word_inl.h17 StatInc(thr, StatShadowProcessed);
22 StatInc(thr, StatShadowZero);
31 StatInc(thr, StatShadowSameSize);
34 StatInc(thr, StatShadowSameThread);
39 StatInc(thr, StatShadowAnotherThread);
40 if (HappensBefore(old, thr)) {
50 StatInc(thr, StatShadowIntersect);
52 StatInc(thr, StatShadowSameThread);
55 StatInc(thr, StatShadowAnotherThread);
58 if (HappensBefore(old, thr))
[all …]
Dtsan_interface_atomic.cc246 static T AtomicLoad(ThreadState *thr, uptr pc, const volatile T *a, in AtomicLoad() argument
252 MemoryReadAtomic(thr, pc, (uptr)a, SizeLog<T>()); in AtomicLoad()
255 SyncVar *s = ctx->metamap.GetOrCreateAndLock(thr, pc, (uptr)a, false); in AtomicLoad()
256 AcquireImpl(thr, pc, &s->clock); in AtomicLoad()
259 MemoryReadAtomic(thr, pc, (uptr)a, SizeLog<T>()); in AtomicLoad()
276 static void AtomicStore(ThreadState *thr, uptr pc, volatile T *a, T v, in AtomicStore() argument
279 MemoryWriteAtomic(thr, pc, (uptr)a, SizeLog<T>()); in AtomicStore()
289 SyncVar *s = ctx->metamap.GetOrCreateAndLock(thr, pc, (uptr)a, true); in AtomicStore()
290 thr->fast_state.IncrementEpoch(); in AtomicStore()
292 TraceAddEvent(thr, thr->fast_state, EventTypeMop, 0); in AtomicStore()
[all …]
Dtsan_rtl_report.cc226 ThreadState *thr = tctx->thr; in IsInStackOrTls() local
227 CHECK(thr); in IsInStackOrTls()
228 return ((addr >= thr->stk_addr && addr < thr->stk_addr + thr->stk_size) || in IsInStackOrTls()
229 (addr >= thr->tls_addr && addr < thr->tls_addr + thr->tls_size)); in IsInStackOrTls()
239 ThreadState *thr = tctx->thr; in IsThreadStackOrTls() local
240 CHECK(thr); in IsThreadStackOrTls()
241 *is_stack = (addr >= thr->stk_addr && addr < thr->stk_addr + thr->stk_size); in IsThreadStackOrTls()
434 static bool HandleRacyStacks(ThreadState *thr, VarSizeStackTrace traces[2], in HandleRacyStacks() argument
473 static void AddRacyStacks(ThreadState *thr, VarSizeStackTrace traces[2], in AddRacyStacks() argument
487 bool OutputReport(ThreadState *thr, const ScopedReport &srep) { in OutputReport() argument
[all …]
/external/compiler-rt/lib/tsan/go/
Dtsan_go.cc78 ThreadState *thr = (ThreadState*)internal_alloc(MBlockThreadContex, in AllocGoroutine() local
80 internal_memset(thr, 0, sizeof(*thr)); in AllocGoroutine()
81 return thr; in AllocGoroutine()
86 ThreadState *thr = AllocGoroutine(); in __tsan_init() local
87 main_thr = *thrp = thr; in __tsan_init()
88 Initialize(thr); in __tsan_init()
94 ThreadState *thr = main_thr; in __tsan_fini() local
95 int res = Finalize(thr); in __tsan_fini()
103 void __tsan_read(ThreadState *thr, void *addr, void *pc) { in __tsan_read() argument
104 MemoryRead(thr, (uptr)pc, (uptr)addr, kSizeLog1); in __tsan_read()
[all …]
Dtest.c16 void __tsan_init(void **thr, void (*cb)(void*));
19 void __tsan_go_start(void *thr, void **chthr, void *pc);
20 void __tsan_go_end(void *thr);
21 void __tsan_read(void *thr, void *addr, void *pc);
22 void __tsan_write(void *thr, void *addr, void *pc);
23 void __tsan_func_enter(void *thr, void *pc);
24 void __tsan_func_exit(void *thr);
26 void __tsan_acquire(void *thr, void *addr);
27 void __tsan_release(void *thr, void *addr);
28 void __tsan_release_merge(void *thr, void *addr);
/external/compiler-rt/lib/tsan/dd/
Ddd_rtl.cc22 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 …]
Ddd_interceptors.cc22 static __thread Thread *thr; variable
32 if (thr != 0) in InitThread()
39 thr = (Thread*)InternalAlloc(sizeof(*thr)); in InitThread()
40 internal_memset(thr, 0, sizeof(*thr)); in InitThread()
41 ThreadInit(thr); in InitThread()
48 MutexDestroy(thr, (uptr)m); in INTERCEPTOR()
54 MutexBeforeLock(thr, (uptr)m, true); in INTERCEPTOR()
56 MutexAfterLock(thr, (uptr)m, true, false); in INTERCEPTOR()
64 MutexAfterLock(thr, (uptr)m, true, true); in INTERCEPTOR()
70 MutexBeforeUnlock(thr, (uptr)m, true); in INTERCEPTOR()
[all …]
Ddd_rtl.h35 Thread *thr; member
37 Callback(Thread *thr);
58 void ThreadInit(Thread *thr);
59 void ThreadDestroy(Thread *thr);
61 void MutexBeforeLock(Thread *thr, uptr m, bool writelock);
62 void MutexAfterLock(Thread *thr, uptr m, bool writelock, bool trylock);
63 void MutexBeforeUnlock(Thread *thr, uptr m, bool writelock);
64 void MutexDestroy(Thread *thr, uptr m);
/external/compiler-rt/lib/tsan/tests/unit/
Dtsan_mman_test.cc38 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 …]
Dtsan_stack_test.cc22 ThreadState thr(0, 0, 0, 0, 0, 0, 0, 0, 0); in TestStackTrace() local
24 thr.shadow_stack = &stack[0]; in TestStackTrace()
25 thr.shadow_stack_pos = &stack[0]; in TestStackTrace()
26 thr.shadow_stack_end = &stack[128]; in TestStackTrace()
28 ObtainCurrentStack(&thr, 0, trace); in TestStackTrace()
31 ObtainCurrentStack(&thr, 42, trace); in TestStackTrace()
35 *thr.shadow_stack_pos++ = 100; in TestStackTrace()
36 *thr.shadow_stack_pos++ = 101; in TestStackTrace()
37 ObtainCurrentStack(&thr, 0, trace); in TestStackTrace()
42 ObtainCurrentStack(&thr, 42, trace); in TestStackTrace()
[all …]
Dtsan_sync_test.cc20 ThreadState *thr = cur_thread(); in TEST() local
23 m->AllocBlock(thr, 0, (uptr)&block[0], 1 * sizeof(u64)); in TEST()
27 EXPECT_EQ(mb->tid, thr->tid); in TEST()
28 uptr sz = m->FreeBlock(thr, 0, (uptr)&block[0]); in TEST()
35 ThreadState *thr = cur_thread(); in TEST() local
38 m->AllocBlock(thr, 0, (uptr)&block[0], 1 * sizeof(u64)); in TEST()
39 m->AllocBlock(thr, 0, (uptr)&block[1], 3 * sizeof(u64)); in TEST()
44 m->FreeRange(thr, 0, (uptr)&block[0], 4 * sizeof(u64)); in TEST()
52 ThreadState *thr = cur_thread(); in TEST() local
55 m->AllocBlock(thr, 0, (uptr)&block[0], 4 * sizeof(u64)); in TEST()
[all …]
/external/valgrind/helgrind/
Dhg_errors.c312 Thread* thr; member
326 Thread* thr; /* doing the unlocking */ member
330 Thread* thr; /* doing the unlocking */ member
335 Thread* thr; /* doing the unlocking */ member
339 Thread* thr; member
345 Thread* thr; member
361 Thread* thr; member
406 tl_assert(xe->XE.Race.thr); in HG_()
410 xe->XE.Race.thr->locksetW, in HG_()
434 Thr* acc_thr = xe->XE.Race.thr->hbthr; in HG_()
[all …]
Dhg_main.c164 ThreadId map_threads_maybe_reverse_lookup_SLOW ( Thread* thr ); /*fwds*/
239 static void lockN_acquire_writer ( Lock* lk, Thread* thr ) in lockN_acquire_writer() argument
242 tl_assert(HG_(is_sane_Thread)(thr)); in lockN_acquire_writer()
252 tid = map_threads_maybe_reverse_lookup_SLOW(thr); in lockN_acquire_writer()
267 VG_(addToBag)( lk->heldBy, (UWord)thr ); in lockN_acquire_writer()
277 tl_assert(VG_(elemBag)(lk->heldBy, (UWord)thr) in lockN_acquire_writer()
279 VG_(addToBag)(lk->heldBy, (UWord)thr); in lockN_acquire_writer()
290 static void lockN_acquire_reader ( Lock* lk, Thread* thr ) in lockN_acquire_reader() argument
293 tl_assert(HG_(is_sane_Thread)(thr)); in lockN_acquire_reader()
308 tid = map_threads_maybe_reverse_lookup_SLOW(thr); in lockN_acquire_reader()
[all …]
Dlibhb.h84 void libhb_so_send ( Thr* thr, SO* so, Bool strong_send );
94 void libhb_so_recv ( Thr* thr, SO* so, Bool strong_recv );
113 void zsm_sapply08_f__msmcwrite ( Thr* thr, Addr a );
114 void zsm_sapply16_f__msmcwrite ( Thr* thr, Addr a );
115 void zsm_sapply32_f__msmcwrite ( Thr* thr, Addr a );
116 void zsm_sapply64_f__msmcwrite ( Thr* thr, Addr a );
117 void zsm_sapplyNN_f__msmcwrite ( Thr* thr, Addr a, SizeT len );
119 void zsm_sapply08_f__msmcread ( Thr* thr, Addr a );
120 void zsm_sapply16_f__msmcread ( Thr* thr, Addr a );
121 void zsm_sapply32_f__msmcread ( Thr* thr, Addr a );
[all …]
/external/compiler-rt/test/asan/TestCases/Windows/
Dthread_stack_reuse.cc22 HANDLE thr = NULL; in main() local
24 thr = CreateThread(NULL, 0, thread_proc_1, NULL, 0, NULL); in main()
25 if (thr == 0) in main()
27 if (WAIT_OBJECT_0 != WaitForSingleObject(thr, INFINITE)) in main()
30 thr = CreateThread(NULL, 0, thread_proc_2, NULL, 0, NULL); in main()
31 if (thr == 0) in main()
33 if (WAIT_OBJECT_0 != WaitForSingleObject(thr, INFINITE)) in main()
35 CloseHandle(thr); in main()

1234