blob: 8e0dc815a4c33ff0f0dbf2ce4372ddc213c2f1dc [file] [log] [blame]
Kostya Serebryany7ac41482012-05-10 13:48:04 +00001//===-- tsan_flags.h --------------------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file is a part of ThreadSanitizer (TSan), a race detector.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef TSAN_FLAGS_H
15#define TSAN_FLAGS_H
16
17namespace __tsan {
18
19struct Flags {
20 // Enable dynamic annotations, otherwise they are no-ops.
21 bool enable_annotations;
22 // Supress a race report if we've already output another race report
23 // with the same stack.
24 bool suppress_equal_stacks;
25 // Supress a race report if we've already output another race report
26 // on the same address.
27 bool suppress_equal_addresses;
28 // Report thread leaks at exit?
29 bool report_thread_leaks;
30 // Report violations of async signal-safety
31 // (e.g. malloc() call from a signal handler).
32 bool report_signal_unsafe;
33 // If set, all atomics are effectively sequentially consistent (seq_cst),
34 // regardless of what user actually specified.
35 bool force_seq_cst_atomics;
36 // Strip that prefix from file paths in reports.
37 const char *strip_path_prefix;
38 // Suppressions filename.
39 const char *suppressions;
40 // Override exit status if something was reported.
41 int exitcode;
42 // Log fileno (1 - stdout, 2 - stderr).
43 int log_fileno;
44 // Sleep in main thread before exiting for that many ms
45 // (useful to catch "at exit" races).
46 int atexit_sleep_ms;
47 // Verbosity level (0 - silent, 1 - a bit of output, 2+ - more output).
48 int verbosity;
Dmitry Vyukov26127732012-05-22 11:33:03 +000049 // If set, periodically write memory profile to that file.
50 const char *profile_memory;
Kostya Serebryany7ac41482012-05-10 13:48:04 +000051};
52
53Flags *flags();
54void InitializeFlags(Flags *flags, const char *env);
Kostya Serebryany7ac41482012-05-10 13:48:04 +000055}
56
57#endif // TSAN_FLAGS_H