[compiler-rt] r192705 - tsan: use verbosity flag in sanitizer_common code directly
Dmitry Vyukov
dvyukov at google.com
Tue Oct 15 07:12:26 PDT 2013
Author: dvyukov
Date: Tue Oct 15 09:12:26 2013
New Revision: 192705
URL: http://llvm.org/viewvc/llvm-project?rev=192705&view=rev
Log:
tsan: use verbosity flag in sanitizer_common code directly
now it's available from common_flags()
Modified:
compiler-rt/trunk/lib/lsan/lsan_interceptors.cc
compiler-rt/trunk/lib/msan/msan_interceptors.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.h
compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc
compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
Modified: compiler-rt/trunk/lib/lsan/lsan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lsan_interceptors.cc?rev=192705&r1=192704&r2=192705&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lsan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/lsan/lsan_interceptors.cc Tue Oct 15 09:12:26 2013
@@ -221,7 +221,7 @@ INTERCEPTOR(int, pthread_create, void *t
pthread_attr_init(&myattr);
attr = &myattr;
}
- AdjustStackSizeLinux(attr, 0);
+ AdjustStackSizeLinux(attr);
int detached = 0;
pthread_attr_getdetachstate(attr, &detached);
ThreadParam p;
Modified: compiler-rt/trunk/lib/msan/msan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_interceptors.cc?rev=192705&r1=192704&r2=192705&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/msan/msan_interceptors.cc Tue Oct 15 09:12:26 2013
@@ -1082,7 +1082,7 @@ INTERCEPTOR(int, pthread_create, void *t
attr = &myattr;
}
- AdjustStackSizeLinux(attr, common_flags()->verbosity);
+ AdjustStackSizeLinux(attr);
int res = REAL(pthread_create)(th, attr, callback, param);
if (attr == &myattr)
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.h?rev=192705&r1=192704&r2=192705&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.h Tue Oct 15 09:12:26 2013
@@ -66,7 +66,7 @@ class ThreadLister {
int bytes_read_;
};
-void AdjustStackSizeLinux(void *attr, int verbosity);
+void AdjustStackSizeLinux(void *attr);
// Exposed for testing.
uptr ThreadDescriptorSize();
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc?rev=192705&r1=192704&r2=192705&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc Tue Oct 15 09:12:26 2013
@@ -16,6 +16,7 @@
#if SANITIZER_LINUX
#include "sanitizer_common.h"
+#include "sanitizer_flags.h"
#include "sanitizer_linux.h"
#include "sanitizer_placement_new.h"
#include "sanitizer_procmaps.h"
@@ -272,7 +273,7 @@ void GetThreadStackAndTls(bool main, upt
#endif // SANITIZER_GO
}
-void AdjustStackSizeLinux(void *attr_, int verbosity) {
+void AdjustStackSizeLinux(void *attr_) {
pthread_attr_t *attr = (pthread_attr_t *)attr_;
uptr stackaddr = 0;
size_t stacksize = 0;
@@ -284,7 +285,7 @@ void AdjustStackSizeLinux(void *attr_, i
const uptr minstacksize = GetTlsSize() + 128*1024;
if (stacksize < minstacksize) {
if (!stack_set) {
- if (verbosity && stacksize != 0)
+ if (common_flags()->verbosity && stacksize != 0)
Printf("Sanitizer: increasing stacksize %zu->%zu\n", stacksize,
minstacksize);
pthread_attr_setstacksize(attr, minstacksize);
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=192705&r1=192704&r2=192705&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Tue Oct 15 09:12:26 2013
@@ -882,13 +882,7 @@ TSAN_INTERCEPTOR(int, pthread_create,
}
int detached = 0;
pthread_attr_getdetachstate(attr, &detached);
-
-#if defined(TSAN_DEBUG_OUTPUT)
- int verbosity = (TSAN_DEBUG_OUTPUT);
-#else
- int verbosity = 0;
-#endif
- AdjustStackSizeLinux(attr, verbosity);
+ AdjustStackSizeLinux(attr);
ThreadParam p;
p.callback = callback;
More information about the llvm-commits
mailing list