diff options
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_printf.cc | 8 | ||||
-rw-r--r-- | compiler-rt/test/sanitizer_common/TestCases/Linux/vreport.cc | 23 |
2 files changed, 4 insertions, 27 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_printf.cc b/compiler-rt/lib/sanitizer_common/sanitizer_printf.cc index f81e15357e8..520206441b5 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_printf.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_printf.cc @@ -257,15 +257,15 @@ static void NOINLINE SharedPrintfCodeNoBuffer(bool append_pid, "Buffer in Report is too short!\n"); \ } if (append_pid) { + int pid = internal_getpid(); const char *exe_name = GetProcessName(); if (common_flags()->log_exe_name && exe_name) { needed_length += internal_snprintf(buffer, buffer_size, "==%s", exe_name); CHECK_NEEDED_LENGTH } - needed_length += - internal_snprintf(buffer + needed_length, buffer_size - needed_length, - "==%d:%d==", internal_getpid(), GetTid()); + needed_length += internal_snprintf( + buffer + needed_length, buffer_size - needed_length, "==%d==", pid); CHECK_NEEDED_LENGTH } needed_length += VSNPrintf(buffer + needed_length, @@ -307,7 +307,7 @@ void Printf(const char *format, ...) { va_end(args); } -// Like Printf, but prints the current PID:TID before the output string. +// Like Printf, but prints the current PID before the output string. FORMAT(1, 2) void Report(const char *format, ...) { va_list args; diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/vreport.cc b/compiler-rt/test/sanitizer_common/TestCases/Linux/vreport.cc deleted file mode 100644 index 2357932ff45..00000000000 --- a/compiler-rt/test/sanitizer_common/TestCases/Linux/vreport.cc +++ /dev/null @@ -1,23 +0,0 @@ -// RUN: %clangxx -O0 %s -o %t && %env_tool_opts=verbosity=10 %run %t 2>&1 | FileCheck %s - -#include <pthread.h> -#include <stdio.h> -#include <sys/syscall.h> -#include <unistd.h> - -void *thread(void *unused) { - printf("PID: %d\n", getpid()); - printf("TID: %ld\n", syscall(SYS_gettid)); - fflush(stdout); - return 0; -} - -int main() { - pthread_t t; - pthread_create(&t, 0, thread, 0); - pthread_join(t, 0); - return 0; -} -// CHECK: PID: [[PID:[0-9]+]] -// CHECK: TID: [[TID:[0-9]+]] -// CHECK: ==[[PID]]:[[TID]]== |