Home
last modified time | relevance | path

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

1234

/NextBSD/contrib/compiler-rt/lib/tsan/rtl/
HDtsan_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 …]
HDtsan_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 …]
HDtsan_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
96 FdDesc *d = fddesc(thr, pc, fd); in init()
[all …]
HDtsan_rtl.cc307 void Initialize(ThreadState *thr) { in Initialize() argument
355 int tid = ThreadCreate(thr, 0, 0, true); in Initialize()
357 ThreadStart(thr, tid, internal_getpid()); in Initialize()
373 int Finalize(ThreadState *thr) { in Finalize() argument
376 if (flags()->atexit_sleep_ms > 0 && ThreadCount(thr) > 1) in Finalize()
389 ThreadFinalize(thr); in Finalize()
416 StatAggregate(ctx->stat, thr->stat); in Finalize()
424 void ForkBefore(ThreadState *thr, uptr pc) { in ForkBefore() argument
429 void ForkParentAfter(ThreadState *thr, uptr pc) { in ForkParentAfter() argument
434 void ForkChildAfter(ThreadState *thr, uptr pc) { in ForkChildAfter() argument
[all …]
HDtsan_mman.cc68 void AllocatorThreadStart(ThreadState *thr) { in AllocatorThreadStart() argument
69 allocator()->InitCache(&thr->alloc_cache); in AllocatorThreadStart()
70 internal_allocator()->InitCache(&thr->internal_alloc_cache); in AllocatorThreadStart()
73 void AllocatorThreadFinish(ThreadState *thr) { in AllocatorThreadFinish() argument
74 allocator()->DestroyCache(&thr->alloc_cache); in AllocatorThreadFinish()
75 internal_allocator()->DestroyCache(&thr->internal_alloc_cache); in AllocatorThreadFinish()
82 static void SignalUnsafeCall(ThreadState *thr, uptr pc) { in SignalUnsafeCall() argument
83 if (atomic_load(&thr->in_signal_handler, memory_order_relaxed) == 0 || in SignalUnsafeCall()
87 ObtainCurrentStack(thr, pc, &stack); in SignalUnsafeCall()
92 OutputReport(thr, rep); in SignalUnsafeCall()
[all …]
HDtsan_interceptors.cc196 static ThreadSignalContext *SigCtx(ThreadState *thr) { in SigCtx() argument
197 ThreadSignalContext *ctx = (ThreadSignalContext*)thr->signal_ctx; in SigCtx()
198 if (ctx == 0 && !thr->is_dead) { in SigCtx()
200 MemoryResetRange(thr, (uptr)&SigCtx, (uptr)ctx, sizeof(*ctx)); in SigCtx()
201 thr->signal_ctx = ctx; in SigCtx()
208 ScopedInterceptor::ScopedInterceptor(ThreadState *thr, const char *fname, in ScopedInterceptor() argument
210 : thr_(thr) in ScopedInterceptor()
214 Initialize(thr); in ScopedInterceptor()
215 FuncEntry(thr, pc); in ScopedInterceptor()
243 if (thr->ignore_interceptors || thr->in_ignored_lib) \
[all …]
HDtsan_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 …]
HDtsan_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 …]
HDtsan_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 …]
HDtsan_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, 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 …]
HDtsan_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 …]
HDtsan_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)) {
51 StatInc(thr, StatShadowIntersect);
53 StatInc(thr, StatShadowSameThread);
56 StatInc(thr, StatShadowAnotherThread);
59 if (HappensBefore(old, thr))
[all …]
/NextBSD/contrib/compiler-rt/lib/tsan/go/
HDtsan_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 …]
/NextBSD/contrib/xz/src/liblzma/common/
HDstream_encoder_mt.c162 worker_thread *thr; member
181 worker_error(worker_thread *thr, lzma_ret ret) in worker_error() argument
186 mythread_sync(thr->coder->mutex) { in worker_error()
187 if (thr->coder->thread_error == LZMA_OK) in worker_error()
188 thr->coder->thread_error = ret; in worker_error()
190 mythread_cond_signal(&thr->coder->cond); in worker_error()
198 worker_encode(worker_thread *thr, worker_state state) in worker_encode() argument
200 assert(thr->progress_in == 0); in worker_encode()
201 assert(thr->progress_out == 0); in worker_encode()
204 thr->block_options = (lzma_block){ in worker_encode()
[all …]
/NextBSD/contrib/compiler-rt/lib/tsan/dd/
HDdd_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 …]
HDdd_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 …]
/NextBSD/contrib/gcclibs/libgomp/
HDteam.c73 struct gomp_thread *thr; in gomp_thread_start() local
78 thr = &gomp_tls_data; in gomp_thread_start()
81 thr = &local_thr; in gomp_thread_start()
82 pthread_setspecific (gomp_tls_key, thr); in gomp_thread_start()
84 gomp_sem_init (&thr->release, 0); in gomp_thread_start()
89 thr->ts = data->ts; in gomp_thread_start()
91 thr->ts.team->ordered_release[thr->ts.team_id] = &thr->release; in gomp_thread_start()
95 gomp_barrier_wait (&thr->ts.team->barrier); in gomp_thread_start()
97 gomp_barrier_wait (&thr->ts.team->barrier); in gomp_thread_start()
101 gomp_threads[thr->ts.team_id] = thr; in gomp_thread_start()
[all …]
HDordered.c40 struct gomp_thread *thr = gomp_thread (); in gomp_ordered_first() local
41 struct gomp_team *team = thr->ts.team; in gomp_ordered_first()
42 struct gomp_work_share *ws = thr->ts.work_share; in gomp_ordered_first()
52 ws->ordered_team_ids[index] = thr->ts.team_id; in gomp_ordered_first()
58 gomp_sem_post (team->ordered_release[thr->ts.team_id]); in gomp_ordered_first()
71 struct gomp_thread *thr = gomp_thread (); in gomp_ordered_last() local
72 struct gomp_team *team = thr->ts.team; in gomp_ordered_last()
73 struct gomp_work_share *ws = thr->ts.work_share; in gomp_ordered_last()
106 struct gomp_thread *thr = gomp_thread (); in gomp_ordered_next() local
107 struct gomp_team *team = thr->ts.team; in gomp_ordered_next()
[all …]
HDloop.c69 struct gomp_thread *thr = gomp_thread (); in gomp_loop_static_start() local
72 gomp_loop_init (thr->ts.work_share, start, end, incr, in gomp_loop_static_start()
74 gomp_mutex_unlock (&thr->ts.work_share->lock); in gomp_loop_static_start()
83 struct gomp_thread *thr = gomp_thread (); in gomp_loop_dynamic_start() local
87 gomp_loop_init (thr->ts.work_share, start, end, incr, in gomp_loop_dynamic_start()
91 gomp_mutex_unlock (&thr->ts.work_share->lock); in gomp_loop_dynamic_start()
95 gomp_mutex_unlock (&thr->ts.work_share->lock); in gomp_loop_dynamic_start()
105 struct gomp_thread *thr = gomp_thread (); in gomp_loop_guided_start() local
109 gomp_loop_init (thr->ts.work_share, start, end, incr, in gomp_loop_guided_start()
113 gomp_mutex_unlock (&thr->ts.work_share->lock); in gomp_loop_guided_start()
[all …]
HDwork.c74 struct gomp_thread *thr = gomp_thread (); in gomp_work_share_start() local
75 struct gomp_team *team = thr->ts.team; in gomp_work_share_start()
83 thr->ts.work_share = ws; in gomp_work_share_start()
84 thr->ts.static_trip = 0; in gomp_work_share_start()
92 ws_gen = ++thr->ts.work_share_generation; in gomp_work_share_start()
100 thr->ts.work_share = ws; in gomp_work_share_start()
101 thr->ts.static_trip = 0; in gomp_work_share_start()
131 thr->ts.work_share = ws; in gomp_work_share_start()
132 thr->ts.static_trip = 0; in gomp_work_share_start()
148 struct gomp_thread *thr = gomp_thread (); in gomp_work_share_end() local
[all …]
HDiter.c43 struct gomp_thread *thr = gomp_thread (); in gomp_iter_static_next() local
44 struct gomp_team *team = thr->ts.team; in gomp_iter_static_next()
45 struct gomp_work_share *ws = thr->ts.work_share; in gomp_iter_static_next()
48 if (thr->ts.static_trip == -1) in gomp_iter_static_next()
56 thr->ts.static_trip = -1; in gomp_iter_static_next()
69 if (thr->ts.static_trip > 0) in gomp_iter_static_next()
75 i = thr->ts.team_id; in gomp_iter_static_next()
89 thr->ts.static_trip = 1; in gomp_iter_static_next()
99 thr->ts.static_trip = (e0 == n ? -1 : 1); in gomp_iter_static_next()
112 i = thr->ts.team_id; in gomp_iter_static_next()
[all …]
/NextBSD/contrib/compiler-rt/lib/tsan/tests/unit/
HDtsan_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 …]
HDtsan_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 …]
HDtsan_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 …]
/NextBSD/sys/ddb/
HDdb_thread.c55 struct thread *thr; in db_set_thread() local
69 thr = kdb_thr_lookup(tid); in db_set_thread()
70 if (thr != NULL) { in db_set_thread()
71 err = kdb_thr_select(thr); in db_set_thread()
74 (long)thr->td_tid); in db_set_thread()
93 struct thread *thr; in db_show_threads() local
95 thr = kdb_thr_first(); in db_show_threads()
96 while (!db_pager_quit && thr != NULL) { in db_show_threads()
97 db_printf(" %6ld (%p) (stack %p) ", (long)thr->td_tid, thr, in db_show_threads()
98 (void *)thr->td_kstack); in db_show_threads()
[all …]

1234