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