Daily bump.
[official-gcc.git] / libsanitizer / tsan / tsan_flags.h
blob4bf459d59817251234f764f003c05b53544dc631
1 //===-- tsan_flags.h --------------------------------------------*- C++ -*-===//
2 //
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
5 //
6 //===----------------------------------------------------------------------===//
7 //
8 // This file is a part of ThreadSanitizer (TSan), a race detector.
9 // NOTE: This file may be included into user code.
10 //===----------------------------------------------------------------------===//
12 #ifndef TSAN_FLAGS_H
13 #define TSAN_FLAGS_H
15 #include "sanitizer_common/sanitizer_flags.h"
16 #include "sanitizer_common/sanitizer_deadlock_detector_interface.h"
18 namespace __tsan {
20 struct Flags : CommonFlags, DDFlags {
21 // Enable dynamic annotations, otherwise they are no-ops.
22 bool enable_annotations;
23 // Suppress a race report if we've already output another race report
24 // with the same stack.
25 bool suppress_equal_stacks;
26 // Suppress a race report if we've already output another race report
27 // on the same address.
28 bool suppress_equal_addresses;
29 // Suppress weird race reports that can be seen if JVM is embed
30 // into the process.
31 bool suppress_java;
32 // Turns off bug reporting entirely (useful for benchmarking).
33 bool report_bugs;
34 // Report thread leaks at exit?
35 bool report_thread_leaks;
36 // Report destruction of a locked mutex?
37 bool report_destroy_locked;
38 // Report incorrect usages of mutexes and mutex annotations?
39 bool report_mutex_bugs;
40 // Report violations of async signal-safety
41 // (e.g. malloc() call from a signal handler).
42 bool report_signal_unsafe;
43 // Report races between atomic and plain memory accesses.
44 bool report_atomic_races;
45 // If set, all atomics are effectively sequentially consistent (seq_cst),
46 // regardless of what user actually specified.
47 bool force_seq_cst_atomics;
48 // Suppressions filename.
49 const char *suppressions;
50 // Print matched suppressions at exit.
51 bool print_suppressions;
52 // Print matched "benign" races at exit.
53 bool print_benign;
54 // Override exit status if something was reported.
55 int exitcode;
56 // Exit after first reported error.
57 bool halt_on_error;
58 // Sleep in main thread before exiting for that many ms
59 // (useful to catch "at exit" races).
60 int atexit_sleep_ms;
61 // If set, periodically write memory profile to that file.
62 const char *profile_memory;
63 // Flush shadow memory every X ms.
64 int flush_memory_ms;
65 // Flush symbolizer caches every X ms.
66 int flush_symbolizer_ms;
67 // Resident memory limit in MB to aim at.
68 // If the process consumes more memory, then TSan will flush shadow memory.
69 int memory_limit_mb;
70 // Stops on start until __tsan_resume() is called (for debugging).
71 bool stop_on_start;
72 // Controls whether RunningOnValgrind() returns true or false.
73 bool running_on_valgrind;
74 // Per-thread history size, controls how many previous memory accesses
75 // are remembered per thread. Possible values are [0..7].
76 // history_size=0 amounts to 32K memory accesses. Each next value doubles
77 // the amount of memory accesses, up to history_size=7 that amounts to
78 // 4M memory accesses. The default value is 2 (128K memory accesses).
79 int history_size;
80 // Controls level of synchronization implied by IO operations.
81 // 0 - no synchronization
82 // 1 - reasonable level of synchronization (write->read)
83 // 2 - global synchronization of all IO operations
84 int io_sync;
85 // Die after multi-threaded fork if the child creates new threads.
86 bool die_after_fork;
89 Flags *flags();
90 void InitializeFlags(Flags *flags, const char *env);
91 } // namespace __tsan
93 #endif // TSAN_FLAGS_H