Lines Matching refs:thr

349   ValgrindThread *thr = &g_valgrind_threads[vg_tid];
350 g_cur_tleb = thr->tleb;
353 INLINE void FlushMops(ValgrindThread *thr, bool keep_trace_info = false) {
355 TraceInfo *t = thr->trace_info;
358 thr->trace_info = NULL;
361 if (global_ignore || thr->ignore_accesses ||
362 (thr->literace_sampling &&
363 t->LiteRaceSkipTraceRealTid(thr->zero_based_uniq_tid, thr->literace_sampling))) {
364 thr->trace_info = NULL;
370 uintptr_t *tleb = thr->tleb;
371 DCHECK(thr->ts_thread);
372 ThreadSanitizerHandleTrace(thr->ts_thread, t, tleb);
375 static void ShowCallStack(ValgrindThread *thr) {
376 size_t n = thr->call_stack.size();
379 Printf("{pc=%p sp=%p}, ", thr->call_stack[i].pc, thr->call_stack[i].sp);
384 static INLINE void UpdateCallStack(ValgrindThread *thr, uintptr_t sp) {
386 if (thr->trace_info) FlushMops(thr, true /* keep_trace_info */);
387 vector<CallStackRecord> &call_stack = thr->call_stack;
393 int32_t ts_tid = thr->zero_based_uniq_tid;
397 ts_tid, thr->call_stack.size(), record.pc,
400 ShowCallStack(thr);
411 ValgrindThread *thr = &g_valgrind_threads[vg_tid];
414 if (thr->trace_info) {
415 FlushMops(thr);
418 UpdateCallStack(thr, GetVgSp(vg_tid));
422 uintptr_t *tleb = thr->tleb;
425 thr->trace_info = trace_info;
426 DCHECK(thr->trace_info);
427 DCHECK(thr->trace_info->n_mops() <= kMaxMopsPerTrace);
442 ValgrindThread *thr = &g_valgrind_threads[vg_tid];
443 int ts_tid = thr->zero_based_uniq_tid;
447 UpdateCallStack(thr, record.sp);
451 thr->call_stack.push_back(record);
454 DCHECK(thr->call_stack.size() < 10000);
456 if (thr->trace_info) FlushMops(thr);
462 ts_tid, thr->call_stack.size(), (void*)record.pc,
465 ShowCallStack(thr);
492 ValgrindThread *thr = &g_valgrind_threads[vg_tid];
493 if (thr->trace_info) FlushMops(thr);
494 vector<CallStackRecord> &call_stack = thr->call_stack;
518 ValgrindThread *thr = &g_valgrind_threads[child];
520 if (thr->zero_based_uniq_tid != -1) {
524 thr->Clear();
525 thr->zero_based_uniq_tid = g_uniq_thread_id_counter++;
529 thr->ts_thread = ThreadSanitizerGetThreadByTid(thr->zero_based_uniq_tid);
530 CHECK(thr->ts_thread);
536 ValgrindThread *thr = &g_valgrind_threads[vg_tid];
537 FlushMops(thr);
542 ValgrindThread *thr = &g_valgrind_threads[vg_tid];
543 FlushMops(thr);
553 ValgrindThread *thr = &g_valgrind_threads[quit_tid];
554 FlushMops(thr);
593 ValgrindThread *thr = &g_valgrind_threads[vg_tid];
594 if (thr->trace_info) FlushMops(thr);
595 UpdateCallStack(thr, GetVgSp(vg_tid));
838 ValgrindThread *thr = &g_valgrind_threads[vg_tid];
840 // thr->trace_info is the trace info for the previous superblock.
841 if (!thr->trace_info)
845 if (!thr->verifier_current_pc) {
848 int sleep_time_ms = RaceVerifierGetSleepTime(thr->trace_info->pc());
850 thr->trace_info = NULL;
853 size_t n = thr->trace_info->n_mops();
854 uintptr_t* tleb = thr->tleb;
859 MopInfo *mop = thr->trace_info->GetMop(i);
860 need_sleep += RaceVerifierStartAccess(thr->zero_based_uniq_tid, addr,
865 thr->verifier_current_pc = thr->trace_info->pc();
868 thr->verifier_wakeup_time_ms = now + sleep_time_ms;
871 thr->verifier_current_pc = (unsigned)-1;
876 DCHECK(thr->verifier_current_pc == thr->trace_info->pc());
878 if (now < thr->verifier_wakeup_time_ms) {
883 thr->verifier_current_pc = (unsigned)-1;
898 ValgrindThread *thr = &g_valgrind_threads[vg_tid];
900 DCHECK(!thr->trace_info || thr->verifier_current_pc == (unsigned)-1);
901 thr->verifier_current_pc = 0;
902 thr->verifier_wakeup_time_ms = 0;
904 if (thr->trace_info) {
906 size_t n = thr->trace_info->n_mops();
907 uintptr_t* tleb = thr->tleb;
911 MopInfo *mop = thr->trace_info->GetMop(i);
912 RaceVerifierEndAccess(thr->zero_based_uniq_tid, addr,
919 thr->trace_info = trace_info;
922 uintptr_t *tleb = thr->tleb;
925 DCHECK(thr->trace_info->n_mops() <= kMaxMopsPerTrace);