xref: /freebsd/contrib/llvm-project/compiler-rt/lib/xray/xray_basic_logging.h (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1 //===-- xray_basic_logging.h ----------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file is a part of XRay, a function call tracing system.
10 //
11 //===----------------------------------------------------------------------===//
12 #ifndef XRAY_XRAY_INMEMORY_LOG_H
13 #define XRAY_XRAY_INMEMORY_LOG_H
14 
15 #include "xray/xray_log_interface.h"
16 
17 /// Basic (Naive) Mode
18 /// ==================
19 ///
20 /// This implementation hooks in through the XRay logging implementation
21 /// framework. The Basic Mode implementation will keep appending to a file as
22 /// soon as the thread-local buffers are full. It keeps minimal in-memory state
23 /// and does the minimum filtering required to keep log files smaller.
24 
25 namespace __xray {
26 
27 XRayLogInitStatus basicLoggingInit(size_t BufferSize, size_t BufferMax,
28                                    void *Options, size_t OptionsSize);
29 XRayLogInitStatus basicLoggingFinalize();
30 
31 void basicLoggingHandleArg0RealTSC(int32_t FuncId, XRayEntryType Entry);
32 void basicLoggingHandleArg0EmulateTSC(int32_t FuncId, XRayEntryType Entry);
33 void basicLoggingHandleArg1RealTSC(int32_t FuncId, XRayEntryType Entry,
34                                    uint64_t Arg1);
35 void basicLoggingHandleArg1EmulateTSC(int32_t FuncId, XRayEntryType Entry,
36                                       uint64_t Arg1);
37 XRayLogFlushStatus basicLoggingFlush();
38 XRayLogInitStatus basicLoggingReset();
39 
40 } // namespace __xray
41 
42 #endif // XRAY_XRAY_INMEMORY_LOG_H
43