parent
3397013606
commit
69bee8d8f6
|
@ -144,11 +144,21 @@ static void PrintMop(const ReportMop *mop, bool first) {
|
||||||
PrintStack(mop->stack);
|
PrintStack(mop->stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void PrintThread(const ReportThread *rt) {
|
||||||
|
if (rt->id == 0) // Little sense in describing the main thread.
|
||||||
|
return;
|
||||||
|
TsanPrintf("Goroutine %d (%s) created at:\n",
|
||||||
|
rt->id, rt->running ? "running" : "finished");
|
||||||
|
PrintStack(rt->stack);
|
||||||
|
}
|
||||||
|
|
||||||
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 at %p\n", (void*)rep->mops[0]->addr);
|
||||||
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++)
|
||||||
|
PrintThread(rep->threads[i]);
|
||||||
TsanPrintf("==================\n");
|
TsanPrintf("==================\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue