[PATCH] D29103: [tsan] Properly describe GCD worker threads in reports

Dmitry Vyukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 07:09:49 PST 2017


dvyukov added inline comments.


================
Comment at: lib/tsan/rtl/tsan_report.cc:239
+  const char *thread_status = rt->running ? "running" : "finished";
+  if (rt->parent_tid == kInvalidTid) {
+    Printf(" (tid=%zu, %s) is a GCD worker thread\n", rt->os_id, thread_status);
----------------
This feels like an abuse of kInvalidTid.
Currently we just say that we don't know who is the parent of GCD threads on creation. Which looks legit. But now you are saying: if we don't know a parent of any thread, then it must be a GCD worker thread.

Please mark GCD worker threads more explicitly (either by introducing another special tid, or by marking them with a new flag).
tsan_report.cc is meant to be as dump as possible and just format what it receives. So preferably this should also be a new flag in ReportThread.


Repository:
  rL LLVM

https://reviews.llvm.org/D29103





More information about the llvm-commits mailing list