summaryrefslogtreecommitdiff
path: root/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
commit7a19aeb3dbce73c0c7417992e7e2f1cbcaac0916 (patch)
tree5e02f46bce3ff261ab9b9f2f001d7489c5f4d36e /include/xray
parent41a0641fde7ea343ec26862de0d96b32a85b56a7 (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277124 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/xray')
-rw-r--r--include/xray/xray_interface.h22
1 files changed, 7 insertions, 15 deletions
diff --git a/include/xray/xray_interface.h b/include/xray/xray_interface.h
index b8a0a6192..22f137d11 100644
--- a/include/xray/xray_interface.h
+++ b/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