<div dir="ltr">Phabricator is having some problems (disk is full on hosting?), but I think you made a small but dangerous mistake.<div><br></div><div>Even if verbosity is off, you still want early return otherwise the code will try to init and possibly patch without an instrumentation map and likely blow up badly.</div><div><br></div><div>You want to scope the verbosity conditional to apply to just the Report() warning.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 24, 2017 at 2:35 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Test case? (possibly even a unit test, but at least I guess this could be tested in a more traditional compiler-rt test style too/instead)<br><br><div class="gmail_quote"><div><div class="h5"><div dir="ltr">On Mon, Jul 24, 2017 at 1:50 AM Dean Michael Berris via Phabricator via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">dberris created this revision.<br>
<br>
Currently when the XRay runtime is linked into a binary that doesn't<br>
have the instrumentation map, we print a warning unconditionally. This<br>
change attempts to make this behaviour more quiet.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D35789" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D35789</a><br>
<br>
Files:<br>
  lib/xray/xray_init.cc<br>
<br>
<br>
Index: lib/xray/xray_init.cc<br>
==============================<wbr>==============================<wbr>=======<br>
--- lib/xray/xray_init.cc<br>
+++ lib/xray/xray_init.cc<br>
@@ -48,7 +48,7 @@<br>
 // and then proceed to look for the .xray_instr_map section/segment.<br>
 void __xray_init() XRAY_NEVER_INSTRUMENT {<br>
   initializeFlags();<br>
-  if (__start_xray_instr_map == nullptr) {<br>
+  if (__start_xray_instr_map == nullptr && common_flags()->verbosity) {<br>
     Report("XRay instrumentation map missing. Not initializing XRay.\n");<br>
     return;<br>
   }<br>
<br>
<br></div></div>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div>
</blockquote></div><br></div>