[PATCH] D26651: [XRay][docs] Define requirements on installed log handlers.

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 15 18:28:20 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL287073: [XRay][docs] Define requirements on installed log handlers. (authored by dberris).

Changed prior to commit:
  https://reviews.llvm.org/D26651?vs=77918&id=78125#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D26651

Files:
  llvm/trunk/docs/XRay.rst


Index: llvm/trunk/docs/XRay.rst
===================================================================
--- llvm/trunk/docs/XRay.rst
+++ llvm/trunk/docs/XRay.rst
@@ -162,6 +162,19 @@
 - ``__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
 --------------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26651.78125.patch
Type: text/x-patch
Size: 1052 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161116/6939b277/attachment.bin>


More information about the llvm-commits mailing list