annotate libsanitizer/tsan/tsan_flags.inc @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 //===-- tsan_flags.inc ------------------------------------------*- C++ -*-===//
kono
parents:
diff changeset
2 //
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
4 // See https://llvm.org/LICENSE.txt for license information.
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
111
kono
parents:
diff changeset
6 //
kono
parents:
diff changeset
7 //===----------------------------------------------------------------------===//
kono
parents:
diff changeset
8 //
kono
parents:
diff changeset
9 // TSan runtime flags.
kono
parents:
diff changeset
10 //
kono
parents:
diff changeset
11 //===----------------------------------------------------------------------===//
kono
parents:
diff changeset
12 #ifndef TSAN_FLAG
kono
parents:
diff changeset
13 # error "Define TSAN_FLAG prior to including this file!"
kono
parents:
diff changeset
14 #endif
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 // TSAN_FLAG(Type, Name, DefaultValue, Description)
kono
parents:
diff changeset
17 // See COMMON_FLAG in sanitizer_flags.inc for more details.
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 TSAN_FLAG(bool, enable_annotations, true,
kono
parents:
diff changeset
20 "Enable dynamic annotations, otherwise they are no-ops.")
kono
parents:
diff changeset
21 // Suppress a race report if we've already output another race report
kono
parents:
diff changeset
22 // with the same stack.
kono
parents:
diff changeset
23 TSAN_FLAG(bool, suppress_equal_stacks, true,
kono
parents:
diff changeset
24 "Suppress a race report if we've already output another race report "
kono
parents:
diff changeset
25 "with the same stack.")
kono
parents:
diff changeset
26 TSAN_FLAG(bool, suppress_equal_addresses, true,
kono
parents:
diff changeset
27 "Suppress a race report if we've already output another race report "
kono
parents:
diff changeset
28 "on the same address.")
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 TSAN_FLAG(bool, report_bugs, true,
kono
parents:
diff changeset
31 "Turns off bug reporting entirely (useful for benchmarking).")
kono
parents:
diff changeset
32 TSAN_FLAG(bool, report_thread_leaks, true, "Report thread leaks at exit?")
kono
parents:
diff changeset
33 TSAN_FLAG(bool, report_destroy_locked, true,
kono
parents:
diff changeset
34 "Report destruction of a locked mutex?")
kono
parents:
diff changeset
35 TSAN_FLAG(bool, report_mutex_bugs, true,
kono
parents:
diff changeset
36 "Report incorrect usages of mutexes and mutex annotations?")
kono
parents:
diff changeset
37 TSAN_FLAG(bool, report_signal_unsafe, true,
kono
parents:
diff changeset
38 "Report violations of async signal-safety "
kono
parents:
diff changeset
39 "(e.g. malloc() call from a signal handler).")
kono
parents:
diff changeset
40 TSAN_FLAG(bool, report_atomic_races, true,
kono
parents:
diff changeset
41 "Report races between atomic and plain memory accesses.")
kono
parents:
diff changeset
42 TSAN_FLAG(
kono
parents:
diff changeset
43 bool, force_seq_cst_atomics, false,
kono
parents:
diff changeset
44 "If set, all atomics are effectively sequentially consistent (seq_cst), "
kono
parents:
diff changeset
45 "regardless of what user actually specified.")
kono
parents:
diff changeset
46 TSAN_FLAG(bool, print_benign, false, "Print matched \"benign\" races at exit.")
kono
parents:
diff changeset
47 TSAN_FLAG(bool, halt_on_error, false, "Exit after first reported error.")
kono
parents:
diff changeset
48 TSAN_FLAG(int, atexit_sleep_ms, 1000,
kono
parents:
diff changeset
49 "Sleep in main thread before exiting for that many ms "
kono
parents:
diff changeset
50 "(useful to catch \"at exit\" races).")
kono
parents:
diff changeset
51 TSAN_FLAG(const char *, profile_memory, "",
kono
parents:
diff changeset
52 "If set, periodically write memory profile to that file.")
kono
parents:
diff changeset
53 TSAN_FLAG(int, flush_memory_ms, 0, "Flush shadow memory every X ms.")
kono
parents:
diff changeset
54 TSAN_FLAG(int, flush_symbolizer_ms, 5000, "Flush symbolizer caches every X ms.")
kono
parents:
diff changeset
55 TSAN_FLAG(
kono
parents:
diff changeset
56 int, memory_limit_mb, 0,
kono
parents:
diff changeset
57 "Resident memory limit in MB to aim at."
kono
parents:
diff changeset
58 "If the process consumes more memory, then TSan will flush shadow memory.")
kono
parents:
diff changeset
59 TSAN_FLAG(bool, stop_on_start, false,
kono
parents:
diff changeset
60 "Stops on start until __tsan_resume() is called (for debugging).")
kono
parents:
diff changeset
61 TSAN_FLAG(bool, running_on_valgrind, false,
kono
parents:
diff changeset
62 "Controls whether RunningOnValgrind() returns true or false.")
kono
parents:
diff changeset
63 // There are a lot of goroutines in Go, so we use smaller history.
kono
parents:
diff changeset
64 TSAN_FLAG(
kono
parents:
diff changeset
65 int, history_size, SANITIZER_GO ? 1 : 3,
kono
parents:
diff changeset
66 "Per-thread history size, controls how many previous memory accesses "
kono
parents:
diff changeset
67 "are remembered per thread. Possible values are [0..7]. "
kono
parents:
diff changeset
68 "history_size=0 amounts to 32K memory accesses. Each next value doubles "
kono
parents:
diff changeset
69 "the amount of memory accesses, up to history_size=7 that amounts to "
kono
parents:
diff changeset
70 "4M memory accesses. The default value is 2 (128K memory accesses).")
kono
parents:
diff changeset
71 TSAN_FLAG(int, io_sync, 1,
kono
parents:
diff changeset
72 "Controls level of synchronization implied by IO operations. "
kono
parents:
diff changeset
73 "0 - no synchronization "
kono
parents:
diff changeset
74 "1 - reasonable level of synchronization (write->read)"
kono
parents:
diff changeset
75 "2 - global synchronization of all IO operations.")
kono
parents:
diff changeset
76 TSAN_FLAG(bool, die_after_fork, true,
kono
parents:
diff changeset
77 "Die after multi-threaded fork if the child creates new threads.")
kono
parents:
diff changeset
78 TSAN_FLAG(const char *, suppressions, "", "Suppressions file name.")
kono
parents:
diff changeset
79 TSAN_FLAG(bool, ignore_noninstrumented_modules, SANITIZER_MAC ? true : false,
kono
parents:
diff changeset
80 "Interceptors should only detect races when called from instrumented "
kono
parents:
diff changeset
81 "modules.")
kono
parents:
diff changeset
82 TSAN_FLAG(bool, shared_ptr_interceptor, true,
kono
parents:
diff changeset
83 "Track atomic reference counting in libc++ shared_ptr and weak_ptr.")