forked from OSchip/llvm-project
tsan: improve Go report format + fix build
llvm-svn: 162042
This commit is contained in:
parent
a60c5ad819
commit
9f143c5c5f
|
@ -137,6 +137,7 @@ static void PrintStack(const ReportStack *ent) {
|
||||||
TsanPrintf(" %s()\n %s:%d +0x%zx\n",
|
TsanPrintf(" %s()\n %s:%d +0x%zx\n",
|
||||||
ent->func, ent->file, ent->line, (void*)ent->offset);
|
ent->func, ent->file, ent->line, (void*)ent->offset);
|
||||||
}
|
}
|
||||||
|
TsanPrintf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PrintMop(const ReportMop *mop, bool first) {
|
static void PrintMop(const ReportMop *mop, bool first) {
|
||||||
|
@ -157,7 +158,7 @@ static void PrintThread(const ReportThread *rt) {
|
||||||
|
|
||||||
void PrintReport(const ReportDesc *rep) {
|
void PrintReport(const ReportDesc *rep) {
|
||||||
TsanPrintf("==================\n");
|
TsanPrintf("==================\n");
|
||||||
TsanPrintf("WARNING: DATA RACE at %p\n", (void*)rep->mops[0]->addr);
|
TsanPrintf("WARNING: DATA RACE\n");
|
||||||
for (uptr i = 0; i < rep->mops.Size(); i++)
|
for (uptr i = 0; i < rep->mops.Size(); i++)
|
||||||
PrintMop(rep->mops[i], i == 0);
|
PrintMop(rep->mops[i], i == 0);
|
||||||
for (uptr i = 0; i < rep->threads.Size(); i++)
|
for (uptr i = 0; i < rep->threads.Size(); i++)
|
||||||
|
|
|
@ -164,7 +164,9 @@ void Initialize(ThreadState *thr) {
|
||||||
return;
|
return;
|
||||||
is_initialized = true;
|
is_initialized = true;
|
||||||
ScopedInRtl in_rtl;
|
ScopedInRtl in_rtl;
|
||||||
|
#ifndef TSAN_GO
|
||||||
InitializeAllocator();
|
InitializeAllocator();
|
||||||
|
#endif
|
||||||
InitializeInterceptors();
|
InitializeInterceptors();
|
||||||
const char *env = InitializePlatform();
|
const char *env = InitializePlatform();
|
||||||
InitializeMutex();
|
InitializeMutex();
|
||||||
|
|
|
@ -238,7 +238,9 @@ void ThreadFinish(ThreadState *thr) {
|
||||||
}
|
}
|
||||||
tctx->epoch1 = thr->fast_state.epoch();
|
tctx->epoch1 = thr->fast_state.epoch();
|
||||||
|
|
||||||
|
#ifndef TSAN_GO
|
||||||
AlloctorThreadFinish(thr);
|
AlloctorThreadFinish(thr);
|
||||||
|
#endif
|
||||||
thr->~ThreadState();
|
thr->~ThreadState();
|
||||||
StatAggregate(ctx->stat, thr->stat);
|
StatAggregate(ctx->stat, thr->stat);
|
||||||
tctx->thr = 0;
|
tctx->thr = 0;
|
||||||
|
|
Loading…
Reference in New Issue