[PATCH] [sanitizer] Fix log_path behavior with StopTheWorld.

Alexey Samsonov samsonov at google.com
Wed Dec 4 01:07:45 PST 2013



================
Comment at: lib/sanitizer_common/sanitizer_common.cc:47
@@ +46,3 @@
+// main process, but has a different PID and thus requires special handling.
+uptr tracer_report_fd_pid = 0;
+
----------------
The naming is now confusing. Can you use smth. like stoptheworld_tracer_pid? Or, assuming you never use the value of this global anyway, can you have a boolean "is_in_stoptheworld_tracer"?

================
Comment at: lib/sanitizer_common/sanitizer_posix.cc:201
@@ -200,2 +200,3 @@
 void MaybeOpenReportFile() {
-  if (!log_to_file || (report_fd_pid == internal_getpid())) return;
+  uptr pid = internal_getpid();
+  // If in tracer, use the parent's file.
----------------
You can exit early if log_to_file is false.


http://llvm-reviews.chandlerc.com/D2306



More information about the llvm-commits mailing list