xref: /aosp_15_r20/external/compiler-rt/lib/tsan/rtl/tsan_flags.inc (revision 7c3d14c8b49c529e04be81a3ce6f5cc23712e4c6)
1*7c3d14c8STreehugger Robot//===-- tsan_flags.inc ------------------------------------------*- C++ -*-===//
2*7c3d14c8STreehugger Robot//
3*7c3d14c8STreehugger Robot//                     The LLVM Compiler Infrastructure
4*7c3d14c8STreehugger Robot//
5*7c3d14c8STreehugger Robot// This file is distributed under the University of Illinois Open Source
6*7c3d14c8STreehugger Robot// License. See LICENSE.TXT for details.
7*7c3d14c8STreehugger Robot//
8*7c3d14c8STreehugger Robot//===----------------------------------------------------------------------===//
9*7c3d14c8STreehugger Robot//
10*7c3d14c8STreehugger Robot// TSan runtime flags.
11*7c3d14c8STreehugger Robot//
12*7c3d14c8STreehugger Robot//===----------------------------------------------------------------------===//
13*7c3d14c8STreehugger Robot#ifndef TSAN_FLAG
14*7c3d14c8STreehugger Robot# error "Define TSAN_FLAG prior to including this file!"
15*7c3d14c8STreehugger Robot#endif
16*7c3d14c8STreehugger Robot
17*7c3d14c8STreehugger Robot// TSAN_FLAG(Type, Name, DefaultValue, Description)
18*7c3d14c8STreehugger Robot// See COMMON_FLAG in sanitizer_flags.inc for more details.
19*7c3d14c8STreehugger Robot
20*7c3d14c8STreehugger RobotTSAN_FLAG(bool, enable_annotations, true,
21*7c3d14c8STreehugger Robot          "Enable dynamic annotations, otherwise they are no-ops.")
22*7c3d14c8STreehugger Robot// Suppress a race report if we've already output another race report
23*7c3d14c8STreehugger Robot// with the same stack.
24*7c3d14c8STreehugger RobotTSAN_FLAG(bool, suppress_equal_stacks, true,
25*7c3d14c8STreehugger Robot          "Suppress a race report if we've already output another race report "
26*7c3d14c8STreehugger Robot          "with the same stack.")
27*7c3d14c8STreehugger RobotTSAN_FLAG(bool, suppress_equal_addresses, true,
28*7c3d14c8STreehugger Robot          "Suppress a race report if we've already output another race report "
29*7c3d14c8STreehugger Robot          "on the same address.")
30*7c3d14c8STreehugger Robot
31*7c3d14c8STreehugger RobotTSAN_FLAG(bool, report_bugs, true,
32*7c3d14c8STreehugger Robot          "Turns off bug reporting entirely (useful for benchmarking).")
33*7c3d14c8STreehugger RobotTSAN_FLAG(bool, report_thread_leaks, true, "Report thread leaks at exit?")
34*7c3d14c8STreehugger RobotTSAN_FLAG(bool, report_destroy_locked, true,
35*7c3d14c8STreehugger Robot          "Report destruction of a locked mutex?")
36*7c3d14c8STreehugger RobotTSAN_FLAG(bool, report_mutex_bugs, true,
37*7c3d14c8STreehugger Robot          "Report incorrect usages of mutexes and mutex annotations?")
38*7c3d14c8STreehugger RobotTSAN_FLAG(bool, report_signal_unsafe, true,
39*7c3d14c8STreehugger Robot          "Report violations of async signal-safety "
40*7c3d14c8STreehugger Robot          "(e.g. malloc() call from a signal handler).")
41*7c3d14c8STreehugger RobotTSAN_FLAG(bool, report_atomic_races, true,
42*7c3d14c8STreehugger Robot          "Report races between atomic and plain memory accesses.")
43*7c3d14c8STreehugger RobotTSAN_FLAG(
44*7c3d14c8STreehugger Robot    bool, force_seq_cst_atomics, false,
45*7c3d14c8STreehugger Robot    "If set, all atomics are effectively sequentially consistent (seq_cst), "
46*7c3d14c8STreehugger Robot    "regardless of what user actually specified.")
47*7c3d14c8STreehugger RobotTSAN_FLAG(bool, print_benign, false, "Print matched \"benign\" races at exit.")
48*7c3d14c8STreehugger RobotTSAN_FLAG(bool, halt_on_error, false, "Exit after first reported error.")
49*7c3d14c8STreehugger RobotTSAN_FLAG(int, atexit_sleep_ms, 1000,
50*7c3d14c8STreehugger Robot          "Sleep in main thread before exiting for that many ms "
51*7c3d14c8STreehugger Robot          "(useful to catch \"at exit\" races).")
52*7c3d14c8STreehugger RobotTSAN_FLAG(const char *, profile_memory, "",
53*7c3d14c8STreehugger Robot          "If set, periodically write memory profile to that file.")
54*7c3d14c8STreehugger RobotTSAN_FLAG(int, flush_memory_ms, 0, "Flush shadow memory every X ms.")
55*7c3d14c8STreehugger RobotTSAN_FLAG(int, flush_symbolizer_ms, 5000, "Flush symbolizer caches every X ms.")
56*7c3d14c8STreehugger RobotTSAN_FLAG(
57*7c3d14c8STreehugger Robot    int, memory_limit_mb, 0,
58*7c3d14c8STreehugger Robot    "Resident memory limit in MB to aim at."
59*7c3d14c8STreehugger Robot    "If the process consumes more memory, then TSan will flush shadow memory.")
60*7c3d14c8STreehugger RobotTSAN_FLAG(bool, stop_on_start, false,
61*7c3d14c8STreehugger Robot          "Stops on start until __tsan_resume() is called (for debugging).")
62*7c3d14c8STreehugger RobotTSAN_FLAG(bool, running_on_valgrind, false,
63*7c3d14c8STreehugger Robot          "Controls whether RunningOnValgrind() returns true or false.")
64*7c3d14c8STreehugger RobotTSAN_FLAG(
65*7c3d14c8STreehugger Robot    int, history_size, kGoMode ? 1 : 3, // There are a lot of goroutines in Go.
66*7c3d14c8STreehugger Robot    "Per-thread history size, controls how many previous memory accesses "
67*7c3d14c8STreehugger Robot    "are remembered per thread.  Possible values are [0..7]. "
68*7c3d14c8STreehugger Robot    "history_size=0 amounts to 32K memory accesses.  Each next value doubles "
69*7c3d14c8STreehugger Robot    "the amount of memory accesses, up to history_size=7 that amounts to "
70*7c3d14c8STreehugger Robot    "4M memory accesses.  The default value is 2 (128K memory accesses).")
71*7c3d14c8STreehugger RobotTSAN_FLAG(int, io_sync, 1,
72*7c3d14c8STreehugger Robot          "Controls level of synchronization implied by IO operations. "
73*7c3d14c8STreehugger Robot          "0 - no synchronization "
74*7c3d14c8STreehugger Robot          "1 - reasonable level of synchronization (write->read)"
75*7c3d14c8STreehugger Robot          "2 - global synchronization of all IO operations.")
76*7c3d14c8STreehugger RobotTSAN_FLAG(bool, die_after_fork, true,
77*7c3d14c8STreehugger Robot          "Die after multi-threaded fork if the child creates new threads.")
78*7c3d14c8STreehugger RobotTSAN_FLAG(const char *, suppressions, "", "Suppressions file name.")
79*7c3d14c8STreehugger RobotTSAN_FLAG(bool, ignore_interceptors_accesses, false,
80*7c3d14c8STreehugger Robot          "Ignore reads and writes from all interceptors.")
81*7c3d14c8STreehugger RobotTSAN_FLAG(bool, shared_ptr_interceptor, true,
82*7c3d14c8STreehugger Robot          "Track atomic reference counting in libc++ shared_ptr and weak_ptr.")
83