Lines Matching refs:tid
69 static void DumpEvent(CONTEXT *ctx, EventType type, int32_t tid, uintptr_t pc,
132 typedef void (*callback_t)(THREADID tid, InstrumentedCallFrame &frame,
203 THREADID tid; member
240 static void ReportAccesRange(THREADID tid, uintptr_t pc, EventType type, uintptr_t x, size_t size) { in ReportAccesRange() argument
241 if (size && !g_pin_threads[tid].ignore_accesses) { in ReportAccesRange()
245 DumpEvent(0, type, tid, pc, a, cur_size); in ReportAccesRange()
250 #define REPORT_READ_RANGE(x, size) ReportAccesRange(tid, pc, READ, (uintptr_t)x, size)
251 #define REPORT_WRITE_RANGE(x, size) ReportAccesRange(tid, pc, WRITE, (uintptr_t)x, size)
253 #define EXTRA_REPLACE_PARAMS THREADID tid, uintptr_t pc,
254 #define EXTRA_REPLACE_ARGS tid, pc,
323 static bool DumpEventPlainText(EventType type, int32_t tid, uintptr_t pc, in DumpEventPlainText() argument
350 fprintf(log_file, "%s %x %lx %lx %lx\n", kEventNames[type], tid, in DumpEventPlainText()
416 Printf("ACHTUNG!!! an event from a dead thread T%d\n", t.tid); in TLEBFlushUnlocked()
637 static void DumpEventWithSp(uintptr_t sp, EventType type, int32_t tid, uintptr_t pc, in DumpEventWithSp() argument
640 PinThread &t = g_pin_threads[tid]; in DumpEventWithSp()
647 static void DumpEvent(CONTEXT *ctx, EventType type, int32_t tid, uintptr_t pc, in DumpEvent() argument
650 type, tid, pc, a, info); in DumpEvent()
688 #define FAST_WRAP_PARAM0 THREADID tid, ADDRINT pc, ADDRINT sp
694 THREADID tid, InstrumentedCallFrame &frame, ADDRINT ret
701 g_pin_threads[tid].ic_stack.Push(callback, pc, sp, a0, 0); \
704 tid, __FUNCTION__, pc, sp,\
707 g_pin_threads[tid].ic_stack.size()\
723 #define WRAP_PARAM4 THREADID tid, ADDRINT pc, CONTEXT *ctx, \
733 static uintptr_t CallFun4(CONTEXT *ctx, THREADID tid, in CallFun4() argument
737 PIN_CallApplicationFunction(ctx, tid, in CallFun4()
748 static uintptr_t CallFun6(CONTEXT *ctx, THREADID tid, in CallFun6() argument
753 PIN_CallApplicationFunction(ctx, tid, in CallFun6()
766 #define CALL_ME_INSIDE_WRAPPER_4() CallFun4(ctx, tid, f, arg0, arg1, arg2, arg3)
767 #define CALL_ME_INSIDE_WRAPPER_6() CallFun6(ctx, tid, f, arg0, arg1, arg2, arg3, arg4, arg5)
859 static void ShowPcAndSp(const char *where, THREADID tid, in ShowPcAndSp() argument
861 Printf("%s T%d sp=%ld pc=%p %s\n", where, tid, sp, pc, in ShowPcAndSp()
866 Printf("T%d Shadow stack (%d)\n", t.tid, (int)t.shadow_stack.size()); in PrintShadowStack()
874 static void DebugOnlyShowPcAndSp(const char *where, THREADID tid, in DebugOnlyShowPcAndSp() argument
877 ShowPcAndSp(where, tid, pc, sp); in DebugOnlyShowPcAndSp()
887 static void IgnoreMopsBegin(THREADID tid) { in IgnoreMopsBegin() argument
889 TLEBSimpleEvent(g_pin_threads[tid], TLEB_IGNORE_ALL_BEGIN); in IgnoreMopsBegin()
891 static void IgnoreMopsEnd(THREADID tid) { in IgnoreMopsEnd() argument
893 TLEBSimpleEvent(g_pin_threads[tid], TLEB_IGNORE_ALL_END); in IgnoreMopsEnd()
896 static void IgnoreSyncAndMopsBegin(THREADID tid) { in IgnoreSyncAndMopsBegin() argument
898 IgnoreMopsBegin(tid); in IgnoreSyncAndMopsBegin()
899 TLEBSimpleEvent(g_pin_threads[tid], TLEB_IGNORE_SYNC_BEGIN); in IgnoreSyncAndMopsBegin()
901 static void IgnoreSyncAndMopsEnd(THREADID tid) { in IgnoreSyncAndMopsEnd() argument
903 IgnoreMopsEnd(tid); in IgnoreSyncAndMopsEnd()
904 TLEBSimpleEvent(g_pin_threads[tid], TLEB_IGNORE_SYNC_END); in IgnoreSyncAndMopsEnd()
930 static void Before_cxa_guard_acquire(THREADID tid, ADDRINT pc, ADDRINT guard) { in Before_cxa_guard_acquire() argument
931 IgnoreMopsBegin(tid); in Before_cxa_guard_acquire()
934 static void After_cxa_guard_acquire(THREADID tid, ADDRINT pc, ADDRINT ret) { in After_cxa_guard_acquire() argument
939 IgnoreMopsEnd(tid); in After_cxa_guard_acquire()
943 static void After_cxa_guard_release(THREADID tid, ADDRINT pc) { in After_cxa_guard_release() argument
944 IgnoreMopsEnd(tid); in After_cxa_guard_release()
949 IgnoreMopsBegin(tid); in WRAP_NAME()
951 IgnoreMopsEnd(tid); in WRAP_NAME()
955 void TmpCallback1(THREADID tid, ADDRINT pc) { in TmpCallback1() argument
956 Printf("%s T%d %lx\n", __FUNCTION__, tid, pc); in TmpCallback1()
958 void TmpCallback2(THREADID tid, ADDRINT pc) { in TmpCallback2() argument
959 Printf("%s T%d %lx\n", __FUNCTION__, tid, pc); in TmpCallback2()
963 static void HandleThreadCreateBefore(THREADID tid, ADDRINT pc) { in HandleThreadCreateBefore() argument
964 DumpEvent(0, THR_CREATE_BEFORE, tid, pc, 0, 0); in HandleThreadCreateBefore()
966 IgnoreMopsBegin(tid); in HandleThreadCreateBefore()
968 g_tid_of_thread_which_called_create_thread = tid; in HandleThreadCreateBefore()
972 static void HandleThreadCreateAbort(THREADID tid) { in HandleThreadCreateAbort() argument
973 CHECK(g_tid_of_thread_which_called_create_thread == tid); in HandleThreadCreateAbort()
976 IgnoreMopsEnd(tid); in HandleThreadCreateAbort()
980 static THREADID HandleThreadCreateAfter(THREADID tid, pthread_t child_ptid, in HandleThreadCreateAfter() argument
984 while (!ATOMIC_READ(&g_pin_threads[tid].last_child_tid)) { in HandleThreadCreateAfter()
988 CHECK(g_tid_of_thread_which_called_create_thread == tid); in HandleThreadCreateAfter()
991 THREADID last_child_tid = g_pin_threads[tid].last_child_tid; in HandleThreadCreateAfter()
1015 g_pin_threads[tid].last_child_tid = 0; in HandleThreadCreateAfter()
1017 IgnoreMopsEnd(tid); in HandleThreadCreateAfter()
1020 DumpEvent(0, THR_CREATE_AFTER, tid, 0, 0, uniq_tid_of_child); in HandleThreadCreateAfter()
1025 HandleThreadCreateBefore(tid, pc); in WRAP_NAME()
1029 HandleThreadCreateAbort(tid); in WRAP_NAME()
1034 HandleThreadCreateAfter(tid, child_ptid, false); in WRAP_NAME()
1039 void CallbackForThreadStart(THREADID tid, CONTEXT *ctxt, in CallbackForThreadStart() argument
1048 if (tid == 0) { in CallbackForThreadStart()
1052 CHECK(tid > 0); in CallbackForThreadStart()
1055 CHECK(tid < kMaxThreads); in CallbackForThreadStart()
1056 PinThread &t = g_pin_threads[tid]; in CallbackForThreadStart()
1060 t.tid = tid; in CallbackForThreadStart()
1079 Printf("T%d ThreadStart parent=%d child=%d\n", tid, t.parent_tid, tid); in CallbackForThreadStart()
1083 g_pin_threads[t.parent_tid].last_child_tid = tid; in CallbackForThreadStart()
1103 static void Before_start_thread(THREADID tid, ADDRINT pc, ADDRINT sp) { in Before_start_thread() argument
1104 PinThread &t = g_pin_threads[tid]; in Before_start_thread()
1107 tid, sp, t.my_ptid, t.my_ptid - sp); in Before_start_thread()
1154 Printf("T%d found stack: %p size=%p\n", tid, prev, val); in Before_start_thread()
1156 DumpEvent(0, THR_STACK_TOP, tid, pc, prev + val, val); in Before_start_thread()
1162 Printf("WARNING: ThreadSanitizerPin is guessing stack size for T%d\n", tid); in Before_start_thread()
1163 DumpEvent(0, THR_STACK_TOP, tid, pc, sp, t.thread_stack_size_if_known); in Before_start_thread()
1168 PinThread &t = g_pin_threads[tid]; in WRAP_NAME()
1171 HandleThreadCreateBefore(tid, pc); in WRAP_NAME()
1182 HandleThreadCreateAbort(tid); in WRAP_NAME()
1186 THREADID child_tid = HandleThreadCreateAfter(tid, child_ptid, in WRAP_NAME()
1198 static void Before_BaseThreadInitThunk(THREADID tid, ADDRINT pc, ADDRINT sp) { in Before_BaseThreadInitThunk() argument
1199 PinThread &t = g_pin_threads[tid]; in Before_BaseThreadInitThunk()
1212 DumpEvent(0, THR_STACK_TOP, tid, pc, sp, stack_size); in Before_BaseThreadInitThunk()
1223 DumpEvent(0, WAIT, tid, pc, t.my_ptid, 0); in Before_BaseThreadInitThunk()
1228 static void Before_RtlExitUserThread(THREADID tid, ADDRINT pc) { in Before_RtlExitUserThread() argument
1229 PinThread &t = g_pin_threads[tid]; in Before_RtlExitUserThread()
1230 if (t.tid != 0) { in Before_RtlExitUserThread()
1235 IgnoreSyncAndMopsBegin(tid); in Before_RtlExitUserThread()
1240 void CallbackForThreadFini(THREADID tid, const CONTEXT *ctxt, in CallbackForThreadFini() argument
1242 PinThread &t = g_pin_threads[tid]; in CallbackForThreadFini()
1247 Printf("T%d Thread finished (ptid=%d)\n", tid, t.my_ptid); in CallbackForThreadFini()
1251 static bool HandleThreadJoinAfter(THREADID tid, pthread_t joined_ptid) { in HandleThreadJoinAfter() argument
1278 Printf("T%d JoinAfter returns false! ptid=%d\n", tid, joined_ptid); in HandleThreadJoinAfter()
1287 Printf("T%d JoinAfter parent=%d child=%d (uniq=%d)\n", tid, tid, in HandleThreadJoinAfter()
1296 DumpEvent(0, THR_JOIN_AFTER, tid, 0, joined_uniq_tid, 0); in HandleThreadJoinAfter()
1302 Printf("T%d in pthread_join %p\n", tid, arg0); in WRAP_NAME()
1305 HandleThreadJoinAfter(tid, joined_ptid); in WRAP_NAME()
1307 Printf("T%d out pthread_join %p\n", tid, arg0); in WRAP_NAME()
1315 IgnoreMopsBegin(tid); in WRAP_NAME()
1317 IgnoreMopsEnd(tid); in WRAP_NAME()
1324 uintptr_t CallStdCallFun1(CONTEXT *ctx, THREADID tid, in CallStdCallFun1() argument
1327 PIN_CallApplicationFunction(ctx, tid, in CallStdCallFun1()
1335 uintptr_t CallStdCallFun2(CONTEXT *ctx, THREADID tid, in CallStdCallFun2() argument
1338 PIN_CallApplicationFunction(ctx, tid, in CallStdCallFun2()
1347 uintptr_t CallStdCallFun3(CONTEXT *ctx, THREADID tid, in CallStdCallFun3() argument
1351 PIN_CallApplicationFunction(ctx, tid, in CallStdCallFun3()
1361 uintptr_t CallStdCallFun4(CONTEXT *ctx, THREADID tid, in CallStdCallFun4() argument
1365 PIN_CallApplicationFunction(ctx, tid, in CallStdCallFun4()
1376 uintptr_t CallStdCallFun5(CONTEXT *ctx, THREADID tid, in CallStdCallFun5() argument
1381 PIN_CallApplicationFunction(ctx, tid, in CallStdCallFun5()
1393 uintptr_t CallStdCallFun6(CONTEXT *ctx, THREADID tid, in CallStdCallFun6() argument
1398 PIN_CallApplicationFunction(ctx, tid, in CallStdCallFun6()
1411 uintptr_t CallStdCallFun7(CONTEXT *ctx, THREADID tid, in CallStdCallFun7() argument
1417 PIN_CallApplicationFunction(ctx, tid, in CallStdCallFun7()
1433 DumpEvent(ctx, SIGNAL, tid, pc, arg0, 0); in WRAP_NAME()
1434 uintptr_t ret = CallStdCallFun1(ctx, tid, f, arg0); in WRAP_NAME()
1439 DumpEvent(ctx, LOCK_CREATE, tid, pc, arg0, 0); in WRAP_NAME()
1440 IgnoreSyncAndMopsBegin(tid); in WRAP_NAME()
1441 uintptr_t ret = CallStdCallFun1(ctx, tid, f, arg0); in WRAP_NAME()
1442 IgnoreSyncAndMopsEnd(tid); in WRAP_NAME()
1447 DumpEvent(ctx, LOCK_CREATE, tid, pc, arg0, 0); in WRAP_NAME()
1448 IgnoreSyncAndMopsBegin(tid); in WRAP_NAME()
1449 uintptr_t ret = CallStdCallFun2(ctx, tid, f, arg0, arg1); in WRAP_NAME()
1450 IgnoreSyncAndMopsEnd(tid); in WRAP_NAME()
1455 DumpEvent(ctx, LOCK_CREATE, tid, pc, arg0, 0); in WRAP_NAME()
1456 IgnoreSyncAndMopsBegin(tid); in WRAP_NAME()
1457 uintptr_t ret = CallStdCallFun3(ctx, tid, f, arg0, arg1, arg2); in WRAP_NAME()
1458 IgnoreSyncAndMopsEnd(tid); in WRAP_NAME()
1463 DumpEvent(ctx, LOCK_DESTROY, tid, pc, arg0, 0); in WRAP_NAME()
1464 IgnoreSyncAndMopsBegin(tid); in WRAP_NAME()
1465 uintptr_t ret = CallStdCallFun1(ctx, tid, f, arg0); in WRAP_NAME()
1466 IgnoreSyncAndMopsEnd(tid); in WRAP_NAME()
1471 uintptr_t ret = CallStdCallFun1(ctx, tid, f, arg0); in WRAP_NAME()
1472 DumpEvent(ctx, WRITER_LOCK, tid, pc, arg0, 0); in WRAP_NAME()
1477 uintptr_t ret = CallStdCallFun1(ctx, tid, f, arg0); in WRAP_NAME()
1479 DumpEvent(ctx, WRITER_LOCK, tid, pc, arg0, 0); in WRAP_NAME()
1485 DumpEvent(ctx, UNLOCK, tid, pc, arg0, 0); in WRAP_NAME()
1486 return CallStdCallFun1(ctx, tid, f, arg0); in WRAP_NAME()
1492 return CallStdCallFun7(ctx, tid, f, arg0, arg1, arg2, arg3, arg4, arg5, arg6); in WRAP_NAME()
1497 DumpEvent(ctx, SIGNAL, tid, pc, arg0, 0); in WRAP_NAME()
1498 uintptr_t ret = CallStdCallFun1(ctx, tid, f, arg0); in WRAP_NAME()
1509 return CallStdCallFun4(ctx, tid, f, arg0, arg1, arg2, arg3); in InternalWrapCreateSemaphore()
1513 return InternalWrapCreateSemaphore(tid, pc, ctx, f, arg0, arg1, arg2, arg3); in WRAP_NAME()
1517 return InternalWrapCreateSemaphore(tid, pc, ctx, f, arg0, arg1, arg2, arg3); in WRAP_NAME()
1521 DumpEvent(ctx, SIGNAL, tid, pc, arg0, 0); in WRAP_NAME()
1522 return CallStdCallFun3(ctx, tid, f, arg0, arg1, arg2); in WRAP_NAME()
1526 DumpEvent(ctx, SIGNAL, tid, pc, arg1, 0); in WRAP_NAME()
1527 uintptr_t ret = CallStdCallFun2(ctx, tid, f, arg0, arg1); in WRAP_NAME()
1533 uintptr_t ret = CallStdCallFun1(ctx, tid, f, arg0); in WRAP_NAME()
1536 DumpEvent(ctx, WAIT, tid, pc, ret, 0); in WRAP_NAME()
1542 uintptr_t ret = CallStdCallFun1(ctx, tid, f, arg0); in WRAP_NAME()
1543 DumpEvent(ctx, WRITER_LOCK, tid, pc, arg0, 0); in WRAP_NAME()
1547 uintptr_t ret = CallStdCallFun1(ctx, tid, f, arg0); in WRAP_NAME()
1548 DumpEvent(ctx, READER_LOCK, tid, pc, arg0, 0); in WRAP_NAME()
1553 uintptr_t ret = CallStdCallFun1(ctx, tid, f, arg0); in WRAP_NAME()
1555 DumpEvent(ctx, WRITER_LOCK, tid, pc, arg0, 0); in WRAP_NAME()
1561 uintptr_t ret = CallStdCallFun1(ctx, tid, f, arg0); in WRAP_NAME()
1563 DumpEvent(ctx, READER_LOCK, tid, pc, arg0, 0); in WRAP_NAME()
1569 DumpEvent(ctx, UNLOCK, tid, pc, arg0, 0); in WRAP_NAME()
1570 uintptr_t ret = CallStdCallFun1(ctx, tid, f, arg0); in WRAP_NAME()
1575 DumpEvent(ctx, UNLOCK, tid, pc, arg0, 0); in WRAP_NAME()
1576 uintptr_t ret = CallStdCallFun1(ctx, tid, f, arg0); in WRAP_NAME()
1581 DumpEvent(ctx, LOCK_CREATE, tid, pc, arg0, 0); in WRAP_NAME()
1582 uintptr_t ret = CallStdCallFun1(ctx, tid, f, arg0); in WRAP_NAME()
1588 DumpEvent(ctx, SIGNAL, tid, pc, arg0, 0); in WRAP_NAME()
1589 uintptr_t ret = CallStdCallFun1(ctx, tid, f, arg0); in WRAP_NAME()
1594 DumpEvent(ctx, SIGNAL, tid, pc, arg0, 0); in WRAP_NAME()
1595 uintptr_t ret = CallStdCallFun1(ctx, tid, f, arg0); in WRAP_NAME()
1601 uintptr_t ret = CallStdCallFun4(ctx, tid, f, arg0, arg1, arg2, arg3); in WRAP_NAME()
1603 DumpEvent(ctx, WAIT, tid, pc, arg0, 0); in WRAP_NAME()
1609 uintptr_t ret = CallStdCallFun3(ctx, tid, f, arg0, arg1, arg2); in WRAP_NAME()
1611 DumpEvent(ctx, WAIT, tid, pc, arg0, 0); in WRAP_NAME()
1619 DumpEvent(ctx, SIGNAL, tid, pc, arg0, 0); in WRAP_NAME()
1620 uintptr_t ret = CallStdCallFun3(ctx, tid, f, arg0, arg1, arg2); in WRAP_NAME()
1627 DumpEvent(ctx, SIGNAL, tid, pc, arg2, 0); in WRAP_NAME()
1628 uintptr_t ret = CallStdCallFun6(ctx, tid, f, arg0, arg1, arg2, arg3, arg4, arg5); in WRAP_NAME()
1641 uintptr_t ret = CallStdCallFun2(ctx, tid, f, arg0, arg1); in WRAP_NAME()
1643 DumpEvent(ctx, WAIT, tid, pc, obj, 0); in WRAP_NAME()
1650 uintptr_t ret = CallStdCallFun4(ctx, tid, f, arg0, arg1, arg2, arg3); in WRAP_NAME()
1655 uintptr_t ret = CallStdCallFun2(ctx, tid, f, arg0, arg1); in WRAP_NAME()
1658 DumpEvent(ctx, MALLOC, tid, pc, ret, arg1); in WRAP_NAME()
1665 uintptr_t ret = CallStdCallFun6(ctx, tid, f, arg0, arg1, arg2, arg3, arg4, arg5); in WRAP_NAME()
1668 DumpEvent(ctx, MALLOC, tid, pc, *(uintptr_t*)arg1, *(uintptr_t*)arg3); in WRAP_NAME()
1674 uintptr_t ret = CallStdCallFun3(ctx, tid, f, arg0, arg1, arg2); in WRAP_NAME()
1677 DumpEvent(ctx, MALLOC, tid, pc, ret, arg3); in WRAP_NAME()
1683 uintptr_t ret = CallStdCallFun3(ctx, tid, f, arg0, arg1, arg2); in WRAP_NAME()
1684 Printf("T%d %s(%p %p %p)=%p\n", tid, __FUNCTION__, arg0, arg1, arg2, ret); in WRAP_NAME()
1694 ShowPcAndSp(__FUNCTION__, tid, pc, 0); in WRAP_NAME()
1699 uintptr_t ret = CallStdCallFun3(ctx, tid, f, arg0, arg1, arg2); in WRAP_NAME()
1712 HandleThreadJoinAfter(tid, arg0); in WRAP_NAME()
1713 DumpEvent(ctx, WAIT, tid, pc, arg0, 0); in WRAP_NAME()
1721 ShowPcAndSp(__FUNCTION__, tid, pc, 0); in WRAP_NAME()
1726 uintptr_t ret = CallStdCallFun5(ctx, tid, f, arg0, arg1, arg2, arg3, arg4); in WRAP_NAME()
1752 HandleThreadJoinAfter(tid, handle); in WRAP_NAME()
1753 DumpEvent(ctx, WAIT, tid, pc, handle, 0); in WRAP_NAME()
1767 DumpEvent(ctx, MMAP, tid, pc, ret, arg1); in WRAP_NAME()
1774 PinThread &t = g_pin_threads[tid]; in WRAP_NAME()
1778 DumpEvent(ctx, MUNMAP, tid, pc, arg0, arg1); in WRAP_NAME()
1787 Printf("T%d %s %ld %p\n", tid, __FUNCTION__, size, ret); in After_malloc()
1788 IgnoreSyncAndMopsEnd(tid); in After_malloc()
1789 DumpEventWithSp(frame.sp, MALLOC, tid, frame.pc, ret, size); in After_malloc()
1793 IgnoreSyncAndMopsBegin(tid); in Before_malloc()
1799 Printf("T%d %s %p\n", tid, __FUNCTION__, frame.arg[0]); in After_free()
1800 IgnoreSyncAndMopsEnd(tid); in After_free()
1804 PinThread &t = g_pin_threads[tid]; in Before_free()
1806 DumpEvent(0, FREE, tid, pc, arg0, 0); in Before_free()
1807 IgnoreSyncAndMopsBegin(tid); in Before_free()
1812 IgnoreSyncAndMopsBegin(tid); in Before_calloc()
1817 PinThread &t = g_pin_threads[tid]; in Before_realloc()
1819 IgnoreSyncAndMopsBegin(tid); in Before_realloc()
1825 ADDRINT Before_RET_IF(THREADID tid, ADDRINT pc, ADDRINT sp, ADDRINT ret) { in Before_RET_IF() argument
1826 PinThread &t = g_pin_threads[tid]; in Before_RET_IF()
1830 void Before_RET_THEN(THREADID tid, ADDRINT pc, ADDRINT sp, ADDRINT ret) { in Before_RET_THEN() argument
1831 PinThread &t = g_pin_threads[tid]; in Before_RET_THEN()
1837 tid, pc, sp, *(uintptr_t*)sp, frame->sp, t.ic_stack.size()); in Before_RET_THEN()
1843 frame->callback(tid, *frame, ret); in Before_RET_THEN()
1872 DumpEvent(0, SIGNAL, t.tid, 0, popped_pc, 0); in UpdateCallStack()
1878 ShowPcAndSp("RET : ", t.tid, popped_pc, sp); in UpdateCallStack()
1889 void InsertBeforeEvent_SysCall(THREADID tid, ADDRINT sp) { in InsertBeforeEvent_SysCall() argument
1890 PinThread &t = g_pin_threads[tid]; in InsertBeforeEvent_SysCall()
1895 void InsertBeforeEvent_Call(THREADID tid, ADDRINT pc, ADDRINT target, in InsertBeforeEvent_Call() argument
1897 PinThread &t = g_pin_threads[tid]; in InsertBeforeEvent_Call()
1898 DebugOnlyShowPcAndSp(__FUNCTION__, t.tid, pc, sp); in InsertBeforeEvent_Call()
1906 ShowPcAndSp("CALL: ", t.tid, target, sp); in InsertBeforeEvent_Call()
1913 DumpEvent(0, WAIT, tid, pc, target, 0); in InsertBeforeEvent_Call()
1918 static void OnTraceSerial(THREADID tid, ADDRINT sp, TraceInfo *trace_info, in OnTraceSerial() argument
1920 PinThread &t = g_pin_threads[tid]; in OnTraceSerial()
1924 DebugOnlyShowPcAndSp(__FUNCTION__, t.tid, trace_info->pc(), sp); in OnTraceSerial()
1941 DebugOnlyShowPcAndSp(__FUNCTION__, t.tid, trace_info->pc(), sp); in OnTraceParallel()
1981 static void OnTraceNoMopsVerify(THREADID tid, ADDRINT sp, in OnTraceNoMopsVerify() argument
1983 PinThread &t = g_pin_threads[tid]; in OnTraceNoMopsVerify()
1989 static void OnTraceVerify(THREADID tid, ADDRINT sp, TraceInfo *trace_info, in OnTraceVerify() argument
1992 PinThread &t = g_pin_threads[tid]; in OnTraceVerify()
2011 static void OnMop(uintptr_t *addr, THREADID tid, ADDRINT idx, ADDRINT a) { in OnMop() argument
2013 PinThread &t= g_pin_threads[tid]; in OnMop()
2020 Printf("T%d %s %lx\n", t.tid, __FUNCTION__, a); in OnMop()
2027 THREADID tid, ADDRINT idx, ADDRINT a) { in On_PredicatedMop() argument
2029 OnMop(addr, tid, idx, a); in On_PredicatedMop()
2033 static void OnMopCheckIdentStoreBefore(uintptr_t *addr, THREADID tid, ADDRINT idx, ADDRINT a) { in OnMopCheckIdentStoreBefore() argument
2037 static void OnMopCheckIdentStoreAfter(uintptr_t *addr, THREADID tid, ADDRINT idx, ADDRINT a) { in OnMopCheckIdentStoreAfter() argument
2051 static void Before_SignallingIOCall(THREADID tid, ADDRINT pc) { in Before_SignallingIOCall() argument
2052 DumpEvent(0, SIGNAL, tid, pc, kIOMagic, 0); in Before_SignallingIOCall()
2055 static void After_WaitingIOCall(THREADID tid, ADDRINT pc) { in After_WaitingIOCall() argument
2056 DumpEvent(0, WAIT, tid, pc, kIOMagic, 0); in After_WaitingIOCall()
2061 static void On_atexit(THREADID tid, ADDRINT pc) { in On_atexit() argument
2062 DumpEvent(0, SIGNAL, tid, pc, kAtexitMagic, 0); in On_atexit()
2065 static void On_exit(THREADID tid, ADDRINT pc) { in On_exit() argument
2066 DumpEvent(0, WAIT, tid, pc, kAtexitMagic, 0); in On_exit()
2071 static void Before_pthread_unlock(THREADID tid, ADDRINT pc, ADDRINT mu) { in Before_pthread_unlock() argument
2072 DumpEvent(0, UNLOCK, tid, pc, mu, 0); in Before_pthread_unlock()
2076 DumpEventWithSp(frame.sp, WRITER_LOCK, tid, frame.pc, frame.arg[0], 0); in After_pthread_mutex_lock()
2098 PinThread &t= g_pin_threads[tid]; in WRAP_NAME()
2103 DumpEvent(ctx, WRITER_LOCK, tid, pc, arg0, 0); in WRAP_NAME()
2110 DumpEvent(ctx, WRITER_LOCK, tid, pc, arg0, 0); in WRAP_NAME()
2116 DumpEvent(ctx, READER_LOCK, tid, pc, arg0, 0); in WRAP_NAME()
2123 DumpEvent(ctx, WRITER_LOCK, tid, pc, arg0, 0); in WRAP_NAME()
2130 DumpEvent(ctx, WRITER_LOCK, tid, pc, arg0, 0); in WRAP_NAME()
2135 DumpEvent(ctx, UNLOCK_OR_INIT, tid, pc, arg0, 0); in WRAP_NAME()
2140 DumpEvent(ctx, LOCK_DESTROY, tid, pc, arg0, 0); in WRAP_NAME()
2145 DumpEvent(ctx, UNLOCK_OR_INIT, tid, pc, arg0, 0); in WRAP_NAME()
2153 DumpEvent(ctx, WRITER_LOCK, tid, pc, arg0, 0); in WRAP_NAME()
2160 DumpEvent(ctx, READER_LOCK, tid, pc, arg0, 0); in WRAP_NAME()
2165 static void Before_pthread_mutex_init(THREADID tid, ADDRINT pc, ADDRINT mu) { in Before_pthread_mutex_init() argument
2166 DumpEvent(0, LOCK_CREATE, tid, pc, mu, 0); in Before_pthread_mutex_init()
2168 static void Before_pthread_rwlock_init(THREADID tid, ADDRINT pc, ADDRINT mu) { in Before_pthread_rwlock_init() argument
2169 DumpEvent(0, LOCK_CREATE, tid, pc, mu, 0); in Before_pthread_rwlock_init()
2172 static void Before_pthread_mutex_destroy(THREADID tid, ADDRINT pc, ADDRINT mu) { in Before_pthread_mutex_destroy() argument
2173 DumpEvent(0, LOCK_DESTROY, tid, pc, mu, 0); in Before_pthread_mutex_destroy()
2175 static void Before_pthread_rwlock_destroy(THREADID tid, ADDRINT pc, ADDRINT mu) { in Before_pthread_rwlock_destroy() argument
2176 DumpEvent(0, LOCK_DESTROY, tid, pc, mu, 0); in Before_pthread_rwlock_destroy()
2181 DumpEvent(ctx, CYCLIC_BARRIER_INIT, tid, pc, arg0, arg2); in WRAP_NAME()
2186 DumpEvent(ctx, CYCLIC_BARRIER_WAIT_BEFORE, tid, pc, arg0, 0); in WRAP_NAME()
2188 DumpEvent(ctx, CYCLIC_BARRIER_WAIT_AFTER, tid, pc, arg0, 0); in WRAP_NAME()
2194 static void Before_pthread_cond_signal(THREADID tid, ADDRINT pc, ADDRINT cv) { in Before_pthread_cond_signal() argument
2195 DumpEvent(0, SIGNAL, tid, pc, cv, 0); in Before_pthread_cond_signal()
2199 DumpEvent(ctx, UNLOCK, tid, pc, arg1, 0); in WRAP_NAME()
2201 DumpEvent(ctx, WAIT, tid, pc, arg0, 0); in WRAP_NAME()
2202 DumpEvent(ctx, WRITER_LOCK, tid, pc, arg1, 0); in WRAP_NAME()
2206 DumpEvent(ctx, UNLOCK, tid, pc, arg1, 0); in WRAP_NAME()
2209 DumpEvent(ctx, WAIT, tid, pc, arg0, 0); in WRAP_NAME()
2211 DumpEvent(ctx, WRITER_LOCK, tid, pc, arg1, 0); in WRAP_NAME()
2218 static void Before_epoll_ctl(THREADID tid, ADDRINT pc) { in Before_epoll_ctl() argument
2219 DumpEvent(0, SIGNAL, tid, pc, kSocketMagic, 0); in Before_epoll_ctl()
2222 static void After_epoll_wait(THREADID tid, ADDRINT pc) { in After_epoll_wait() argument
2223 DumpEvent(0, WAIT, tid, pc, kSocketMagic, 0); in After_epoll_wait()
2227 static void After_sem_open(THREADID tid, ADDRINT pc, ADDRINT ret) { in After_sem_open() argument
2229 DumpEvent(0, SIGNAL, tid, pc, ret, 0); in After_sem_open()
2231 static void Before_sem_post(THREADID tid, ADDRINT pc, ADDRINT sem) { in Before_sem_post() argument
2232 DumpEvent(0, SIGNAL, tid, pc, sem, 0); in Before_sem_post()
2237 DumpEvent(ctx, WAIT, tid, pc, arg0, 0); in WRAP_NAME()
2243 DumpEvent(ctx, WAIT, tid, pc, arg0, 0); in WRAP_NAME()
2252 DumpEvent(0, SIGNAL, tid, pc, kSocketMagic, 0); in WRAP_NAME()
2258 DumpEvent(0, WAIT, tid, pc, kSocketMagic, 0); in WRAP_NAME()
2266 static void On_AnnotateBenignRace(THREADID tid, ADDRINT pc, in On_AnnotateBenignRace() argument
2269 DumpEvent(0, BENIGN_RACE, tid, descr, a, 1); in On_AnnotateBenignRace()
2272 static void On_AnnotateBenignRaceSized(THREADID tid, ADDRINT pc, in On_AnnotateBenignRaceSized() argument
2275 DumpEvent(0, BENIGN_RACE, tid, descr, a, size); in On_AnnotateBenignRaceSized()
2278 static void On_AnnotateExpectRace(THREADID tid, ADDRINT pc, in On_AnnotateExpectRace() argument
2281 DumpEvent(0, EXPECT_RACE, tid, descr, a, 0); in On_AnnotateExpectRace()
2284 static void On_AnnotateFlushExpectedRaces(THREADID tid, ADDRINT pc, in On_AnnotateFlushExpectedRaces() argument
2290 static void On_AnnotateTraceMemory(THREADID tid, ADDRINT pc, in On_AnnotateTraceMemory() argument
2293 DumpEvent(0, TRACE_MEM, tid, pc, a, 0); in On_AnnotateTraceMemory()
2296 static void On_AnnotateNewMemory(THREADID tid, ADDRINT pc, in On_AnnotateNewMemory() argument
2299 DumpEvent(0, MALLOC, tid, pc, a, size); in On_AnnotateNewMemory()
2302 static void On_AnnotateNoOp(THREADID tid, ADDRINT pc, in On_AnnotateNoOp() argument
2304 Printf("%s T%d: %s:%d %p\n", __FUNCTION__, tid, (char*)file, (int)line, a); in On_AnnotateNoOp()
2309 static void On_AnnotateFlushState(THREADID tid, ADDRINT pc, in On_AnnotateFlushState() argument
2311 DumpEvent(0, FLUSH_STATE, tid, pc, 0, 0); in On_AnnotateFlushState()
2314 static void On_AnnotateCondVarSignal(THREADID tid, ADDRINT pc, in On_AnnotateCondVarSignal() argument
2316 DumpEvent(0, SIGNAL, tid, pc, obj, 0); in On_AnnotateCondVarSignal()
2319 static void On_AnnotateCondVarWait(THREADID tid, ADDRINT pc, in On_AnnotateCondVarWait() argument
2321 DumpEvent(0, WAIT, tid, pc, obj, 0); in On_AnnotateCondVarWait()
2324 static void On_AnnotateHappensBefore(THREADID tid, ADDRINT pc, in On_AnnotateHappensBefore() argument
2326 DumpEvent(0, SIGNAL, tid, pc, obj, 0); in On_AnnotateHappensBefore()
2329 static void On_AnnotateHappensAfter(THREADID tid, ADDRINT pc, in On_AnnotateHappensAfter() argument
2331 DumpEvent(0, WAIT, tid, pc, obj, 0); in On_AnnotateHappensAfter()
2334 static void On_AnnotateEnableRaceDetection(THREADID tid, ADDRINT pc, in On_AnnotateEnableRaceDetection() argument
2338 TLEBSimpleEvent(g_pin_threads[tid], in On_AnnotateEnableRaceDetection()
2342 static void On_AnnotateIgnoreReadsBegin(THREADID tid, ADDRINT pc, in On_AnnotateIgnoreReadsBegin() argument
2344 DumpEvent(0, IGNORE_READS_BEG, tid, pc, 0, 0); in On_AnnotateIgnoreReadsBegin()
2346 static void On_AnnotateIgnoreReadsEnd(THREADID tid, ADDRINT pc, in On_AnnotateIgnoreReadsEnd() argument
2348 DumpEvent(0, IGNORE_READS_END, tid, pc, 0, 0); in On_AnnotateIgnoreReadsEnd()
2350 static void On_AnnotateIgnoreWritesBegin(THREADID tid, ADDRINT pc, in On_AnnotateIgnoreWritesBegin() argument
2352 DumpEvent(0, IGNORE_WRITES_BEG, tid, pc, 0, 0); in On_AnnotateIgnoreWritesBegin()
2354 static void On_AnnotateIgnoreWritesEnd(THREADID tid, ADDRINT pc, in On_AnnotateIgnoreWritesEnd() argument
2356 DumpEvent(0, IGNORE_WRITES_END, tid, pc, 0, 0); in On_AnnotateIgnoreWritesEnd()
2358 static void On_AnnotateThreadName(THREADID tid, ADDRINT pc, in On_AnnotateThreadName() argument
2361 DumpEvent(0, SET_THREAD_NAME, tid, pc, name, 0); in On_AnnotateThreadName()
2363 static void On_AnnotatePublishMemoryRange(THREADID tid, ADDRINT pc, in On_AnnotatePublishMemoryRange() argument
2366 DumpEvent(0, PUBLISH_RANGE, tid, pc, a, size); in On_AnnotatePublishMemoryRange()
2369 static void On_AnnotateUnpublishMemoryRange(THREADID tid, ADDRINT pc, in On_AnnotateUnpublishMemoryRange() argument
2373 DumpEvent(0, UNPUBLISH_RANGE, tid, pc, a, size); in On_AnnotateUnpublishMemoryRange()
2377 static void On_AnnotateMutexIsUsedAsCondVar(THREADID tid, ADDRINT pc, in On_AnnotateMutexIsUsedAsCondVar() argument
2380 DumpEvent(0, HB_LOCK, tid, pc, mu, 0); in On_AnnotateMutexIsUsedAsCondVar()
2383 static void On_AnnotateMutexIsNotPhb(THREADID tid, ADDRINT pc, in On_AnnotateMutexIsNotPhb() argument
2386 DumpEvent(0, NON_HB_LOCK, tid, pc, mu, 0); in On_AnnotateMutexIsNotPhb()
2389 static void On_AnnotatePCQCreate(THREADID tid, ADDRINT pc, in On_AnnotatePCQCreate() argument
2392 DumpEvent(0, PCQ_CREATE, tid, pc, pcq, 0); in On_AnnotatePCQCreate()
2395 static void On_AnnotatePCQDestroy(THREADID tid, ADDRINT pc, in On_AnnotatePCQDestroy() argument
2398 DumpEvent(0, PCQ_DESTROY, tid, pc, pcq, 0); in On_AnnotatePCQDestroy()
2401 static void On_AnnotatePCQPut(THREADID tid, ADDRINT pc, in On_AnnotatePCQPut() argument
2404 DumpEvent(0, PCQ_PUT, tid, pc, pcq, 0); in On_AnnotatePCQPut()
2407 static void On_AnnotatePCQGet(THREADID tid, ADDRINT pc, in On_AnnotatePCQGet() argument
2410 DumpEvent(0, PCQ_GET, tid, pc, pcq, 0); in On_AnnotatePCQGet()
2413 static void On_AnnotateRWLockCreate(THREADID tid, ADDRINT pc, in On_AnnotateRWLockCreate() argument
2416 DumpEvent(0, LOCK_CREATE, tid, pc, lock, 0); in On_AnnotateRWLockCreate()
2419 static void On_AnnotateRWLockDestroy(THREADID tid, ADDRINT pc, in On_AnnotateRWLockDestroy() argument
2422 DumpEvent(0, LOCK_DESTROY, tid, pc, lock, 0); in On_AnnotateRWLockDestroy()
2425 static void On_AnnotateRWLockAcquired(THREADID tid, ADDRINT pc, in On_AnnotateRWLockAcquired() argument
2428 DumpEvent(0, is_w ? WRITER_LOCK : READER_LOCK, tid, pc, lock, 0); in On_AnnotateRWLockAcquired()
2431 static void On_AnnotateRWLockReleased(THREADID tid, ADDRINT pc, in On_AnnotateRWLockReleased() argument
2434 DumpEvent(0, UNLOCK, tid, pc, lock, 0); in On_AnnotateRWLockReleased()