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 15 #include "xray_profiling_flags.h" 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 23 // Storage for the profiling flags. 24 ProfilerFlags xray_profiling_flags_dont_use_directly; 25 26 void ProfilerFlags::setDefaults() XRAY_NEVER_INSTRUMENT { 27 #define XRAY_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue; 28 #include "xray_profiling_flags.inc" 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); 36 #include "xray_profiling_flags.inc" 37 #undef XRAY_FLAG 38 } 39 40 } // namespace __xray 41