tsan_flags.inc 4.2 KB

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