Skip to content

Commit

Permalink
[XRay][docs] Define requirements on installed log handlers.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
deanberris committed Nov 16, 2016
1 parent 23f441d commit 6eec7d4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions llvm/docs/XRay.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------------------
Expand Down

0 comments on commit 6eec7d4

Please sign in to comment.