ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
xray_log_interface.h
Go to the documentation of this file.
1 //===-- xray_log_interface.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 // APIs for installing a new logging implementation.
12 //
13 //===----------------------------------------------------------------------===//
92 #ifndef XRAY_XRAY_LOG_INTERFACE_H
93 #define XRAY_XRAY_LOG_INTERFACE_H
94 
95 #include "xray/xray_interface.h"
96 #include <stddef.h>
97 
98 extern "C" {
99 
106 
113 
119 
126 
133 };
134 
141 };
142 
151 };
152 
156 struct XRayLogImpl {
173 
179 
188 
195 };
196 
217 
232  XRayLogImpl Impl);
233 
245 
250 
267 
272 XRayLogInitStatus __xray_log_init(size_t BufferSize, size_t MaxBuffers,
273  void *Args, size_t ArgsSize);
274 
290 XRayLogInitStatus __xray_log_init_mode(const char *Mode, const char *Config);
291 
296 XRayLogInitStatus __xray_log_init_mode_bin(const char *Mode, const char *Config,
297  size_t ConfigSize);
298 
302 
306 
310 struct XRayBuffer {
311  const void *Data;
312  size_t Size;
313 };
314 
323 
326 
352 XRayLogFlushStatus __xray_log_process_buffers(void (*Processor)(const char *,
353  XRayBuffer));
354 
355 } // extern "C"
356 
357 #endif // XRAY_XRAY_LOG_INTERFACE_H
static __inline__ int32_t
Definition: arm_mve.h:51
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
Definition: opencl-c-base.h:40
An XRayBuffer represents a section of memory which can be treated by log processing functions as byte...
const void * Data
A valid XRay logging implementation MUST provide all of the function pointers in XRayLogImpl when bei...
XRayLogFlushStatus(* flush_log)()
The log implementation provided routine for when __xray_log_flushLog() is called.
XRayLogInitStatus(* log_finalize)()
The log finalization routine provided by the implementation.
void(* handle_arg0)(int32_t, XRayEntryType)
The 0-argument function call handler.
XRayLogInitStatus(* log_init)(size_t, size_t, void *, size_t)
The log initialization routine provided by the implementation, always provided with the following par...
XRayEntryType
Synchronize this with AsmPrinter::SledKind in LLVM.
XRayLogFlushStatus __xray_log_flushLog()
Invokes the install implementation log flushing routine.
void __xray_log_set_buffer_iterator(XRayBuffer(*Iterator)(XRayBuffer))
Registers an iterator function which takes an XRayBuffer argument, then returns another XRayBuffer fu...
void __xray_set_log_impl(XRayLogImpl Impl)
DEPRECATED: Use the mode registration workflow instead with __xray_log_register_mode(....
void __xray_log_remove_buffer_iterator()
Removes the currently registered buffer iterator function.
XRayLogRegisterStatus __xray_log_register_mode(const char *Mode, XRayLogImpl Impl)
This function registers a logging implementation against a "mode" identifier.
XRayLogFlushStatus
This enum allows an implementation to signal log flushing operations via `__xray_log_flushLog()`,...
@ XRAY_LOG_FLUSHING
@ XRAY_LOG_NOT_FLUSHING
@ XRAY_LOG_FLUSHED
XRayLogFlushStatus __xray_log_process_buffers(void(*Processor)(const char *, XRayBuffer))
Invokes the provided handler to process data maintained by the logging handler.
XRayLogInitStatus __xray_log_init_mode(const char *Mode, const char *Config)
Invokes the installed initialization routine, which *must* support the string based form.
void __xray_remove_log_impl()
This function removes the currently installed implementation.
XRayLogInitStatus __xray_log_init_mode_bin(const char *Mode, const char *Config, size_t ConfigSize)
Like __xray_log_init_mode(...) this version allows for providing configurations that might have non-n...
const char * __xray_log_get_current_mode()
Returns an identifier for the currently selected XRay mode chosen through the __xray_log_select_mode(...
XRayLogInitStatus __xray_log_init(size_t BufferSize, size_t MaxBuffers, void *Args, size_t ArgsSize)
DEPRECATED: Use __xray_log_init_mode() instead, and provide all the options in string form.
XRayLogRegisterStatus __xray_log_select_mode(const char *Mode)
This function selects the implementation associated with Mode that has been registered through __xray...
XRayLogInitStatus __xray_log_finalize()
Invokes the installed implementation finalization routine.
XRayLogInitStatus
XRay allows users to implement their own logging handlers and install them to replace the default run...
@ XRAY_LOG_FINALIZED
When an implementation is done finalizing, it MUST return XRAY_LOG_FINALIZED.
@ XRAY_LOG_INITIALIZING
Some implementations support multi-stage init (or asynchronous init), and may return XRAY_LOG_INITIAL...
@ XRAY_LOG_FINALIZING
Some implementations might support multi-stage finalization (or asynchronous finalization),...
@ XRAY_LOG_UNINITIALIZED
The default state is uninitialized, and in case there were errors in the initialization,...
@ XRAY_LOG_INITIALIZED
When an implementation is done initializing, it MUST return XRAY_LOG_INITIALIZED.
XRayLogRegisterStatus
This enum indicates the installation state of a logging implementation, when associating a mode to a ...
@ XRAY_REGISTRATION_OK
@ XRAY_INCOMPLETE_IMPL
@ XRAY_MODE_NOT_FOUND
@ XRAY_DUPLICATE_MODE