[llvm] r204496 - InstrProf: Read raw binary profile in llvm-profdata

Duncan P. N. Exon Smith dexonsmith at apple.com
Fri Mar 21 14:27:47 PDT 2014


On Mar 21, 2014, at 1:51 PM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:

> 
> On Mar 21, 2014, at 12:07 PM, Justin Bogner <mail at justinbogner.com> wrote:
> 
>> 
>>> Added: llvm/trunk/test/tools/llvm-profdata/binary.test
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-profdata/binary.test?rev=204496&view=auto==============================================================================
>>> --- llvm/trunk/test/tools/llvm-profdata/binary.test (added)
>>> +++ llvm/trunk/test/tools/llvm-profdata/binary.test Fri Mar 21 13:26:05 2014
>>> @@ -0,0 +1,15 @@
>>> +REGENERATE: You need a checkout of clang with compiler-rt to generate the
>>> +REGENERATE: binary file here.  These shell commands can be used to regenerate
>>> +REGENERATE: it.
>>> +REGENERATE:
>>> +REGENERATE: $ SRC=path/to/llvm
>>> +REGENERATE: $ CFE=$SRC/tools/clang
>>> +REGENERATE: $ TESTDIR=$SRC/test/tools/llvm-profdata
>>> +REGENERATE: $ CFE_TESTDIR=$CFE/test/Profile
>>> +REGENERATE: $ clang -o a.out -fprofile-instr-generate $CFE_TESTDIR/test/Profile/c-general.c
>>> +REGENERATE: $ LLVM_PROFILE_FILE=$TESTDIR/Inputs/binary.profdata ./a.out
>>> +REGENERATE: $ cp $CFE_TESTDIR/Inputs/c-general.profdata $TESTDIR/Inputs/binary-compare.profdata
>>> +
>>> +RUN: llvm-profdata show %p/Inputs/binary.profdata -o %t1
>>> +RUN: llvm-profdata show %p/Inputs/binary-compare.profdata -o %t2
>>> +RUN: diff -up %t1 %t2
>> 
>> Why include binary-compare.profdata at all? Use show on the
>> binary.profdata and pipe into filecheck, that way you (1) don't need to
>> include the text formatted version, and (2) get better error messages.
> 
> Good point.  I’ll fix this soon.

r204518





More information about the llvm-commits mailing list