blob: 593e66a78ad2ddf4178952d2aea66b25cd942938 [file] [log] [blame]
Dean Michael Berris980d93d2018-05-15 00:42:36 +00001//===-- 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 Berriscfd7eec2018-06-12 03:29:39 +000015#include "xray_profiling_flags.h"
Dean Michael Berris980d93d2018-05-15 00:42:36 +000016#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
21namespace __xray {
22
Dean Michael Berriscfd7eec2018-06-12 03:29:39 +000023// Storage for the profiling flags.
24ProfilerFlags xray_profiling_flags_dont_use_directly;
Dean Michael Berris980d93d2018-05-15 00:42:36 +000025
26void ProfilerFlags::setDefaults() XRAY_NEVER_INSTRUMENT {
27#define XRAY_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue;
Dean Michael Berriscfd7eec2018-06-12 03:29:39 +000028#include "xray_profiling_flags.inc"
Dean Michael Berris980d93d2018-05-15 00:42:36 +000029#undef XRAY_FLAG
30}
31
32void 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 Berriscfd7eec2018-06-12 03:29:39 +000036#include "xray_profiling_flags.inc"
Dean Michael Berris980d93d2018-05-15 00:42:36 +000037#undef XRAY_FLAG
38}
39
40} // namespace __xray