Home | History | Annotate | Download | only in tsan

Lines Matching refs:rtn

275     RTN rtn;
280 rtn = RTN_FindByAddress(pc);
282 if (RTN_Valid(rtn)) {
284 ? Demangle(RTN_Name(rtn).c_str())
285 : RTN_Name(rtn);
286 *img_name = IMG_Name(SEC_Img(RTN_Sec(rtn)));
296 RTN rtn = RTN_FindByAddress(pc);
297 if (RTN_Valid(rtn)) {
299 ? Demangle(RTN_Name(rtn).c_str())
300 : RTN_Name(rtn);
655 static void InformAboutFunctionWrap(RTN rtn, string name) {
659 RTN_Name(rtn).c_str(), IMG_Name(SEC_Img(RTN_Sec(rtn))).c_str());
712 #define WRAP4(name) WrapFunc4(img, rtn, #name, (AFUNPTR)Wrap_##name)
713 #define WRAPSTD1(name) WrapStdCallFunc1(rtn, #name, (AFUNPTR)Wrap_##name)
714 #define WRAPSTD2(name) WrapStdCallFunc2(rtn, #name, (AFUNPTR)Wrap_##name)
715 #define WRAPSTD3(name) WrapStdCallFunc3(rtn, #name, (AFUNPTR)Wrap_##name)
716 #define WRAPSTD4(name) WrapStdCallFunc4(rtn, #name, (AFUNPTR)Wrap_##name)
717 #define WRAPSTD5(name) WrapStdCallFunc5(rtn, #name, (AFUNPTR)Wrap_##name)
718 #define WRAPSTD6(name) WrapStdCallFunc6(rtn, #name, (AFUNPTR)Wrap_##name)
719 #define WRAPSTD7(name) WrapStdCallFunc7(rtn, #name, (AFUNPTR)Wrap_##name)
720 #define WRAPSTD8(name) WrapStdCallFunc8(rtn, #name, (AFUNPTR)Wrap_##name)
721 #define WRAPSTD10(name) WrapStdCallFunc10(rtn, #name, (AFUNPTR)Wrap_##name)
722 #define WRAPSTD11(name) WrapStdCallFunc11(rtn, #name, (AFUNPTR)Wrap_##name)
771 void ReplaceFunc3(IMG img, RTN rtn, const char *name, AFUNPTR replacement_func) {
772 if (RTN_Valid(rtn) && RtnMatchesName(RTN_Name(rtn), name)) {
773 InformAboutFunctionWrap(rtn, name);
781 RTN_ReplaceSignature(rtn,
795 void WrapFunc4(IMG img, RTN rtn, const char *name, AFUNPTR replacement_func) {
796 if (RTN_Valid(rtn) && RtnMatchesName(RTN_Name(rtn), name)) {
797 InformAboutFunctionWrap(rtn, name);
806 RTN_ReplaceSignature(rtn,
823 void WrapFunc6(IMG img, RTN rtn, const char *name, AFUNPTR replacement_func) {
824 if (RTN_Valid(rtn) && RtnMatchesName(RTN_Name(rtn), name)) {
825 InformAboutFunctionWrap(rtn, name);
836 RTN_ReplaceSignature(rtn,
2450 static bool IgnoreRtn(RTN rtn) {
2451 CHECK(rtn != RTN_Invalid());
2452 ADDRINT rtn_address = RTN_Address(rtn);
2489 static void InstrumentMopsInBBl(BBL bbl, RTN rtn, TraceInfo *trace_info, uintptr_t instrument_pc, size_t *mop_idx) {
2502 if (BBL_Address(bbl) - RTN_Address(rtn) <= max_offset_for_dtor_head) {
2503 string demangled_rtn_name = Demangle(RTN_Name(rtn).c_str());
2631 RTN rtn = TRACE_Rtn(trace);
2635 if (RTN_Valid(rtn)) {
2636 SEC sec = RTN_Sec(rtn);
2638 rtn_name = RTN_Name(rtn);
2644 } else if (IgnoreRtn(rtn)) {
2668 InstrumentMopsInBBl(bbl, rtn, NULL, instrument_pc, &n_mops);
2741 InstrumentMopsInBBl(bbl, rtn, trace_info, instrument_pc, &i);
2756 #define INSERT_FN_HELPER(point, name, rtn, to_insert, ...) \
2757 RTN_Open(rtn); \
2758 if (G_flags->verbosity >= 2) Printf("RTN: Inserting %-50s (%s) %s (%s) img: %s\n", \
2759 #to_insert, #point, RTN_Name(rtn).c_str(), name, IMG_Name(img).c_str());\
2760 RTN_InsertCall(rtn, point, (AFUNPTR)to_insert, IARG_THREAD_ID, \
2762 RTN_Close(rtn); \
2766 INSERT_FN_HELPER(point, name, rtn, to_insert, __VA_ARGS__); \
2838 void WrapStdCallFunc1(RTN rtn, char *name, AFUNPTR replacement_func) {
2839 if (RTN_Valid(rtn) && RtnMatchesName(RTN_Name(rtn), name)) {
2840 InformAboutFunctionWrap(rtn, name);
2846 RTN_ReplaceSignature(rtn,
2859 void WrapStdCallFunc2(RTN rtn, char *name, AFUNPTR replacement_func) {
2860 if (RTN_Valid(rtn) && RtnMatchesName(RTN_Name(rtn), name)) {
2861 InformAboutFunctionWrap(rtn, name);
2868 RTN_ReplaceSignature(rtn,
2882 void WrapStdCallFunc3(RTN rtn, char *name, AFUNPTR replacement_func) {
2883 if (RTN_Valid(rtn) && RtnMatchesName(RTN_Name(rtn), name)) {
2884 InformAboutFunctionWrap(rtn, name);
2892 RTN_ReplaceSignature(rtn,
2907 void WrapStdCallFunc4(RTN rtn, char *name, AFUNPTR replacement_func) {
2908 if (RTN_Valid(rtn) && RtnMatchesName(RTN_Name(rtn), name)) {
2909 InformAboutFunctionWrap(rtn, name);
2918 RTN_ReplaceSignature(rtn,
2934 void WrapStdCallFunc5(RTN rtn, char *name, AFUNPTR replacement_func) {
2935 if (RTN_Valid(rtn) && RtnMatchesName(RTN_Name(rtn), name)) {
2936 InformAboutFunctionWrap(rtn, name);
2946 RTN_ReplaceSignature(rtn,
2963 void WrapStdCallFunc6(RTN rtn, char *name, AFUNPTR replacement_func) {
2964 if (RTN_Valid(rtn) && RtnMatchesName(RTN_Name(rtn), name)) {
2965 InformAboutFunctionWrap(rtn, name);
2976 RTN_ReplaceSignature(rtn,
2994 void WrapStdCallFunc7(RTN rtn, char *name, AFUNPTR replacement_func) {
2995 if (RTN_Valid(rtn) && RtnMatchesName(RTN_Name(rtn), name)) {
2996 InformAboutFunctionWrap(rtn, name);
3008 RTN_ReplaceSignature(rtn,
3027 void WrapStdCallFunc8(RTN rtn, char *name, AFUNPTR replacement_func) {
3028 if (RTN_Valid(rtn) && RtnMatchesName(RTN_Name(rtn), name)) {
3029 InformAboutFunctionWrap(rtn, name);
3042 RTN_ReplaceSignature(rtn,
3062 void WrapStdCallFunc10(RTN rtn, char *name, AFUNPTR replacement_func) {
3063 if (RTN_Valid(rtn) && RtnMatchesName(RTN_Name(rtn), name)) {
3064 InformAboutFunctionWrap(rtn, name);
3079 RTN_ReplaceSignature(rtn,
3101 void WrapStdCallFunc11(RTN rtn, char *name, AFUNPTR replacement_func) {
3102 if (RTN_Valid(rtn) && RtnMatchesName(RTN_Name(rtn), name)) {
3103 InformAboutFunctionWrap(rtn, name);
3119 RTN_ReplaceSignature(rtn,
3144 static void MaybeInstrumentOneRoutine(IMG img, RTN rtn) {
3148 string rtn_name = RTN_Name(rtn);
3152 img_name.c_str(), RTN_Address(rtn));
3202 WrapFunc6(img, rtn, "mmap", (AFUNPTR)WRAP_NAME(mmap));
3203 WrapFunc4(img, rtn, "munmap", (AFUNPTR)WRAP_NAME(munmap));
3205 WrapFunc4(img, rtn, "lockf", (AFUNPTR)WRAP_NAME(lockf));
3207 WrapFunc4(img, rtn, "pthread_create", (AFUNPTR)WRAP_NAME(pthread_create));
3208 WrapFunc4(img, rtn, "pthread_join", (AFUNPTR)WRAP_NAME(pthread_join));
3209 WrapFunc4(img, rtn, "fwrite", (AFUNPTR)WRAP_NAME(fwrite));
3244 WrapFunc4(img, rtn, "pthread_barrier_init",
3246 WrapFunc4(img, rtn, "pthread_barrier_wait",
3250 WrapFunc4(img, rtn, "pthread_once", (AFUNPTR)WRAP_NAME(pthread_once));
3263 WrapStdCallFunc6(rtn, "CreateThread", (AFUNPTR)WRAP_NAME(CreateThread));
3298 WrapStdCallFunc1(rtn, "RtlRunOnceInitialize",
3320 WrapStdCallFunc4(rtn, "VirtualAlloc", (AFUNPTR)(WRAP_NAME(VirtualAlloc)));
3321 WrapStdCallFunc6(rtn, "ZwAllocateVirtualMemory", (AFUNPTR)(WRAP_NAME(ZwAllocateVirtualMemory)));
3322 WrapStdCallFunc2(rtn, "GlobalAlloc", (AFUNPTR)WRAP_NAME(GlobalAlloc));
3323 // WrapStdCallFunc3(rtn, "RtlAllocateHeap", (AFUNPTR) WRAP_NAME(AllocateHeap));
3324 // WrapStdCallFunc3(rtn, "HeapCreate", (AFUNPTR) WRAP_NAME(HeapCreate));
3368 WrapFunc4(img, rtn, "ThreadSanitizerQuery",
3370 WrapFunc4(img, rtn, "RunningOnValgrind",
3390 if (ThreadSanitizerWantToInstrumentSblock(RTN_Address(rtn))) {
3391 ReplaceFunc3(img, rtn, "memchr", (AFUNPTR)Replace_memchr);
3392 ReplaceFunc3(img, rtn, "strchr", (AFUNPTR)Replace_strchr);
3393 ReplaceFunc3(img, rtn, "index", (AFUNPTR)Replace_strchr);
3394 ReplaceFunc3(img, rtn, "strchrnul", (AFUNPTR)Replace_strchrnul);
3395 ReplaceFunc3(img, rtn, "strrchr", (AFUNPTR)Replace_strrchr);
3396 ReplaceFunc3(img, rtn, "rindex", (AFUNPTR)Replace_strrchr);
3397 ReplaceFunc3(img, rtn, "strlen", (AFUNPTR)Replace_strlen);
3398 ReplaceFunc3(img, rtn, "strcmp", (AFUNPTR)Replace_strcmp);
3399 ReplaceFunc3(img, rtn, "strncmp", (AFUNPTR)Replace_strncmp);
3400 ReplaceFunc3(img, rtn, "memcpy", (AFUNPTR)Replace_memcpy);
3401 ReplaceFunc3(img, rtn, "memcmp", (AFUNPTR)Replace_memcmp);
3402 ReplaceFunc3(img, rtn, "memmove", (AFUNPTR)Replace_memmove);
3403 ReplaceFunc3(img, rtn, "strcpy", (AFUNPTR)Replace_strcpy);
3404 ReplaceFunc3(img, rtn, "strncpy", (AFUNPTR)Replace_strncpy);
3405 ReplaceFunc3(img, rtn, "strcat", (AFUNPTR)Replace_strcat);
3406 ReplaceFunc3(img, rtn, "stpcpy", (AFUNPTR)Replace_stpcpy);
3426 for (RTN rtn = SEC_RtnHead(sec); RTN_Valid(rtn); rtn = RTN_Next(rtn)) {
3427 MaybeInstrumentOneRoutine(img, rtn);
3520 RTN rtn = TRACE_Rtn(trace);
3521 if (RTN_Valid(rtn)) {
3522 SEC sec = RTN_Sec(rtn);