[PATCH] D23988: [compiler-rt][XRay] Support tail call sleds

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 20:16:52 PDT 2016


dberris added a comment.

In https://reviews.llvm.org/D23988#555375, @rSerge wrote:

> Debugging for me has shown that the above happens because `printf` from `fC` is also called as a tail call. So first the exit sled of `fC` is executed, and only then `printf` is jumped into. So it seems we can't do anything about this with the current approach.


This isn't such a bad thing though, given the following construction:

  f1()
    f2()
      f3()

If we get `f2()` tail-calling into `f3()` and `f3()` tail calling into something else that isn't instrumented (not shown here), then we will still see:

  f1()
    f2()
    f3()
    ... missing ...

However, since `f1()` is instrumented, we will see that time spent outside of `f3()` will be attributed to `f1()`.

This is predicated though on having an enclosing function that is instrumented. To see this in your example, you can wrap the call to `fA()` with another function that will not tail-call into `fA()`.


https://reviews.llvm.org/D23988





More information about the llvm-commits mailing list