[PATCH] D26413: [XRay] Support AArch64 in compiler-rt

Renato Golin via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 14 08:24:47 PST 2016


rengolin added a comment.

Right, so I think the current scenario is:

1. Disabled traces won't get there at all, as they'll branch +32 directly.
2. Enabled traces will make use of the push/pop sequence, so no slow down.
3. In rare cases, the handler will be removed in between an enabled call, which adds sync problems.

To fix 3, there are three ways:

1. Make that an atomic pointer, complicating the thunk code making it bigger and slower.
2. Make sure any update to the function pointer is atomic with regards to it's use, which complicates the tracing logic.
3. Reduce the probability in the tracing code (some atomics/volatile) and "hope" that the distance between `CMP` and `BEQ` is small enough.

We seem to be going for 3.

Given that this only affect XRay, I don't mind this implementation, as long as the users are aware of it. The XRay documentation [1] doesn't seem to cover that.

@dberris, it's up to you, really. :)

cheers,
--renato

[1] http://llvm.org/docs/XRay.html


https://reviews.llvm.org/D26413





More information about the llvm-commits mailing list