summaryrefslogtreecommitdiff
path: root/include/xray
diff options
context:
space:
mode:
authorKeith Wyss <wyssman@gmail.com>2018-04-17 21:28:53 +0000
committerKeith Wyss <wyssman@gmail.com>2018-04-17 21:28:53 +0000
commit78748153745b09b8a547f1692ed0873d317dc6e4 (patch)
tree34f04f40703a1de5932519574b97abad1706be00 /include/xray
parent34e99c90162c3e66a0f21bb2511faaa4f8cf17a1 (diff)
Implement trampoline and handler for typed xray event tracing.
Summary: Compiler-rt support first before defining the __xray_typedevent() lowering in llvm. I'm looking for some early feedback before I touch much more code. Reviewers: dberris Subscribers: delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43668 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@330218 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/xray')
-rw-r--r--include/xray/xray_interface.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/xray/xray_interface.h b/include/xray/xray_interface.h
index d08039a67..ba4c0e812 100644
--- a/include/xray/xray_interface.h
+++ b/include/xray/xray_interface.h
@@ -27,6 +27,7 @@ enum XRayEntryType {
TAIL = 2,
LOG_ARGS_ENTRY = 3,
CUSTOM_EVENT = 4,
+ TYPED_EVENT = 5,
};
/// Provide a function to invoke for when instrumentation points are hit. This
@@ -68,12 +69,23 @@ extern int __xray_set_handler_arg1(void (*entry)(int32_t, XRayEntryType,
extern int __xray_remove_handler_arg1();
/// Provide a function to invoke when XRay encounters a custom event.
-extern int __xray_set_customevent_handler(void (*entry)(void*, std::size_t));
+extern int __xray_set_customevent_handler(void (*entry)(void *, std::size_t));
/// This removes whatever the currently provided custom event handler is.
/// Returns 1 on success, 0 on error.
extern int __xray_remove_customevent_handler();
+/// Set a handler for xray typed event logging. The first parameter is a type
+/// identifier, the second is a payload, and the third is the payload size.
+extern int __xray_set_typedevent_handler(void (*entry)(uint16_t, const void *,
+ std::size_t));
+
+/// Removes the currently set typed event handler.
+/// Returns 1 on success, 0 on error.
+extern int __xray_remove_typedevent_handler();
+
+extern uint16_t __xray_register_event_type(const char *event_type);
+
enum XRayPatchingStatus {
NOT_INITIALIZED = 0,
SUCCESS = 1,