summaryrefslogtreecommitdiff
path: root/lib/tsan/rtl/tsan_flags.h
blob: 7a3c4aff2dd5f1a1194d76821a452c2297b1b658 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//===-- tsan_flags.h --------------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file is a part of ThreadSanitizer (TSan), a race detector.
//
//===----------------------------------------------------------------------===//

#ifndef TSAN_FLAGS_H
#define TSAN_FLAGS_H

namespace __tsan {

struct Flags {
  // Enable dynamic annotations, otherwise they are no-ops.
  bool enable_annotations;
  // Supress a race report if we've already output another race report
  // with the same stack.
  bool suppress_equal_stacks;
  // Supress a race report if we've already output another race report
  // on the same address.
  bool suppress_equal_addresses;
  // Report thread leaks at exit?
  bool report_thread_leaks;
  // Report violations of async signal-safety
  // (e.g. malloc() call from a signal handler).
  bool report_signal_unsafe;
  // If set, all atomics are effectively sequentially consistent (seq_cst),
  // regardless of what user actually specified.
  bool force_seq_cst_atomics;
  // Strip that prefix from file paths in reports.
  const char *strip_path_prefix;
  // Suppressions filename.
  const char *suppressions;
  // Override exit status if something was reported.
  int exitcode;
  // Log fileno (1 - stdout, 2 - stderr).
  int log_fileno;
  // Sleep in main thread before exiting for that many ms
  // (useful to catch "at exit" races).
  int atexit_sleep_ms;
  // Verbosity level (0 - silent, 1 - a bit of output, 2+ - more output).
  int verbosity;
};

Flags *flags();
void InitializeFlags(Flags *flags, const char *env);
}

#endif  // TSAN_FLAGS_H