Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 1 | //===-- tsan_flags.h --------------------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file is a part of ThreadSanitizer (TSan), a race detector. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef TSAN_FLAGS_H |
| 15 | #define TSAN_FLAGS_H |
| 16 | |
| 17 | namespace __tsan { |
| 18 | |
| 19 | struct Flags { |
| 20 | // Enable dynamic annotations, otherwise they are no-ops. |
| 21 | bool enable_annotations; |
| 22 | // Supress a race report if we've already output another race report |
| 23 | // with the same stack. |
| 24 | bool suppress_equal_stacks; |
| 25 | // Supress a race report if we've already output another race report |
| 26 | // on the same address. |
| 27 | bool suppress_equal_addresses; |
| 28 | // Report thread leaks at exit? |
| 29 | bool report_thread_leaks; |
| 30 | // Report violations of async signal-safety |
| 31 | // (e.g. malloc() call from a signal handler). |
| 32 | bool report_signal_unsafe; |
| 33 | // If set, all atomics are effectively sequentially consistent (seq_cst), |
| 34 | // regardless of what user actually specified. |
| 35 | bool force_seq_cst_atomics; |
| 36 | // Strip that prefix from file paths in reports. |
| 37 | const char *strip_path_prefix; |
| 38 | // Suppressions filename. |
| 39 | const char *suppressions; |
| 40 | // Override exit status if something was reported. |
| 41 | int exitcode; |
| 42 | // Log fileno (1 - stdout, 2 - stderr). |
| 43 | int log_fileno; |
| 44 | // Sleep in main thread before exiting for that many ms |
| 45 | // (useful to catch "at exit" races). |
| 46 | int atexit_sleep_ms; |
| 47 | // Verbosity level (0 - silent, 1 - a bit of output, 2+ - more output). |
| 48 | int verbosity; |
Dmitry Vyukov | 2612773 | 2012-05-22 11:33:03 +0000 | [diff] [blame^] | 49 | // If set, periodically write memory profile to that file. |
| 50 | const char *profile_memory; |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 51 | }; |
| 52 | |
| 53 | Flags *flags(); |
| 54 | void InitializeFlags(Flags *flags, const char *env); |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | #endif // TSAN_FLAGS_H |