ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
xray_interface.h
Go to the documentation of this file.
1 //===- xray_interface.h -----------------------------------------*- C++ -*-===//
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 dynamic runtime instrumentation system.
10 //
11 // APIs for controlling XRay functionality explicitly.
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef XRAY_XRAY_INTERFACE_H
15 #define XRAY_XRAY_INTERFACE_H
16 
17 #include <cstddef>
18 #include <cstdint>
19 
20 extern "C" {
21 
24  ENTRY = 0,
25  EXIT = 1,
26  TAIL = 2,
30 };
31 
52 extern int __xray_set_handler(void (*entry)(int32_t, XRayEntryType));
53 
56 extern int __xray_remove_handler();
57 
63 extern int __xray_set_handler_arg1(void (*entry)(int32_t, XRayEntryType,
64  uint64_t));
65 
69 
71 extern int __xray_set_customevent_handler(void (*entry)(void *, std::size_t));
72 
76 
79 extern int __xray_set_typedevent_handler(void (*entry)(uint16_t, const void *,
80  std::size_t));
81 
85 
86 extern uint16_t __xray_register_event_type(const char *event_type);
87 
90  SUCCESS = 1,
91  ONGOING = 2,
92  FAILED = 3,
93 };
94 
98 
102 
106 
110 
115 
118 extern size_t __xray_max_function_id();
119 
126 extern void __xray_init();
127 
128 } // end extern "C"
129 
130 #endif // XRAY_XRAY_INTERFACE_H
static __inline__ uint64_t
Definition: arm_cde.h:31
static __inline__ int32_t
Definition: arm_mve.h:51
static __inline__ uint16_t
Definition: arm_mve.h:315
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
Definition: opencl-c-base.h:62
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
Definition: opencl-c-base.h:40
int __xray_remove_handler_arg1()
Disables the XRay handler used to log first arguments of function calls.
XRayPatchingStatus __xray_patch()
This tells XRay to patch the instrumentation points.
int __xray_set_handler(void(*entry)(int32_t, XRayEntryType))
Provide a function to invoke for when instrumentation points are hit.
uintptr_t __xray_function_address(int32_t FuncId)
This function returns the address of the function provided a valid function id.
XRayPatchingStatus __xray_unpatch()
Reverses the effect of __xray_patch().
uint16_t __xray_register_event_type(const char *event_type)
int __xray_remove_handler()
This removes whatever the currently provided handler is.
int __xray_remove_typedevent_handler()
Removes the currently set typed event handler.
void __xray_init()
Initialize the required XRay data structures.
int __xray_set_handler_arg1(void(*entry)(int32_t, XRayEntryType, uint64_t))
Use XRay to log the first argument of each (instrumented) function call.
XRayPatchingStatus __xray_unpatch_function(int32_t FuncId)
This unpatches a specific function id.
int __xray_remove_customevent_handler()
This removes whatever the currently provided custom event handler is.
XRayPatchingStatus __xray_patch_function(int32_t FuncId)
This patches a specific function id.
XRayEntryType
Synchronize this with AsmPrinter::SledKind in LLVM.
@ TYPED_EVENT
@ TAIL
@ EXIT
@ CUSTOM_EVENT
@ LOG_ARGS_ENTRY
@ ENTRY
XRayPatchingStatus
@ NOT_INITIALIZED
@ SUCCESS
@ ONGOING
@ FAILED
int __xray_set_customevent_handler(void(*entry)(void *, std::size_t))
Provide a function to invoke when XRay encounters a custom event.
int __xray_set_typedevent_handler(void(*entry)(uint16_t, const void *, std::size_t))
Set a handler for xray typed event logging.
size_t __xray_max_function_id()
This function returns the maximum valid function id.
int32_t FuncId
Definition: xray_records.h:16