Home
last modified time | relevance | path

Searched refs:ThreadState (Results 1 – 25 of 35) sorted by relevance

12

/openbsd-src/gnu/llvm/compiler-rt/lib/tsan/rtl/
H A Dtsan_rtl.h114 ThreadState *thr; // currently wired thread, or nullptr
143 ThreadState *thr;
159 struct ThreadState { struct
174 ThreadState* current; argument
236 explicit ThreadState(Tid tid); argument
241 ThreadState *cur_thread();
242 void set_cur_thread(ThreadState *thr);
244 inline ThreadState *cur_thread_init() { return cur_thread(); } in cur_thread_init()
248 inline ThreadState *cur_thread() { in cur_thread()
249 return reinterpret_cast<ThreadState *>(cur_thread_placeholder)->current; in cur_thread()
[all …]
H A Dtsan_fd.h41 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 Dtsan_platform_mac.cpp49 static char main_thread_state[sizeof(ThreadState)] ALIGNED(
51 static ThreadState *dead_thread_state;
77 auto dts = (ThreadState *)MmapOrDie(sizeof(ThreadState), "ThreadState"); in InitializeThreadStateStorage()
82 res = internal_mprotect(dts, sizeof(ThreadState), PROT_READ); // immutable in InitializeThreadStateStorage()
87 ThreadState *cur_thread() { in cur_thread()
91 return (ThreadState *)main_thread_state; in cur_thread()
96 ThreadState *thr = (ThreadState *)pthread_getspecific(thread_state_key); in cur_thread()
98 thr = (ThreadState *)MmapOrDie(sizeof(ThreadState), "ThreadState"); in cur_thread()
105 void set_cur_thread(ThreadState *thr) { in set_cur_thread()
111 ThreadState *thr = (ThreadState *)pthread_getspecific(thread_state_key); in cur_thread_finalize()
[all …]
H A Dtsan_rtl_thread.cpp74 static void ThreadCheckIgnore(ThreadState *thr) { in ThreadCheckIgnore()
83 static void ThreadCheckIgnore(ThreadState *thr) {} in ThreadCheckIgnore()
86 void ThreadFinalize(ThreadState *thr) { in ThreadFinalize()
104 int ThreadCount(ThreadState *thr) { in ThreadCount()
116 Tid ThreadCreate(ThreadState *thr, uptr pc, uptr uid, bool detached) { in ThreadCreate()
145 ThreadState *thr;
152 void ThreadStart(ThreadState *thr, Tid tid, tid_t os_id, in ThreadStart()
203 thr = static_cast<ThreadState *>(arg); in OnStarted()
205 new (thr) ThreadState(tid); in OnStarted()
214 void ThreadFinish(ThreadState *thr) { in ThreadFinish()
[all …]
H A Dtsan_mman.h33 void *user_alloc_internal(ThreadState *thr, uptr pc, uptr sz,
36 void user_free(ThreadState *thr, uptr pc, void *p, bool signal = true);
38 void *user_alloc(ThreadState *thr, uptr pc, uptr sz);
39 void *user_calloc(ThreadState *thr, uptr pc, uptr sz, uptr n);
40 void *user_realloc(ThreadState *thr, uptr pc, void *p, uptr sz);
41 void *user_reallocarray(ThreadState *thr, uptr pc, void *p, uptr sz, uptr n);
42 void *user_memalign(ThreadState *thr, uptr pc, uptr align, uptr sz);
43 int user_posix_memalign(ThreadState *thr, uptr pc, void **memptr, uptr align,
45 void *user_aligned_alloc(ThreadState *thr, uptr pc, uptr align, uptr sz);
46 void *user_valloc(ThreadState *thr, uptr pc, uptr sz);
[all …]
H A Dtsan_mman.cpp85 ThreadState *thr = cur_thread(); in ScopedGlobalProcessor()
108 ThreadState *thr = cur_thread(); in ~ScopedGlobalProcessor()
163 static void SignalUnsafeCall(ThreadState *thr, uptr pc) { in SignalUnsafeCall()
178 void *user_alloc_internal(ThreadState *thr, uptr pc, uptr sz, uptr align, in user_alloc_internal()
210 void user_free(ThreadState *thr, uptr pc, void *p, bool signal) { in user_free()
219 void *user_alloc(ThreadState *thr, uptr pc, uptr sz) { in user_alloc()
223 void *user_calloc(ThreadState *thr, uptr pc, uptr size, uptr n) { in user_calloc()
236 void *user_reallocarray(ThreadState *thr, uptr pc, void *p, uptr size, uptr n) { in user_reallocarray()
246 void OnUserAlloc(ThreadState *thr, uptr pc, uptr p, uptr sz, bool write) { in OnUserAlloc()
264 void OnUserFree(ThreadState *thr, uptr pc, uptr p, bool write) { in OnUserFree()
[all …]
H A Dtsan_fd.cpp56 static FdSync *allocsync(ThreadState *thr, uptr pc) { in allocsync()
69 static void unref(ThreadState *thr, uptr pc, FdSync *s) { in unref()
80 static FdDesc *fddesc(ThreadState *thr, uptr pc, int fd) { in fddesc()
101 static void init(ThreadState *thr, uptr pc, int fd, FdSync *s, in init()
145 void FdOnFork(ThreadState *thr, uptr pc) { in FdOnFork()
178 void FdAcquire(ThreadState *thr, uptr pc, int fd) { in FdAcquire()
189 void FdRelease(ThreadState *thr, uptr pc, int fd) { in FdRelease()
202 void FdAccess(ThreadState *thr, uptr pc, int fd) { in FdAccess()
210 void FdClose(ThreadState *thr, uptr pc, int fd, bool write) { in FdClose()
253 void FdFileCreate(ThreadState *thr, uptr pc, int fd) { in FdFileCreate()
[all …]
H A Dtsan_interface.cpp31 ThreadState *thr = cur_thread(); in __tsan_read16_pc()
38 ThreadState *thr = cur_thread(); in __tsan_write16_pc()
47 ThreadState *thr = cur_thread(); in __tsan_unaligned_read16()
54 ThreadState *thr = cur_thread(); in __tsan_unaligned_write16()
72 FiberDestroy(cur_thread(), CALLERPC, static_cast<ThreadState *>(fiber)); in __tsan_destroy_fiber()
77 FiberSwitch(cur_thread(), CALLERPC, static_cast<ThreadState *>(fiber), flags); in __tsan_switch_to_fiber()
82 ThreadSetName(static_cast<ThreadState *>(fiber), name); in __tsan_set_fiber_name()
H A Dtsan_rtl_mutex.cpp25 void ReportDeadlock(ThreadState *thr, uptr pc, DDReport *r);
26 void ReportDestroyLocked(ThreadState *thr, uptr pc, uptr addr,
30 ThreadState *thr;
33 Callback(ThreadState *thr, uptr pc) in Callback()
44 void DDMutexInit(ThreadState *thr, uptr pc, SyncVar *s) { in DDMutexInit()
50 static void ReportMutexMisuse(ThreadState *thr, uptr pc, ReportType typ, in ReportMutexMisuse()
68 static void RecordMutexLock(ThreadState *thr, uptr pc, uptr addr, in RecordMutexLock()
80 static void RecordMutexUnlock(ThreadState *thr, uptr addr) { in RecordMutexUnlock()
86 void MutexCreate(ThreadState *thr, uptr pc, uptr addr, u32 flagz) { in MutexCreate()
98 void MutexDestroy(ThreadState *thr, uptr pc, uptr addr, u32 flagz) { in MutexDestroy()
[all …]
H A Dtsan_platform_linux.cpp465 void ImitateTlsWrite(ThreadState *thr, uptr tls_addr, uptr tls_size) { in ImitateTlsWrite()
502 static ThreadState *dead_thread_state = nullptr;
504 ThreadState *cur_thread() { in cur_thread()
505 ThreadState* thr = reinterpret_cast<ThreadState*>(*get_android_tls_ptr()); in cur_thread()
511 thr = reinterpret_cast<ThreadState*>(*get_android_tls_ptr()); in cur_thread()
513 thr = reinterpret_cast<ThreadState*>(MmapOrDie(sizeof(ThreadState), in cur_thread()
517 dead_thread_state = reinterpret_cast<ThreadState*>( in cur_thread()
518 MmapOrDie(sizeof(ThreadState), "ThreadState")); in cur_thread()
523 CHECK_EQ(0, internal_mprotect(dead_thread_state, sizeof(ThreadState), in cur_thread()
532 void set_cur_thread(ThreadState *thr) { in set_cur_thread()
[all …]
H A Dtsan_rtl_access.cpp18 ALWAYS_INLINE USED bool TryTraceMemoryAccess(ThreadState* thr, uptr pc, in TryTraceMemoryAccess()
57 bool TryTraceMemoryAccessRange(ThreadState* thr, uptr pc, uptr addr, uptr size, in TryTraceMemoryAccessRange()
78 void TraceMemoryAccessRange(ThreadState* thr, uptr pc, uptr addr, uptr size, in TraceMemoryAccessRange()
87 void TraceFunc(ThreadState* thr, uptr pc) { in TraceFunc()
95 NOINLINE void TraceRestartFuncEntry(ThreadState* thr, uptr pc) { in TraceRestartFuncEntry()
100 NOINLINE void TraceRestartFuncExit(ThreadState* thr) { in TraceRestartFuncExit()
105 void TraceMutexLock(ThreadState* thr, EventType type, uptr pc, uptr addr, in TraceMutexLock()
122 void TraceMutexUnlock(ThreadState* thr, uptr addr) { in TraceMutexUnlock()
134 void TraceTime(ThreadState* thr) { in TraceTime()
148 NOINLINE void DoReportRace(ThreadState* thr, RawShadow* shadow_mem, Shadow cur, in DoReportRace()
[all …]
H A Dtsan_rtl.cpp50 THREADLOCAL char cur_thread_placeholder[sizeof(ThreadState)] ALIGNED(
79 static TracePart* TracePartAlloc(ThreadState* thr) { in TracePartAlloc()
232 void DoReset(ThreadState* thr, uptr epoch) SANITIZER_NO_THREAD_SAFETY_ANALYSIS { in DoReset()
251 static TidSlot* FindSlotAndLock(ThreadState* thr) in FindSlotAndLock()
295 void SlotAttachAndLock(ThreadState* thr) { in SlotAttachAndLock()
319 static void SlotDetachImpl(ThreadState* thr, bool exiting) { in SlotDetachImpl()
351 void SlotDetach(ThreadState* thr) { in SlotDetach()
356 void SlotLock(ThreadState* thr) SANITIZER_NO_THREAD_SAFETY_ANALYSIS { in SlotLock()
376 void SlotUnlock(ThreadState* thr) { in SlotUnlock()
406 ThreadState::ThreadState(Tid tid) in ThreadState() function in __tsan::ThreadState
[all …]
H A Dtsan_interface_atomic.cpp224 static T AtomicLoad(ThreadState *thr, uptr pc, const volatile T *a, morder mo) { in AtomicLoad()
262 static void AtomicStore(ThreadState *thr, uptr pc, volatile T *a, T v, in AtomicStore()
285 static T AtomicRMW(ThreadState *thr, uptr pc, volatile T *a, T v, morder mo) { in AtomicRMW()
342 static T AtomicExchange(ThreadState *thr, uptr pc, volatile T *a, T v, in AtomicExchange()
348 static T AtomicFetchAdd(ThreadState *thr, uptr pc, volatile T *a, T v, in AtomicFetchAdd()
354 static T AtomicFetchSub(ThreadState *thr, uptr pc, volatile T *a, T v, in AtomicFetchSub()
360 static T AtomicFetchAnd(ThreadState *thr, uptr pc, volatile T *a, T v, in AtomicFetchAnd()
366 static T AtomicFetchOr(ThreadState *thr, uptr pc, volatile T *a, T v, in AtomicFetchOr()
372 static T AtomicFetchXor(ThreadState *thr, uptr pc, volatile T *a, T v, in AtomicFetchXor()
378 static T AtomicFetchNand(ThreadState *thr, uptr pc, volatile T *a, T v, in AtomicFetchNand()
[all …]
H A Dtsan_interceptors.h11 ScopedInterceptor(ThreadState *thr, const char *fname, uptr pc);
23 ThreadState *const thr_;
40 inline bool MustIgnoreInterceptor(ThreadState *thr) { in MustIgnoreInterceptor()
47 ThreadState *thr = cur_thread_init(); \
H A Dtsan_sync.h67 void Init(ThreadState *thr, uptr pc, uptr addr, bool save_stack);
97 void AllocBlock(ThreadState *thr, uptr pc, uptr p, uptr sz);
114 SyncVar *GetSyncOrCreate(ThreadState *thr, uptr pc, uptr addr, in GetSyncOrCreate()
142 SyncVar *GetSync(ThreadState *thr, uptr pc, uptr addr, bool create,
H A Dtsan_interface.h225 struct ThreadState;
405 void __tsan_go_atomic32_load(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
407 void __tsan_go_atomic64_load(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
409 void __tsan_go_atomic32_store(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
411 void __tsan_go_atomic64_store(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
413 void __tsan_go_atomic32_fetch_add(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
415 void __tsan_go_atomic64_fetch_add(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
417 void __tsan_go_atomic32_exchange(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
419 void __tsan_go_atomic64_exchange(ThreadState *thr, uptr cpc, uptr pc, u8 *a);
421 void __tsan_go_atomic32_compare_exchange(ThreadState *thr, uptr cpc, uptr pc,
[all …]
H A Dtsan_interceptors_posix.cpp177 void EnterBlockingFunc(ThreadState *thr) { in EnterBlockingFunc()
252 static ThreadSignalContext *SigCtx(ThreadState *thr) { in SigCtx()
270 ScopedInterceptor::ScopedInterceptor(ThreadState *thr, const char *fname, in ScopedInterceptor()
359 explicit BlockingCall(ThreadState *thr) in BlockingCall()
375 ThreadState *thr;
419 ThreadState *thr = cur_thread(); in at_exit_callback_installed_at()
428 ThreadState *thr = cur_thread(); in cxa_at_exit_callback_installed_at()
437 static int setup_at_exit_wrapper(ThreadState *thr, uptr pc, void(*f)(),
458 static int setup_at_exit_wrapper(ThreadState *thr, uptr pc, void(*f)(), in setup_at_exit_wrapper()
494 ThreadState *thr = cur_thread(); in on_exit_callback_installed_at()
[all …]
H A Dtsan_rtl_proc.cpp45 void ProcWire(Processor *proc, ThreadState *thr) { in ProcWire()
52 void ProcUnwire(Processor *proc, ThreadState *thr) { in ProcUnwire()
H A Dtsan_sync.cpp19 void DDMutexInit(ThreadState *thr, uptr pc, SyncVar *s);
23 void SyncVar::Init(ThreadState *thr, uptr pc, uptr addr, bool save_stack) { in Init()
47 void MetaMap::AllocBlock(ThreadState *thr, uptr pc, uptr p, uptr sz) { in AllocBlock()
204 SyncVar *MetaMap::GetSync(ThreadState *thr, uptr pc, uptr addr, bool create, in GetSync()
/openbsd-src/gnu/llvm/compiler-rt/lib/tsan/go/
H A Dtsan_go.cpp121 static ThreadState *main_thr;
136 Processor *ThreadState::proc() { in proc()
142 static ThreadState *AllocGoroutine() { in AllocGoroutine()
143 auto *thr = (ThreadState *)Alloc(sizeof(ThreadState)); in AllocGoroutine()
148 void __tsan_init(ThreadState **thrp, Processor **procp, in __tsan_init()
151 ThreadState *thr = AllocGoroutine(); in __tsan_init()
160 ThreadState *thr = main_thr; in __tsan_fini()
169 void __tsan_read(ThreadState *thr, void *addr, void *pc) { in __tsan_read()
173 void __tsan_read_pc(ThreadState *thr, void *addr, uptr callpc, uptr pc) { in __tsan_read_pc()
181 void __tsan_write(ThreadState *thr, void *addr, void *pc) { in __tsan_write()
[all …]
/openbsd-src/gnu/llvm/compiler-rt/lib/scudo/standalone/
H A Dtsd_exclusive.h16 struct ThreadState { struct
60 if (LIKELY(State.InitState != ThreadState::NotInitialized)) in initThreadMaybe()
66 if (LIKELY(State.InitState == ThreadState::Initialized && in getTSDAndLock()
111 State.InitState = ThreadState::Initialized; in initThread()
120 static thread_local ThreadState State;
129 thread_local ThreadState TSDRegistryExT<Allocator>::State;
147 TSDRegistryT::State.InitState = ThreadState::TornDown; in teardownThread()
/openbsd-src/gnu/llvm/compiler-rt/lib/tsan/tests/unit/
H A Dtsan_mman_test.cpp37 ThreadState *thr = cur_thread(); in TEST()
51 ThreadState *thr = cur_thread(); in TEST()
98 ThreadState *thr = cur_thread(); in TEST()
111 ThreadState *thr = cur_thread(); in TEST()
140 ThreadState *thr = cur_thread(); in TEST()
162 ThreadState *thr = cur_thread(); in TEST()
179 ThreadState *thr = cur_thread(); in TEST()
189 ThreadState *thr = cur_thread(); in TEST()
H A Dtsan_sync_test.cpp19 ThreadState *thr = cur_thread(); in TEST()
35 ThreadState *thr = cur_thread(); in TEST()
56 ThreadState *thr = cur_thread(); in TEST()
79 ThreadState *thr = cur_thread(); in TEST()
114 ThreadState *thr = cur_thread(); in TEST()
H A Dtsan_trace_test.cpp38 thr = static_cast<ThreadState *>( in ThreadArray()
39 MmapOrDie(sizeof(ThreadState), "ThreadState")); in ThreadArray()
61 UnmapOrDie(thr, sizeof(ThreadState)); in Finish()
64 ThreadState *threads[N];
65 ThreadState *operator[](uptr i) { return threads[i]; } in operator []()
66 ThreadState *operator->() { return threads[0]; } in operator ->()
67 operator ThreadState *() { return threads[0]; } in operator ThreadState*()
273 auto check_thread = [&](ThreadState *thr, uptr size, uptr count, in TRACE_TEST()
H A Dtsan_stack_test.cpp21 ThreadState thr(kMainTid); in TestStackTrace()
46 ThreadState thr(kMainTid); in TestTrim()

12