forked from OSchip/llvm-project
tsan: allow to suppress all reports
Fixes issue https://code.google.com/p/thread-sanitizer/issues/detail?id=45 llvm-svn: 207218
This commit is contained in:
parent
9ba7762d7f
commit
edae43b0a9
|
@ -629,7 +629,7 @@ void ForkChildAfter(ThreadState *thr, uptr pc);
|
||||||
void ReportRace(ThreadState *thr);
|
void ReportRace(ThreadState *thr);
|
||||||
bool OutputReport(Context *ctx,
|
bool OutputReport(Context *ctx,
|
||||||
const ScopedReport &srep,
|
const ScopedReport &srep,
|
||||||
const ReportStack *suppress_stack1 = 0,
|
const ReportStack *suppress_stack1,
|
||||||
const ReportStack *suppress_stack2 = 0,
|
const ReportStack *suppress_stack2 = 0,
|
||||||
const ReportLocation *suppress_loc = 0);
|
const ReportLocation *suppress_loc = 0);
|
||||||
bool IsFiredSuppression(Context *ctx,
|
bool IsFiredSuppression(Context *ctx,
|
||||||
|
|
|
@ -59,7 +59,7 @@ static void ReportMutexMisuse(ThreadState *thr, uptr pc, ReportType typ,
|
||||||
trace.ObtainCurrent(thr, pc);
|
trace.ObtainCurrent(thr, pc);
|
||||||
rep.AddStack(&trace);
|
rep.AddStack(&trace);
|
||||||
rep.AddLocation(addr, 1);
|
rep.AddLocation(addr, 1);
|
||||||
OutputReport(ctx, rep);
|
OutputReport(ctx, rep, rep.GetReport()->stacks[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MutexCreate(ThreadState *thr, uptr pc, uptr addr,
|
void MutexCreate(ThreadState *thr, uptr pc, uptr addr,
|
||||||
|
@ -115,7 +115,7 @@ void MutexDestroy(ThreadState *thr, uptr pc, uptr addr) {
|
||||||
RestoreStack(last.tid(), last.epoch(), &trace, 0);
|
RestoreStack(last.tid(), last.epoch(), &trace, 0);
|
||||||
rep.AddStack(&trace);
|
rep.AddStack(&trace);
|
||||||
rep.AddLocation(s->addr, 1);
|
rep.AddLocation(s->addr, 1);
|
||||||
OutputReport(ctx, rep);
|
OutputReport(ctx, rep, rep.GetReport()->stacks[0]);
|
||||||
}
|
}
|
||||||
thr->mset.Remove(s->GetId());
|
thr->mset.Remove(s->GetId());
|
||||||
DestroyAndFree(s);
|
DestroyAndFree(s);
|
||||||
|
|
|
@ -207,7 +207,7 @@ void ThreadFinalize(ThreadState *thr) {
|
||||||
ScopedReport rep(ReportTypeThreadLeak);
|
ScopedReport rep(ReportTypeThreadLeak);
|
||||||
rep.AddThread(leaks[i].tctx);
|
rep.AddThread(leaks[i].tctx);
|
||||||
rep.SetCount(leaks[i].count);
|
rep.SetCount(leaks[i].count);
|
||||||
OutputReport(ctx, rep);
|
OutputReport(ctx, rep, rep.GetReport()->threads[0]->stack);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,6 +103,14 @@ SuppressionType conv(ReportType typ) {
|
||||||
return SuppressionThread;
|
return SuppressionThread;
|
||||||
else if (typ == ReportTypeMutexDestroyLocked)
|
else if (typ == ReportTypeMutexDestroyLocked)
|
||||||
return SuppressionMutex;
|
return SuppressionMutex;
|
||||||
|
else if (typ == ReportTypeMutexDoubleLock)
|
||||||
|
return SuppressionMutex;
|
||||||
|
else if (typ == ReportTypeMutexBadUnlock)
|
||||||
|
return SuppressionMutex;
|
||||||
|
else if (typ == ReportTypeMutexBadReadLock)
|
||||||
|
return SuppressionMutex;
|
||||||
|
else if (typ == ReportTypeMutexBadReadUnlock)
|
||||||
|
return SuppressionMutex;
|
||||||
else if (typ == ReportTypeSignalUnsafe)
|
else if (typ == ReportTypeSignalUnsafe)
|
||||||
return SuppressionSignal;
|
return SuppressionSignal;
|
||||||
else if (typ == ReportTypeErrnoInSignal)
|
else if (typ == ReportTypeErrnoInSignal)
|
||||||
|
|
Loading…
Reference in New Issue