diff --git a/compiler-rt/lib/tsan/rtl/tsan_report.cc b/compiler-rt/lib/tsan/rtl/tsan_report.cc index a4aca6679726..a83f7b70b163 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_report.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_report.cc @@ -144,11 +144,21 @@ static void PrintMop(const ReportMop *mop, bool first) { 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) { TsanPrintf("==================\n"); TsanPrintf("WARNING: DATA RACE at %p\n", (void*)rep->mops[0]->addr); for (uptr i = 0; i < rep->mops.Size(); i++) PrintMop(rep->mops[i], i == 0); + for (uptr i = 0; i < rep->threads.Size(); i++) + PrintThread(rep->threads[i]); TsanPrintf("==================\n"); }