[PATCH] D16176: Introduce stats and stats_client libraries.
Evgeniy Stepanov via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 14 11:51:45 PST 2016
eugenis added inline comments.
================
Comment at: lib/stats/stats.cc:49
@@ +48,3 @@
+ return;
+ if (!stats_fd) {
+ InternalScopedBuffer<char> path(kMaxPathLength);
----------------
This lazy file opening just complicates things. Maybe move to a separate function and call it from WriteFullReport ?
================
Comment at: lib/stats/stats_client.cc:12
@@ +11,3 @@
+// or DSO) and registers statistics with the process.
+//
+//===----------------------------------------------------------------------===//
----------------
Please mention that it is intended to be linked into each individual module, and that it can not use the sanitizer_common infrastructure.
================
Comment at: lib/stats/stats_client.cc:94
@@ +93,3 @@
+ reg_func_t reg_func = reinterpret_cast<reg_func_t>(
+ LookupSymbolFromMain("__sanitizer_stats_register"));
+ if (reg_func)
----------------
Why dlsym and not just declare an external function and call it directly?
================
Comment at: test/cfi/stats.cpp:1
@@ +1,2 @@
+// RUN: %clangxx_cfi -g -fsanitize-stats -o %t %s
+// RUN: env SANITIZER_STATS_PATH=%t.stats %t
----------------
Does this work with the cross-dso mode?
http://reviews.llvm.org/D16176
More information about the llvm-commits
mailing list