1317021Sdim//===-- xray_fdr_logging.h ------------------------------------------------===//
2317021Sdim//
3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4353358Sdim// See https://llvm.org/LICENSE.txt for license information.
5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6317021Sdim//
7317021Sdim//===----------------------------------------------------------------------===//
8317021Sdim//
9317021Sdim// This file is a part of XRay, a function call tracing system.
10317021Sdim//
11317021Sdim//===----------------------------------------------------------------------===//
12317021Sdim#ifndef XRAY_XRAY_FDR_LOGGING_H
13317021Sdim#define XRAY_XRAY_FDR_LOGGING_H
14317021Sdim
15317021Sdim#include "xray/xray_log_interface.h"
16317021Sdim#include "xray_fdr_log_records.h"
17317021Sdim
18317021Sdim// FDR (Flight Data Recorder) Mode
19317021Sdim// ===============================
20317021Sdim//
21317021Sdim// The XRay whitepaper describes a mode of operation for function call trace
22317021Sdim// logging that involves writing small records into an in-memory circular
23317021Sdim// buffer, that then gets logged to disk on demand. To do this efficiently and
24317021Sdim// capture as much data as we can, we use smaller records compared to the
25317021Sdim// default mode of always writing fixed-size records.
26317021Sdim
27317021Sdimnamespace __xray {
28317021SdimXRayLogInitStatus fdrLoggingInit(size_t BufferSize, size_t BufferMax,
29317021Sdim                                 void *Options, size_t OptionsSize);
30317021SdimXRayLogInitStatus fdrLoggingFinalize();
31317021Sdimvoid fdrLoggingHandleArg0(int32_t FuncId, XRayEntryType Entry);
32327952Sdimvoid fdrLoggingHandleArg1(int32_t FuncId, XRayEntryType Entry, uint64_t Arg1);
33317021SdimXRayLogFlushStatus fdrLoggingFlush();
34317021SdimXRayLogInitStatus fdrLoggingReset();
35317021Sdim
36317021Sdim} // namespace __xray
37317021Sdim
38317021Sdim#endif // XRAY_XRAY_FDR_LOGGING_H
39