diff options
author | Dean Michael Berris <dberris@google.com> | 2016-07-20 14:14:50 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2016-07-20 14:14:50 +0000 |
commit | 9b1dbf02c9adffedc28c56284967ab87941abb53 (patch) | |
tree | 1d50233d892ea15bb6365087fed3e1758f576472 /lib/xray/xray_flags.h | |
parent | e35e7c00b5c7e7ee5e24d537b80cb0d34cebb038 (diff) |
[compiler-rt] [XRay] Basic initialization and flag definition for XRay runtime
Summary:
This patch implements the initialisation and patching routines for the XRay runtime, along with the necessary trampolines for function entry/exit handling. For now we only define the basic hooks for allowing an implementation to define a handler that gets run on function entry/exit. We expose a minimal API for controlling the behaviour of the runtime (patching, cleanup, and setting the handler to invoke when instrumenting).
Depends on D19904
Reviewers: echristo, kcc, rnk
Subscribers: rnk, mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D21612
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276117 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/xray/xray_flags.h')
-rw-r--r-- | lib/xray/xray_flags.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/xray/xray_flags.h b/lib/xray/xray_flags.h new file mode 100644 index 000000000..2ecf5fb9b --- /dev/null +++ b/lib/xray/xray_flags.h @@ -0,0 +1,37 @@ +//===-- xray_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 XRay, a dynamic runtime instruementation system. +// +// XRay runtime flags. +//===----------------------------------------------------------------------===// + +#ifndef XRAY_FLAGS_H +#define XRAY_FLAGS_H + +#include "sanitizer_common/sanitizer_flag_parser.h" + +namespace __xray { + +struct Flags { +#define XRAY_FLAG(Type, Name, DefaultValue, Description) Type Name; +#include "xray_flags.inc" +#undef XRAY_FLAG + + void SetDefaults(); +}; + +extern Flags xray_flags_dont_use_directly; +inline Flags *flags() { return &xray_flags_dont_use_directly; } + +void InitializeFlags(); + +} // namespace __xray + +#endif // XRAY_FLAGS_H |