[XRay] Fix FDR initialization

Follow-up to D51606.

llvm-svn: 342355
This commit is contained in:
Dean Michael Berris 2018-09-17 02:49:17 +00:00
parent 46c6d3fe75
commit d5577aea07
1 changed files with 14 additions and 3 deletions

View File

@ -1203,11 +1203,22 @@ bool fdrLogDynamicInitializer() XRAY_NEVER_INSTRUMENT {
};
auto RegistrationResult = __xray_log_register_mode("xray-fdr", Impl);
if (RegistrationResult != XRayLogRegisterStatus::XRAY_REGISTRATION_OK &&
Verbosity())
Verbosity()) {
Report("Cannot register XRay FDR mode to 'xray-fdr'; error = %d\n",
RegistrationResult);
if (flags()->xray_fdr_log || !internal_strcmp(flags()->xray_mode, "xray-fdr"))
__xray_set_log_impl(Impl);
return false;
}
if (flags()->xray_fdr_log ||
!internal_strcmp(flags()->xray_mode, "xray-fdr")) {
auto SelectResult = __xray_log_select_mode("xray-fdr");
if (SelectResult != XRayLogRegisterStatus::XRAY_REGISTRATION_OK &&
Verbosity()) {
Report("Cannot select XRay FDR mode as 'xray-fdr'; error = %d\n",
SelectResult);
return false;
}
}
return true;
}