[clang] [compiler-rt] [XRay] Add support for instrumentation of DSOs on x86_64 (PR #90959)
Sebastian Kreutzer via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 8 02:30:19 PDT 2024
================
@@ -471,42 +518,123 @@ uint16_t __xray_register_event_type(
}
XRayPatchingStatus __xray_patch() XRAY_NEVER_INSTRUMENT {
- return controlPatching(true);
+ XRayPatchingStatus CombinedStatus{SUCCESS};
+ for (size_t I = 0; I < __xray_num_objects(); ++I) {
+ if (!isObjectLoaded(I))
+ continue;
+ auto LastStatus = controlPatching(true, I);
+ switch (LastStatus) {
+ case FAILED:
+ CombinedStatus = FAILED;
+ break;
+ case NOT_INITIALIZED:
+ if (CombinedStatus != FAILED)
+ CombinedStatus = NOT_INITIALIZED;
+ break;
+ case ONGOING:
+ if (CombinedStatus != FAILED && CombinedStatus != NOT_INITIALIZED)
+ CombinedStatus = ONGOING;
+ break;
+ default:
+ break;
----------------
sebastiankreutzer wrote:
Will do
https://github.com/llvm/llvm-project/pull/90959
More information about the llvm-commits
mailing list