summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_printf.cc
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2015-07-22 23:57:19 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2015-07-22 23:57:19 +0000
commit721ddfa27c67f3225fb652709259c36ad887bfb7 (patch)
treea9b4334e312ca07c3f8b23e44d078cf08237facf /lib/sanitizer_common/sanitizer_printf.cc
parentdadee370bdbbb7ae3482f32a39e81519cbb78148 (diff)
[sanitizer] Implement logging to syslog.
Previously, Android target had a logic of duplicating all sanitizer output to logcat. This change extends it to all posix platforms via the use of syslog, controlled by log_to_syslog flag. Enabled by default on Android, off everywhere else. A bit of cmake magic is required to allow Printf() to call a libc function. I'm adding a stub implementation to support no-libc builds like dfsan and safestack. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@242975 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_printf.cc')
-rw-r--r--lib/sanitizer_common/sanitizer_printf.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_printf.cc b/lib/sanitizer_common/sanitizer_printf.cc
index e4f67f5e0..7a71722eb 100644
--- a/lib/sanitizer_common/sanitizer_printf.cc
+++ b/lib/sanitizer_common/sanitizer_printf.cc
@@ -279,7 +279,8 @@ static void SharedPrintfCode(bool append_pid, const char *format,
# undef CHECK_NEEDED_LENGTH
}
RawWrite(buffer);
- AndroidLogWrite(buffer);
+ if (common_flags()->log_to_syslog)
+ WriteToSyslog(buffer);
CallPrintfAndReportCallback(buffer);
// If we had mapped any memory, clean up.
if (buffer != local_buffer)