1 //===-- xray_fdr_logging.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 //===----------------------------------------------------------------------===// 13 #ifndef XRAY_XRAY_FDR_LOGGING_H 14 #define XRAY_XRAY_FDR_LOGGING_H 15 16 #include "xray/xray_log_interface.h" 17 #include "xray_fdr_log_records.h" 18 19 // FDR (Flight Data Recorder) Mode 20 // =============================== 21 // 22 // The XRay whitepaper describes a mode of operation for function call trace 23 // logging that involves writing small records into an in-memory circular 24 // buffer, that then gets logged to disk on demand. To do this efficiently and 25 // capture as much data as we can, we use smaller records compared to the 26 // default mode of always writing fixed-size records. 27 28 namespace __xray { 29 XRayLogInitStatus fdrLoggingInit(size_t BufferSize, size_t BufferMax, 30 void *Options, size_t OptionsSize); 31 XRayLogInitStatus fdrLoggingFinalize(); 32 void fdrLoggingHandleArg0(int32_t FuncId, XRayEntryType Entry); 33 void fdrLoggingHandleArg1(int32_t FuncId, XRayEntryType Entry, uint64_t Arg1); 34 XRayLogFlushStatus fdrLoggingFlush(); 35 XRayLogInitStatus fdrLoggingReset(); 36 37 } // namespace __xray 38 39 #endif // XRAY_XRAY_FDR_LOGGING_H 40