diff options
author | Yury Gribov <y.gribov@samsung.com> | 2014-11-13 16:01:23 +0000 |
---|---|---|
committer | Yury Gribov <y.gribov@samsung.com> | 2014-11-13 16:01:23 +0000 |
commit | 38ac0e035fd702a0f8e726f5bcf652541ba05205 (patch) | |
tree | f9ce4a9fb12cd008c233481df242de33eee03f6a /lib/sanitizer_common/sanitizer_printf.cc | |
parent | 77cbd5f398e0bb43c0873e6990da779a5e327e30 (diff) |
[ASan] Add process basename to log name and error message to simplify analysis of sanitized systems logs.
Reviewed at http://reviews.llvm.org/D5724
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221896 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_printf.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_printf.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sanitizer_common/sanitizer_printf.cc b/lib/sanitizer_common/sanitizer_printf.cc index 3be6723cd..ca0704cde 100644 --- a/lib/sanitizer_common/sanitizer_printf.cc +++ b/lib/sanitizer_common/sanitizer_printf.cc @@ -253,9 +253,11 @@ static void SharedPrintfCode(bool append_pid, const char *format, needed_length = 0; if (append_pid) { int pid = internal_getpid(); - needed_length += internal_snprintf(buffer, buffer_size, "==%d==", pid); + const char *pname = StripModuleName(GetBinaryName()); + needed_length += internal_snprintf(buffer, buffer_size, + "==%s %d==", pname, pid); if (needed_length >= buffer_size) { - // The pid doesn't fit into the current buffer. + // Process name + pid do not fit into the current buffer. if (!use_mmap) continue; RAW_CHECK_MSG(needed_length < kLen, "Buffer in Report is too short!\n"); |