diff options
| author | Alexander Potapenko <glider@google.com> | 2014-03-31 10:46:07 +0000 |
|---|---|---|
| committer | Alexander Potapenko <glider@google.com> | 2014-03-31 10:46:07 +0000 |
| commit | 0426176940fd832f9c583ec91e5c104abf21bfb0 (patch) | |
| tree | 2b2eb32595d56176e76aa6479d3917552592df3c /compiler-rt | |
| parent | 241856e5f850c1e1ba6a1e821da9a87349655b5a (diff) | |
| download | bcm5719-llvm-0426176940fd832f9c583ec91e5c104abf21bfb0.tar.gz bcm5719-llvm-0426176940fd832f9c583ec91e5c104abf21bfb0.zip | |
[TSan] Replace several Printf() calls with Report() to ease debugging.
llvm-svn: 205175
Diffstat (limited to 'compiler-rt')
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_interceptors.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc b/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc index 27515b8333e..3913941be11 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc @@ -204,7 +204,7 @@ ScopedInterceptor::~ScopedInterceptor() { #define SCOPED_TSAN_INTERCEPTOR(func, ...) \ SCOPED_INTERCEPTOR_RAW(func, __VA_ARGS__); \ if (REAL(func) == 0) { \ - Printf("FATAL: ThreadSanitizer: failed to intercept %s\n", #func); \ + Report("FATAL: ThreadSanitizer: failed to intercept %s\n", #func); \ Die(); \ } \ if (thr->ignore_interceptors || thr->in_ignored_lib) \ @@ -851,13 +851,13 @@ TSAN_INTERCEPTOR(int, pthread_create, SCOPED_INTERCEPTOR_RAW(pthread_create, th, attr, callback, param); if (ctx->after_multithreaded_fork) { if (flags()->die_after_fork) { - Printf("ThreadSanitizer: starting new threads after muti-threaded" - " fork is not supported. Dying (set die_after_fork=0 to override)\n"); + Report("ThreadSanitizer: starting new threads after multi-threaded " + "fork is not supported. Dying (set die_after_fork=0 to override)\n"); Die(); } else { - VPrintf(1, "ThreadSanitizer: starting new threads after muti-threaded" - " fork is not supported. Continuing because die_after_fork=0," - " but you are on your own\n"); + VPrintf(1, "ThreadSanitizer: starting new threads after multi-threaded " + "fork is not supported (pid %d). Continuing because of " + "die_after_fork=0, but you are on your own\n", internal_getpid()); } } __sanitizer_pthread_attr_t myattr; @@ -1906,6 +1906,7 @@ TSAN_INTERCEPTOR(int, fork, int fake) { if (cur_thread()->in_symbolizer) return REAL(fork)(fake); SCOPED_INTERCEPTOR_RAW(fork, fake); + Report("Thread %d is about to fork\n", GetTid()); ForkBefore(thr, pc); int pid = REAL(fork)(fake); if (pid == 0) { @@ -2151,7 +2152,7 @@ static void finalize(void *arg) { } static void unreachable() { - Printf("FATAL: ThreadSanitizer: unreachable called\n"); + Report("FATAL: ThreadSanitizer: unreachable called\n"); Die(); } |

