[PATCH] D21982: WIP: Implement a per-thread inmemory log

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 15 01:15:33 PDT 2016


dberris added a comment.

This is still not ready, but the patch we're dependent on is ready (https://reviews.llvm.org/D21612). I will continue to iterate on this to clean it up a bit more, and add more useful information into the head of the log to help with things like figuring out how much walltime elapsed between two TSC ticks where the binary was run, a version identifier for the log, etc.


================
Comment at: lib/xray/xray_inmemory_log.cc:73
@@ +72,3 @@
+      fprintf(stderr, "Failed to write; errno = %d", errno);
+      return;
+    }
----------------
Link I can find: http://linux.die.net/man/2/write

It says pretty much that it will only return 0 if the size provided was 0. I don't know why anybody would do that, but I guess the API allows it so there's a special case for that. :)

================
Comment at: lib/xray/xray_inmemory_log.cc:123
@@ +122,3 @@
+    printf("XRay: Log file in '%s'\n", TmpFilename);
+    return Fd;
+  }();
----------------
Yeah, I think a better way of doing this is to provide the log file base name as a flag (with a sane default, maybe synthesized as "/tmp/<pid>.xray"), then that means we don't need to write it out unless we're being verbose.


https://reviews.llvm.org/D21982





More information about the llvm-commits mailing list