summaryrefslogtreecommitdiffstats
path: root/compiler-rt/include/xray
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2016-07-29 07:11:58 +0000
committerDean Michael Berris <dberris@google.com>2016-07-29 07:11:58 +0000
commit17a586e6de8ac3bf5bd49038564662d6a35496a4 (patch)
tree4b2c14aab1ff2df23cd20ad7a5072dac96f1745b /compiler-rt/include/xray
parent8129255e7637b195981a21fcba93a7af0dbdb4a1 (diff)
downloadbcm5719-llvm-17a586e6de8ac3bf5bd49038564662d6a35496a4.tar.gz
bcm5719-llvm-17a586e6de8ac3bf5bd49038564662d6a35496a4.zip
[compiler-rt][XRay] Address follow-up comments to initial interface and initialisation code
This addresses some comments from D21612, which contains the following changes: - Update __xray_patch() and __xray_unpatch() API documentation to not imply asynchrony. - Introduce a scope cleanup mechanism to make sure we can roll-back changes to the XRayPatching global atomic. - Introduce a few more comments for potential extension points for other platforms (for the implementation details of patching and un-patching). Reviewers: eugenis, rnk, kcc, echristo, majnemer Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D22911 llvm-svn: 277124
Diffstat (limited to 'compiler-rt/include/xray')
-rw-r--r--compiler-rt/include/xray/xray_interface.h22
1 files changed, 7 insertions, 15 deletions
diff --git a/compiler-rt/include/xray/xray_interface.h b/compiler-rt/include/xray/xray_interface.h
index b8a0a61920b..22f137d110f 100644
--- a/compiler-rt/include/xray/xray_interface.h
+++ b/compiler-rt/include/xray/xray_interface.h
@@ -41,26 +41,18 @@ extern int __xray_remove_handler();
enum XRayPatchingStatus {
NOT_INITIALIZED = 0,
- NOTIFIED = 1,
+ SUCCESS = 1,
ONGOING = 2,
- FAILED = 3
+ FAILED = 3,
};
-// This tells XRay to patch the instrumentation points. This is an asynchronous
-// process, and returns the following status in specific cases:
-//
-// - 0 : XRay is not initialized.
-// - 1 : We've done the notification.
-// - 2 : Patching / un-patching is on-going.
+// This tells XRay to patch the instrumentation points. See XRayPatchingStatus
+// for possible result values.
extern XRayPatchingStatus __xray_patch();
-// Reverses the effect of __xray_patch(). This is an asynchronous process, and
-// returns the following status in specific cases.
-//
-// - 0 : XRay is not initialized.
-// - 1 : We've done the notification.
-// - 2 : Patching / un-patching is on-going.
-extern int __xray_unpatch();
+// Reverses the effect of __xray_patch(). See XRayPatchingStatus for possible
+// result values.
+extern XRayPatchingStatus __xray_unpatch();
}
#endif
OpenPOWER on IntegriCloud