aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorSebastian Kreutzer <SebastianKreutzer@gmx.net>2024-10-11 05:23:34 -0400
committerGitHub <noreply@github.com>2024-10-11 11:23:34 +0200
commita4402039bffd788b9af82435fd5a2fb311fdc6e8 (patch)
tree7de5707eb83984fc5208f428fbfda53c8bb8ef10 /llvm/lib/Transforms/Utils/InlineFunction.cpp
parent1276ce9e9713b2a0802004676fad7e40980396d5 (diff)
downloadllvm-a4402039bffd788b9af82435fd5a2fb311fdc6e8.zip
llvm-a4402039bffd788b9af82435fd5a2fb311fdc6e8.tar.gz
llvm-a4402039bffd788b9af82435fd5a2fb311fdc6e8.tar.bz2
[XRay] Add support for instrumentation of DSOs on x86_64 (#90959)
This PR introduces shared library (DSO) support for XRay based on a revised version of the implementation outlined in [this RFC](https://discourse.llvm.org/t/rfc-upstreaming-dso-instrumentation-support-for-xray/73000). The feature enables the patching and handling of events from DSOs, supporting both libraries linked at startup or explicitly loaded, e.g. via `dlopen`. This patch adds the following: - The `-fxray-shared` flag to enable the feature (turned off by default) - A small runtime library that is linked into every instrumented DSO, providing position-independent trampolines and code to register with the main XRay runtime - Changes to the XRay runtime to support management and patching of multiple objects These changes are fully backward compatible, i.e. running without instrumented DSOs will produce identical traces (in terms of recorded function IDs) to the previous implementation. Due to my limited ability to test on other architectures, this feature is only implemented and tested with x86_64. Extending support to other architectures is fairly straightforward, requiring only a position-independent implementation of the architecture-specific trampoline implementation (see `compiler-rt/lib/xray/xray_trampoline_x86_64.S` for reference). This patch does not include any functionality to resolve function IDs from DSOs for the provided logging/tracing modes. These modes still work and will record calls from DSOs, but symbol resolution for these functions in not available. Getting this to work properly requires recording information about the loaded DSOs and should IMO be discussed in a separate RFC, as there are mulitple feasible approaches. @petrhosek @jplehr
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
0 files changed, 0 insertions, 0 deletions