blob: a8709c3a7c8a97e27eadde0a85ab68f301a2f3b6 [file] [log] [blame]
Dean Michael Berrise7dbebf2017-01-25 03:50:46 +00001//===-- xray_log_interface.h ----------------------------------------------===//
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 function call tracing system.
11//
12// APIs for installing a new logging implementation.
13//===----------------------------------------------------------------------===//
14#ifndef XRAY_XRAY_LOG_INTERFACE_H
15#define XRAY_XRAY_LOG_INTERFACE_H
16
17#include "xray/xray_interface.h"
18#include <stddef.h>
19
20extern "C" {
21
22enum XRayLogInitStatus {
23 XRAY_LOG_UNINITIALIZED = 0,
24 XRAY_LOG_INITIALIZING = 1,
25 XRAY_LOG_INITIALIZED = 2,
26 XRAY_LOG_FINALIZING = 3,
27 XRAY_LOG_FINALIZED = 4,
28};
29
30enum XRayLogFlushStatus {
31 XRAY_LOG_NOT_FLUSHING = 0,
32 XRAY_LOG_FLUSHING = 1,
33 XRAY_LOG_FLUSHED = 2,
34};
35
36struct XRayLogImpl {
37 XRayLogInitStatus (*log_init)(size_t, size_t, void *, size_t);
38 XRayLogInitStatus (*log_finalize)();
39 void (*handle_arg0)(int32_t, XRayEntryType);
40 XRayLogFlushStatus (*flush_log)();
41};
42
43void __xray_set_log_impl(XRayLogImpl Impl);
44XRayLogInitStatus __xray_log_init(size_t BufferSize, size_t MaxBuffers,
45 void *Args, size_t ArgsSize);
46XRayLogInitStatus __xray_log_finalize();
47XRayLogFlushStatus __xray_log_flushLog();
48
49} // extern "C"
50
Dean Michael Berriscf791cf2017-03-29 05:19:24 +000051namespace __xray {
52// Options used by the LLVM XRay FDR implementation.
53struct FDRLoggingOptions {
54 bool ReportErrors = false;
55 int Fd = -1;
56};
57
58} // namespace __xray
59
Dean Michael Berrise7dbebf2017-01-25 03:50:46 +000060#endif // XRAY_XRAY_LOG_INTERFACE_H