tsan: output goroutine creation stack

llvm-svn: 160670
This commit is contained in:
Dmitry Vyukov 2012-07-24 12:03:47 +00:00
parent 3397013606
commit 69bee8d8f6
1 changed files with 10 additions and 0 deletions

View File

@ -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");
} }