summaryrefslogtreecommitdiffstats
path: root/llvm/docs
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2016-11-16 02:18:23 +0000
committerDean Michael Berris <dberris@google.com>2016-11-16 02:18:23 +0000
commit6eec7d4158fdb130b8f6473f7259211a8aa79f75 (patch)
treecebc91239f65bec70f1f2df4f1994e163df5671b /llvm/docs
parent23f441d3ace2a0717f78cda08b8c340c33aa4783 (diff)
downloadbcm5719-llvm-6eec7d4158fdb130b8f6473f7259211a8aa79f75.tar.gz
bcm5719-llvm-6eec7d4158fdb130b8f6473f7259211a8aa79f75.zip
[XRay][docs] Define requirements on installed log handlers.
Summary: We update the documentation to define what the requirements are for the provided XRay log handler. This is to make it clear that the function pointer provided must do internal synchronisation and that there are no guarantees provided by XRay on when the function shall be invoked once it has been installed as a log handler. Reviewers: rSerge, rengolin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26651 llvm-svn: 287073
Diffstat (limited to 'llvm/docs')
-rw-r--r--llvm/docs/XRay.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/docs/XRay.rst b/llvm/docs/XRay.rst
index 17dde123483..222cc8f2e04 100644
--- a/llvm/docs/XRay.rst
+++ b/llvm/docs/XRay.rst
@@ -162,6 +162,19 @@ functions we list below:
- ``__xray_unpatch()``: Unpatch the instrumentation points defined in the
binary.
+There are some requirements on the logging handler to be installed for the
+thread-safety of operations to be performed by the XRay runtime library:
+
+- The function should be thread-safe, as multiple threads may be invoking the
+ function at the same time. If the logging function needs to do
+ synchronisation, it must do so internally as XRay does not provide any
+ synchronisation guarantees outside from the atomicity of updates to the
+ pointer.
+- The pointer provided to ``__xray_set_handler(...)`` must be live even after
+ calls to ``__xray_remove_handler()`` and ``__xray_unpatch()`` have succeeded.
+ XRay cannot guarantee that all threads that have ever gotten a copy of the
+ pointer will not invoke the function.
+
Trace Analysis Tools
--------------------
OpenPOWER on IntegriCloud