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