[compiler-rt] r197512 - [lsan] Remove the LSan-specific verbosity flag.
Sergey Matveev
earthdok at google.com
Tue Dec 17 10:18:33 PST 2013
Author: smatveev
Date: Tue Dec 17 12:18:32 2013
New Revision: 197512
URL: http://llvm.org/viewvc/llvm-project?rev=197512&view=rev
Log:
[lsan] Remove the LSan-specific verbosity flag.
It conflicted with the verbosity flag we had in common flags. We don't need an
LSan-specific flag anyway.
Also, shift some logging levels and remove some unnecessary code.
Modified:
compiler-rt/trunk/lib/lsan/lit_tests/TestCases/ignore_object.cc
compiler-rt/trunk/lib/lsan/lit_tests/TestCases/ignore_object_errors.cc
compiler-rt/trunk/lib/lsan/lsan_common.cc
compiler-rt/trunk/lib/lsan/lsan_common.h
Modified: compiler-rt/trunk/lib/lsan/lit_tests/TestCases/ignore_object.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lit_tests/TestCases/ignore_object.cc?rev=197512&r1=197511&r2=197512&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lit_tests/TestCases/ignore_object.cc (original)
+++ compiler-rt/trunk/lib/lsan/lit_tests/TestCases/ignore_object.cc Tue Dec 17 12:18:32 2013
@@ -1,7 +1,7 @@
// Test for __lsan_ignore_object().
-// RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=0:use_globals=0:use_tls=0:verbosity=3"
+// RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=0:use_globals=0:use_tls=0:verbosity=2"
// RUN: %clangxx_lsan %s -o %t
-// RUN: LSAN_OPTIONS=$LSAN_BASE not %t 2>&1 | FileCheck %s
+// RUN: LSAN_OPTIONS=$LSAN_BASE ASAN_OPTIONS=$ASAN_OPTIONS:"verbosity=2" not %t 2>&1 | FileCheck %s
#include <stdio.h>
#include <stdlib.h>
@@ -9,12 +9,6 @@
#include "sanitizer/lsan_interface.h"
int main() {
- {
- // The first malloc call can cause an allocation in libdl. Ignore it here so
- // it doesn't show up in our output.
- __lsan::ScopedDisabler d;
- malloc(1);
- }
// Explicitly ignored object.
void **p = new void *;
// Transitively ignored object.
Modified: compiler-rt/trunk/lib/lsan/lit_tests/TestCases/ignore_object_errors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lit_tests/TestCases/ignore_object_errors.cc?rev=197512&r1=197511&r2=197512&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lit_tests/TestCases/ignore_object_errors.cc (original)
+++ compiler-rt/trunk/lib/lsan/lit_tests/TestCases/ignore_object_errors.cc Tue Dec 17 12:18:32 2013
@@ -1,7 +1,7 @@
// Test for incorrect use of __lsan_ignore_object().
// RUN: LSAN_BASE="verbosity=2"
// RUN: %clangxx_lsan %s -o %t
-// RUN: LSAN_OPTIONS=$LSAN_BASE %t 2>&1 | FileCheck %s
+// RUN: LSAN_OPTIONS=$LSAN_BASE ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=2 %t 2>&1 | FileCheck %s
#include <stdio.h>
#include <stdlib.h>
Modified: compiler-rt/trunk/lib/lsan/lsan_common.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lsan_common.cc?rev=197512&r1=197511&r2=197512&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lsan_common.cc (original)
+++ compiler-rt/trunk/lib/lsan/lsan_common.cc Tue Dec 17 12:18:32 2013
@@ -52,7 +52,6 @@ static void InitializeFlags() {
f->use_root_regions = true;
f->use_unaligned = false;
f->use_poisoned = false;
- f->verbosity = 0;
f->log_pointers = false;
f->log_threads = false;
@@ -70,7 +69,6 @@ static void InitializeFlags() {
CHECK_GE(&f->resolution, 0);
ParseFlag(options, &f->max_leaks, "max_leaks");
CHECK_GE(&f->max_leaks, 0);
- ParseFlag(options, &f->verbosity, "verbosity");
ParseFlag(options, &f->log_pointers, "log_pointers");
ParseFlag(options, &f->log_threads, "log_threads");
ParseFlag(options, &f->exitcode, "exitcode");
@@ -614,13 +612,13 @@ void __lsan_ignore_object(const void *p)
// locked.
BlockingMutexLock l(&global_mutex);
IgnoreObjectResult res = IgnoreObjectLocked(p);
- if (res == kIgnoreObjectInvalid && flags()->verbosity >= 2)
- Report("__lsan_ignore_object(): no heap object found at %p", p);
- if (res == kIgnoreObjectAlreadyIgnored && flags()->verbosity >= 2)
- Report("__lsan_ignore_object(): "
+ if (res == kIgnoreObjectInvalid)
+ VReport(1, "__lsan_ignore_object(): no heap object found at %p", p);
+ if (res == kIgnoreObjectAlreadyIgnored)
+ VReport(1, "__lsan_ignore_object(): "
"heap object at %p is already being ignored\n", p);
- if (res == kIgnoreObjectSuccess && flags()->verbosity >= 3)
- Report("__lsan_ignore_object(): ignoring heap object at %p\n", p);
+ if (res == kIgnoreObjectSuccess)
+ VReport(1, "__lsan_ignore_object(): ignoring heap object at %p\n", p);
#endif // CAN_SANITIZE_LEAKS
}
@@ -631,8 +629,7 @@ void __lsan_register_root_region(const v
CHECK(root_regions);
RootRegion region = {begin, size};
root_regions->push_back(region);
- if (flags()->verbosity)
- Report("Registered root region at %p of size %llu\n", begin, size);
+ VReport(1, "Registered root region at %p of size %llu\n", begin, size);
#endif // CAN_SANITIZE_LEAKS
}
@@ -649,8 +646,7 @@ void __lsan_unregister_root_region(const
uptr last_index = root_regions->size() - 1;
(*root_regions)[i] = (*root_regions)[last_index];
root_regions->pop_back();
- if (flags()->verbosity)
- Report("Unregistered root region at %p of size %llu\n", begin, size);
+ VReport(1, "Unregistered root region at %p of size %llu\n", begin, size);
break;
}
}
Modified: compiler-rt/trunk/lib/lsan/lsan_common.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lsan_common.h?rev=197512&r1=197511&r2=197512&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lsan_common.h (original)
+++ compiler-rt/trunk/lib/lsan/lsan_common.h Tue Dec 17 12:18:32 2013
@@ -73,9 +73,6 @@ struct Flags {
// Consider pointers found in poisoned memory to be valid.
bool use_poisoned;
- // User-visible verbosity.
- int verbosity;
-
// Debug logging.
bool log_pointers;
bool log_threads;
More information about the llvm-commits
mailing list