summaryrefslogtreecommitdiffstats
path: root/compiler-rt
diff options
context:
space:
mode:
authorKuba Mracek <mracek@apple.com>2018-01-04 02:28:51 +0000
committerKuba Mracek <mracek@apple.com>2018-01-04 02:28:51 +0000
commit773be7b496ebc367dee432e52e55915c1a8546d7 (patch)
tree08e3a522285317bfad0d1ba64343139821de37f7 /compiler-rt
parentb6ec4a33fb2b6e9ea9bb5ace211504113fbe64a1 (diff)
downloadbcm5719-llvm-773be7b496ebc367dee432e52e55915c1a8546d7.tar.gz
bcm5719-llvm-773be7b496ebc367dee432e52e55915c1a8546d7.zip
[tsan] Separate the constants in libignore and bump the maximum for instrumented libraries
We're having some use cases where we have more than 128 (the current maximum) instrumented dynamic libraries loaded into a single process. Let's bump the limit to 1024, and separate the constants. Differential Revision: https://reviews.llvm.org/D41190 llvm-svn: 321782
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc4
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_libignore.h8
2 files changed, 7 insertions, 5 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc b/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc
index 0df055edae9..b36c0ae4eb2 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc
@@ -80,7 +80,7 @@ void LibIgnore::OnLibraryLoaded(const char *name) {
lib->name = internal_strdup(mod.full_name());
const uptr idx =
atomic_load(&ignored_ranges_count_, memory_order_relaxed);
- CHECK_LT(idx, kMaxLibs);
+ CHECK_LT(idx, ARRAY_SIZE(ignored_code_ranges_));
ignored_code_ranges_[idx].begin = range.beg;
ignored_code_ranges_[idx].end = range.end;
atomic_store(&ignored_ranges_count_, idx + 1, memory_order_release);
@@ -109,7 +109,7 @@ void LibIgnore::OnLibraryLoaded(const char *name) {
range.beg, range.end, mod.full_name());
const uptr idx =
atomic_load(&instrumented_ranges_count_, memory_order_relaxed);
- CHECK_LT(idx, kMaxLibs);
+ CHECK_LT(idx, ARRAY_SIZE(instrumented_code_ranges_));
instrumented_code_ranges_[idx].begin = range.beg;
instrumented_code_ranges_[idx].end = range.end;
atomic_store(&instrumented_ranges_count_, idx + 1,
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_libignore.h b/compiler-rt/lib/sanitizer_common/sanitizer_libignore.h
index 17b0f563d47..49967b1e8d2 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_libignore.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_libignore.h
@@ -66,14 +66,16 @@ class LibIgnore {
return (pc >= range.begin && pc < range.end);
}
- static const uptr kMaxLibs = 128;
+ static const uptr kMaxIgnoredRanges = 128;
+ static const uptr kMaxInstrumentedRanges = 1024;
+ static const uptr kMaxLibs = 1024;
// Hot part:
atomic_uintptr_t ignored_ranges_count_;
- LibCodeRange ignored_code_ranges_[kMaxLibs];
+ LibCodeRange ignored_code_ranges_[kMaxIgnoredRanges];
atomic_uintptr_t instrumented_ranges_count_;
- LibCodeRange instrumented_code_ranges_[kMaxLibs];
+ LibCodeRange instrumented_code_ranges_[kMaxInstrumentedRanges];
// Cold part:
BlockingMutex mutex_;
OpenPOWER on IntegriCloud