summaryrefslogtreecommitdiffstats
path: root/compiler-rt/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
commitadb092e0aefc7da8fe68d5b49f0e61ae68d8f595 (patch)
treed1e87c5bb1aa6e289cd13dabf5fc18abd010ad1e /compiler-rt/include/xray
parent2b8158f441da74d8432c7629b005a7107a44186b (diff)
downloadbcm5719-llvm-adb092e0aefc7da8fe68d5b49f0e61ae68d8f595.tar.gz
bcm5719-llvm-adb092e0aefc7da8fe68d5b49f0e61ae68d8f595.zip
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 llvm-svn: 330218
Diffstat (limited to 'compiler-rt/include/xray')
-rw-r--r--compiler-rt/include/xray/xray_interface.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/compiler-rt/include/xray/xray_interface.h b/compiler-rt/include/xray/xray_interface.h
index d08039a67fa..ba4c0e81269 100644
--- a/compiler-rt/include/xray/xray_interface.h
+++ b/compiler-rt/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,
OpenPOWER on IntegriCloud