[PATCH] D11435: [sanitizer] Implement logging to syslog

Alexey Samsonov vonosmas at gmail.com
Wed Jul 22 16:49:20 PDT 2015


samsonov accepted this revision.
samsonov added a comment.
This revision is now accepted and ready to land.

LGTM with a couple of nits.


================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:18
@@ -17,3 +17,3 @@
 
 #include "sanitizer_allocator_internal.h"
 #include "sanitizer_common.h"
----------------
You can now remove this include.

================
Comment at: lib/sanitizer_common/sanitizer_posix_libcdep.cc:295
@@ +294,3 @@
+
+static void WriteOneLineToSyslog(const char *s) {
+  if (atomic_load(&android_log_initialized, memory_order_acquire))
----------------
Note that if `android_log_initialized` will be initialized while you are looping inside `WriteToSyslog`, the latter will start logging since the middle of the `buffer`, which is probably undesirable. Yeah, I know that it's highly unlikely, but you may still add `static bool IsSyslogAvailable()`, and call it once at the beginning of `WriteToSyslog`.


http://reviews.llvm.org/D11435







More information about the llvm-commits mailing list