[PATCH] D35789: [XRay][compiler-rt] Do not print the warning when the binary is not XRay instrumented.

Keith Wyss via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 19:31:15 PDT 2017


Phabricator is having some problems (disk is full on hosting?), but I think
you made a small but dangerous mistake.

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.

You want to scope the verbosity conditional to apply to just the Report()
warning.

On Mon, Jul 24, 2017 at 2:35 PM, David Blaikie <dblaikie at gmail.com> wrote:

> 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)
>
> On Mon, Jul 24, 2017 at 1:50 AM Dean Michael Berris via Phabricator via
> llvm-commits <llvm-commits at lists.llvm.org> wrote:
>
>> dberris created this revision.
>>
>> Currently when the XRay runtime is linked into a binary that doesn't
>> have the instrumentation map, we print a warning unconditionally. This
>> change attempts to make this behaviour more quiet.
>>
>>
>> https://reviews.llvm.org/D35789
>>
>> Files:
>>   lib/xray/xray_init.cc
>>
>>
>> Index: lib/xray/xray_init.cc
>> ===================================================================
>> --- lib/xray/xray_init.cc
>> +++ lib/xray/xray_init.cc
>> @@ -48,7 +48,7 @@
>>  // and then proceed to look for the .xray_instr_map section/segment.
>>  void __xray_init() XRAY_NEVER_INSTRUMENT {
>>    initializeFlags();
>> -  if (__start_xray_instr_map == nullptr) {
>> +  if (__start_xray_instr_map == nullptr && common_flags()->verbosity) {
>>      Report("XRay instrumentation map missing. Not initializing XRay.\n");
>>      return;
>>    }
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170724/7efa0f9a/attachment.html>


More information about the llvm-commits mailing list