diff options
author | wmi <wmi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-22 22:03:11 +0000 |
---|---|---|
committer | wmi <wmi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-22 22:03:11 +0000 |
commit | 9cf754572854d9d9cd43c277eb7afb12e4911358 (patch) | |
tree | f83ad11b95452b47f813e942d24914f31a50394e /libsanitizer/tsan/tsan_flags.h | |
parent | b077695d9e39a87da6f8bc68451a9d60467e7020 (diff) | |
download | gcc-9cf754572854d9d9cd43c277eb7afb12e4911358.tar.gz |
libsanitizer/
* tsan: New directory. Import tsan runtime from llvm.
* configure.ac: Add 64 bits tsan build.
* Makefile.am: Likewise.
* configure: Regenerated.
* Makefile.in: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193737 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libsanitizer/tsan/tsan_flags.h')
-rw-r--r-- | libsanitizer/tsan/tsan_flags.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/libsanitizer/tsan/tsan_flags.h b/libsanitizer/tsan/tsan_flags.h new file mode 100644 index 00000000000..a6310e3ce6c --- /dev/null +++ b/libsanitizer/tsan/tsan_flags.h @@ -0,0 +1,71 @@ +//===-- tsan_flags.h --------------------------------------------*- C++ -*-===// +// +// 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. +// NOTE: This file may be included into user code. +//===----------------------------------------------------------------------===// + +#ifndef TSAN_FLAGS_H +#define TSAN_FLAGS_H + +// ----------- ATTENTION ------------- +// ThreadSanitizer user may provide its implementation of weak +// symbol __tsan::OverrideFlags(__tsan::Flags). Therefore, this +// header may be included in the user code, and shouldn't include +// other headers from TSan or common sanitizer runtime. + +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 destruction of a locked mutex? + bool report_destroy_locked; + // 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; + // If set, periodically write memory profile to that file. + const char *profile_memory; + // Flush shadow memory every X ms. + int flush_memory_ms; + // Stops on start until __tsan_resume() is called (for debugging). + bool stop_on_start; + // Controls whether RunningOnValgrind() returns true or false. + bool running_on_valgrind; + // Path to external symbolizer. + const char *external_symbolizer_path; +}; + +Flags *flags(); +void InitializeFlags(Flags *flags, const char *env); +} + +#endif // TSAN_FLAGS_H |