[llvm-commits] [compiler-rt] r160670 - /compiler-rt/trunk/lib/tsan/rtl/tsan_report.cc

Dmitry Vyukov dvyukov at google.com
Tue Jul 24 05:03:47 PDT 2012


Author: dvyukov
Date: Tue Jul 24 07:03:47 2012
New Revision: 160670

URL: http://llvm.org/viewvc/llvm-project?rev=160670&view=rev
Log:
tsan: output goroutine creation stack

Modified:
    compiler-rt/trunk/lib/tsan/rtl/tsan_report.cc

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_report.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_report.cc?rev=160670&r1=160669&r2=160670&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_report.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_report.cc Tue Jul 24 07:03:47 2012
@@ -144,11 +144,21 @@
   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");
 }
 





More information about the llvm-commits mailing list