[PATCH] D16176: Introduce stats and stats_client libraries.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 14 16:21:46 PST 2016


pcc added inline comments.

================
Comment at: lib/stats/stats.cc:40
@@ +39,3 @@
+  WriteToFile(fd, chars, sizeof(uptr));
+}
+
----------------
It doesn't matter, this will never be more than 8.

================
Comment at: lib/stats/stats.cc:47
@@ +46,3 @@
+  if (!stats_fd) {
+    InternalScopedBuffer<char> path(kMaxPathLength);
+    SubstituteForFlagValue(path_env, path.data(), kMaxPathLength);
----------------
Added a CHECK.

================
Comment at: lib/stats/stats_client.cc:80
@@ +79,2 @@
+    Trap();
+}
----------------
This won't work on Windows where DSOs can't directly call into the main executable.

================
Comment at: test/cfi/stats.cpp:2
@@ +1,3 @@
+// RUN: %clangxx_cfi -g -fsanitize-stats -o %t %s
+// RUN: env SANITIZER_STATS_PATH=%t.stats %t
+// RUN: sanstats %t.stats | FileCheck %s
----------------
Almost; this initially gave duplicate symbol errors. To avoid a combinatorial explosion in the number of static sanitizer libraries I decided to start improving how we link them. First step: link stats without `-whole-archive`, and use `-u` to pull in the stats runtime. Also added an integration test here.


http://reviews.llvm.org/D16176





More information about the llvm-commits mailing list