Dean Michael Berris | 980d93d | 2018-05-15 00:42:36 +0000 | [diff] [blame] | 1 | //===-- xray_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 XRay, a dynamic runtime instrumentation system. |
| 11 | // |
| 12 | // XRay runtime flags. |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
Dean Michael Berris | cfd7eec | 2018-06-12 03:29:39 +0000 | [diff] [blame] | 15 | #include "xray_profiling_flags.h" |
Dean Michael Berris | 980d93d | 2018-05-15 00:42:36 +0000 | [diff] [blame] | 16 | #include "sanitizer_common/sanitizer_common.h" |
| 17 | #include "sanitizer_common/sanitizer_flag_parser.h" |
| 18 | #include "sanitizer_common/sanitizer_libc.h" |
| 19 | #include "xray_defs.h" |
| 20 | |
| 21 | namespace __xray { |
| 22 | |
Dean Michael Berris | cfd7eec | 2018-06-12 03:29:39 +0000 | [diff] [blame] | 23 | // Storage for the profiling flags. |
| 24 | ProfilerFlags xray_profiling_flags_dont_use_directly; |
Dean Michael Berris | 980d93d | 2018-05-15 00:42:36 +0000 | [diff] [blame] | 25 | |
| 26 | void ProfilerFlags::setDefaults() XRAY_NEVER_INSTRUMENT { |
| 27 | #define XRAY_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue; |
Dean Michael Berris | cfd7eec | 2018-06-12 03:29:39 +0000 | [diff] [blame] | 28 | #include "xray_profiling_flags.inc" |
Dean Michael Berris | 980d93d | 2018-05-15 00:42:36 +0000 | [diff] [blame] | 29 | #undef XRAY_FLAG |
| 30 | } |
| 31 | |
| 32 | void registerProfilerFlags(FlagParser *P, |
| 33 | ProfilerFlags *F) XRAY_NEVER_INSTRUMENT { |
| 34 | #define XRAY_FLAG(Type, Name, DefaultValue, Description) \ |
| 35 | RegisterFlag(P, #Name, Description, &F->Name); |
Dean Michael Berris | cfd7eec | 2018-06-12 03:29:39 +0000 | [diff] [blame] | 36 | #include "xray_profiling_flags.inc" |
Dean Michael Berris | 980d93d | 2018-05-15 00:42:36 +0000 | [diff] [blame] | 37 | #undef XRAY_FLAG |
| 38 | } |
| 39 | |
| 40 | } // namespace __xray |