[compiler-rt] r342355 - [XRay] Fix FDR initialization

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 16 19:49:18 PDT 2018


Author: dberris
Date: Sun Sep 16 19:49:17 2018
New Revision: 342355

URL: http://llvm.org/viewvc/llvm-project?rev=342355&view=rev
Log:
[XRay] Fix FDR initialization

Follow-up to D51606.

Modified:
    compiler-rt/trunk/lib/xray/xray_fdr_logging.cc

Modified: compiler-rt/trunk/lib/xray/xray_fdr_logging.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/xray/xray_fdr_logging.cc?rev=342355&r1=342354&r2=342355&view=diff
==============================================================================
--- compiler-rt/trunk/lib/xray/xray_fdr_logging.cc (original)
+++ compiler-rt/trunk/lib/xray/xray_fdr_logging.cc Sun Sep 16 19:49:17 2018
@@ -1203,11 +1203,22 @@ bool fdrLogDynamicInitializer() XRAY_NEV
   };
   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;
 }
 




More information about the llvm-commits mailing list