summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2018-09-17 02:49:17 +0000
committerDean Michael Berris <dberris@google.com>2018-09-17 02:49:17 +0000
commitd5577aea07ccca29baf7f1fe22840cf188ad1688 (patch)
tree123ebff206281269ee34b61aed7ae4badc4a734c
parent46c6d3fe75267608317fcce9be3c51cf5e44e70c (diff)
downloadbcm5719-llvm-d5577aea07ccca29baf7f1fe22840cf188ad1688.tar.gz
bcm5719-llvm-d5577aea07ccca29baf7f1fe22840cf188ad1688.zip
[XRay] Fix FDR initialization
Follow-up to D51606. llvm-svn: 342355
-rw-r--r--compiler-rt/lib/xray/xray_fdr_logging.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/compiler-rt/lib/xray/xray_fdr_logging.cc b/compiler-rt/lib/xray/xray_fdr_logging.cc
index be6b001dbfd..4b308b27fc4 100644
--- a/compiler-rt/lib/xray/xray_fdr_logging.cc
+++ b/compiler-rt/lib/xray/xray_fdr_logging.cc
@@ -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;
}
OpenPOWER on IntegriCloud