summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl/tsan_flags.h
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2012-05-10 13:48:04 +0000
committerKostya Serebryany <kcc@google.com>2012-05-10 13:48:04 +0000
commit4ad375f0a931b918d1c1c95c60ed852751e19de6 (patch)
treeb3c260f1e1d707e843e6aaa2e47f91d51465c698 /compiler-rt/lib/tsan/rtl/tsan_flags.h
parent1a653970175988f5e21c13b7b763ccbbcc7779f3 (diff)
downloadbcm5719-llvm-4ad375f0a931b918d1c1c95c60ed852751e19de6.tar.gz
bcm5719-llvm-4ad375f0a931b918d1c1c95c60ed852751e19de6.zip
[tsan] First commit of ThreadSanitizer (TSan) run-time library.
Algorithm description: http://code.google.com/p/thread-sanitizer/wiki/ThreadSanitizerAlgorithm Status: The tool is known to work on large real-life applications, but still has quite a few rough edges. Nothing is guaranteed yet. The tool works on x86_64 Linux. Support for 64-bit MacOS 10.7+ is planned for late 2012. Support for 32-bit OSes is doable, but problematic and not yet planed. Further commits coming: - tests - makefiles - documentation - clang driver patch The code was previously developed at http://code.google.com/p/data-race-test/source/browse/trunk/v2/ by Dmitry Vyukov and Kostya Serebryany with contributions from Timur Iskhodzhanov, Alexander Potapenko, Alexey Samsonov and Evgeniy Stepanov. llvm-svn: 156542
Diffstat (limited to 'compiler-rt/lib/tsan/rtl/tsan_flags.h')
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_flags.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_flags.h b/compiler-rt/lib/tsan/rtl/tsan_flags.h
new file mode 100644
index 00000000000..1bad405a6fd
--- /dev/null
+++ b/compiler-rt/lib/tsan/rtl/tsan_flags.h
@@ -0,0 +1,56 @@
+//===-- tsan_flags.h --------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is a part of ThreadSanitizer (TSan), a race detector.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef TSAN_FLAGS_H
+#define TSAN_FLAGS_H
+
+namespace __tsan {
+
+struct Flags {
+ // Enable dynamic annotations, otherwise they are no-ops.
+ bool enable_annotations;
+ // Supress a race report if we've already output another race report
+ // with the same stack.
+ bool suppress_equal_stacks;
+ // Supress a race report if we've already output another race report
+ // on the same address.
+ bool suppress_equal_addresses;
+ // Report thread leaks at exit?
+ bool report_thread_leaks;
+ // Report violations of async signal-safety
+ // (e.g. malloc() call from a signal handler).
+ bool report_signal_unsafe;
+ // If set, all atomics are effectively sequentially consistent (seq_cst),
+ // regardless of what user actually specified.
+ bool force_seq_cst_atomics;
+ // Strip that prefix from file paths in reports.
+ const char *strip_path_prefix;
+ // Suppressions filename.
+ const char *suppressions;
+ // Override exit status if something was reported.
+ int exitcode;
+ // Log fileno (1 - stdout, 2 - stderr).
+ int log_fileno;
+ // Sleep in main thread before exiting for that many ms
+ // (useful to catch "at exit" races).
+ int atexit_sleep_ms;
+ // Verbosity level (0 - silent, 1 - a bit of output, 2+ - more output).
+ int verbosity;
+};
+
+Flags *flags();
+void InitializeFlags(Flags *flags, const char *env);
+void FinalizeFlags(Flags *flags);
+}
+
+#endif // TSAN_FLAGS_H
OpenPOWER on IntegriCloud