Index: projects/compiler-rt/lib/sanitizer_common/sanitizer_file.cc =================================================================== --- projects/compiler-rt/lib/sanitizer_common/sanitizer_file.cc +++ projects/compiler-rt/lib/sanitizer_common/sanitizer_file.cc @@ -59,6 +59,9 @@ } else { internal_snprintf(full_path, kMaxPathLength, "%s.%zu", path_prefix, pid); } + if (common_flags()->log_suffix) { + internal_strlcat(full_path, common_flags()->log_suffix, kMaxPathLength); + } fd = OpenFile(full_path, WrOnly); if (fd == kInvalidFd) { const char *ErrorMsgPrefix = "ERROR: Can't open file: "; Index: projects/compiler-rt/lib/sanitizer_common/sanitizer_flags.inc =================================================================== --- projects/compiler-rt/lib/sanitizer_common/sanitizer_flags.inc +++ projects/compiler-rt/lib/sanitizer_common/sanitizer_flags.inc @@ -56,6 +56,9 @@ "Mention name of executable when reporting error and " "append executable name to logs (as in \"log_path.exe_name.pid\").") COMMON_FLAG( + const char *, log_suffix, nullptr, + "String to append to log file name, e.g. \".txt\".") +COMMON_FLAG( bool, log_to_syslog, SANITIZER_ANDROID || SANITIZER_MAC, "Write all sanitizer output to syslog in addition to other means of " "logging.")