<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 27, 2017 at 2:41 PM, <span dir="ltr"><<a href="mailto:vsk@apple.com" target="_blank">vsk@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>With llc, the size of the names section can vary widely depending on the value of -DLLVM_TARGETS_TO_BUILD.</div><div><br></div></div></blockquote><div><br></div><div>Sure.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div></div><div>Enabling coverage shouldn't increase the name section size much. I only see one place where this happens, and it's relatively cold:</div><div><a href="http://lab.llvm.org:8080/coverage/coverage-reports/llvm/coverage/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp.html#L512" target="_blank">http://lab.llvm.org:8080/<wbr>coverage/coverage-reports/<wbr>llvm/coverage/Users/<wbr>buildslave/jenkins/<wbr>sharedspace/clang-stage2-<wbr>coverage-R@2/llvm/lib/<wbr>Transforms/Instrumentation/<wbr>InstrProfiling.cpp.html#L512</a></div><div><br></div></div></blockquote><div><br></div><div><br></div><div>What is the data set used to create the coverage data there? Looks like the lower Coverage function is called 6 times (aka only 6 modules have coverage data) and on average, each coverage data only references ~2 names. This does not seem typical.</div><div><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div></div><div><br></div><div><span class=""><blockquote type="cite"><div>On Jun 27, 2017, at 2:40 PM, Friedman, Eli <<a href="mailto:efriedma@codeaurora.org" target="_blank">efriedma@codeaurora.org</a>> wrote:</div><br class="m_4509745092729201675Apple-interchange-newline"><div>
<div text="#000000" bgcolor="#FFFFFF">
<div class="m_4509745092729201675moz-cite-prefix">I get a bunch of unreadable binary.
Output piped to "less":<br>
<br>
String dump of section '__llvm_prf_names':<br>
[ 2]
#<CA>^Ex<DA><D4>is<E3>(^Z<EF>^<wbr>O<DD>^P<A9><D5><F7><9B><CB><<wbr>FB><A8>d<97>^U<96>O<9F><89><<wbr>FB><85>AQ<B4>M<B5><B6>&)Wy~<<wbr>FD>C^B\<B0>/$<A5><EA>s<E3><CE><wbr>L<97>E$^R<89>Dn<C8>L<84><FF><br>
<EF><C7>h<B7><FB><DC>ߊ,=<BC><<wbr>BF>$ow~<B0>\<C4><FF>_X<FE><E0><wbr><C7><D1>&<C9>c<F4><E7>^_<AB><<wbr>B0><F9>,`<BE>H^Oi1G<BF>{<E3><<wbr>D7>({O<8A><E7>S<91>^^^O<B9>7<<wbr>BB><CD><F7><F3>C^d<E7>}r("<F8><wbr>c^P
P<83><br>
<D0><F3>`T^Z<ED><D2><FF>M<B2><<wbr>F9>k^X^D/<8B><D5>8<A4><E1>N><<wbr>A3><DD>9<C9><E7><DF><F1><F7>c^<wbr>B38<9C><F7>^<BF><C2>ߕ^_<D6><<wbr>F0>_<F2><BB>]<94><E7><C1><FD><<wbr>E9><95>^A3<<9E>^\<B0>{\^O0<CC><wbr><C9>)<CA>r<84><D9>j^H<B3><DC><<wbr>F9><F3><EF><B7><FE>
<8C><E1>'L^Q<C9>"<F0><A7>"><<wbr>E8><FF><DD>^^V^R<A4><D6><FC>d<<wbr>EB>j*oHO<D5>^F<C2>p<D0>^U<82><<wbr>EF>^Y!<90><9D>O5;:^TgL<F9>^Y<<wbr>D3>z<D5>#=<81><E1><C3>6<C4>^\<wbr>u%<85>7<EE>^Jaf^D0C<8B><8C>r^<wbr>D^E<9D><B5>^W^L<A3>dx<FA><A3><wbr>1<FE><88>l^OO<AB>^Z<80>^\~^I<<wbr>EE><DE>^O>]V~c<C9>^D<B7><88>[<wbr>4|0^R<89><B5>ʳ<96><D7>Ӽ<E7><<wbr>F9>^D<EB>^<BF><A5><9B>Mr^Ht<<wbr>CC>A^PP<EF><br>
<8D>n<BA><89>q<91><DE><br></div></div></div></blockquote><div><br></div></span><div>This looks compressed to me.</div><span class="HOEnZb"><font color="#888888"><div><br></div></font></span></div></div></blockquote><div><br></div><div>Yes.</div><div><br></div><div>David</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span class="HOEnZb"><font color="#888888"><div></div><div>vedant</div></font></span><div><div class="h5"><div><br></div><br><blockquote type="cite"><div><div text="#000000" bgcolor="#FFFFFF"><div class="m_4509745092729201675moz-cite-prefix">
<br>
-Eli<br>
<br>
On 6/27/2017 2:32 PM, Xinliang David Li wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">I had an old build of llc with FE instrumentation,
the name section size is about 5MB. Using coverage is likely to
cause the name section to be larger as there are more references
to dead/unused function names.
<div><br>
</div>
<div>What do you see when </div>
<div><br>
</div>
<div>readelf --string-dump=__llvm_prf_names llc</div>
<div><br>
</div>
<div>David</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Jun 27, 2017 at 2:23 PM,
Xinliang David Li <span dir="ltr"><<a href="mailto:davidxl@google.com" target="_blank">davidxl@google.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"><br>
<div class="gmail_extra"><br>
<div class="gmail_quote"><span>On Tue, Jun 27,
2017 at 2:09 PM, Friedman, Eli <span dir="ltr"><<a href="mailto:efriedma@codeaurora.org" target="_blank">efriedma@codeaurora.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"><span>
<div class="m_4509745092729201675m_-8320681835050143414m_-4689985255915253797moz-cite-prefix">On
6/27/2017 1:47 PM, Xinliang David Li wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr"><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Jun 26,
2017 at 7:24 PM, Friedman, Eli <span dir="ltr"><<a href="mailto:efriedma@codeaurora.org" target="_blank">efriedma@codeaurora.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"><span>
<div class="m_4509745092729201675m_-8320681835050143414m_-4689985255915253797m_-8178743545387745684moz-cite-prefix">On
6/19/2017 7:29 PM, Vedant
Kumar wrote:<br>
</div>
<blockquote type="cite"><br>
<div>
<blockquote type="cite">
<div>
<div text="#000000" bgcolor="#FFFFFF">
<blockquote type="cite">
<div>
<div>
<div>We can
reduce testing
time by *not*
instrumented
basic tools
like count,
not, FileCheck
etc. I filed:
<a href="http://llvm.org/PR33501" target="_blank">llvm.org/PR33501</a>.</div>
<div><br>
</div>
<blockquote type="cite">
<div>
<div>3. The
generated
profile
information
takes up a lot
of space: llc
generates a
90MB profraw
file.<br>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>I don't
have any ideas
about how to
fix this. You
can decrease
the space
overhead for
raw profiles
by altering <span>LLVM_PROFILE_</span><span>MERGE_P</span><span>O<wbr>OL_SIZE
from 4 to a
lower value.</span></div>
</div>
</div>
</blockquote>
<br>
Disk space is cheap,
but the I/O takes a
long time. I guess
it's specifically bad
for LLVM's "make
check", maybe not so
bad for other cases.<br>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>You can speed up "make
check" a bit by using
non-instrumented versions
of count, not, FileCheck,
etc.</div>
</div>
</blockquote>
<br>
</span> I tried looking into this
a bit more. It looks like the
profile data file generated by llc
contains approximately 5MB of
counters (__llvm_prf_cnts), 10MB
of "data" (__llvm_prf_data), and
70MB of __llvm_prf_names.
__llvm_prf_data and
__llvm_prf_names contain which can
be read from the original binary,
as far as I can tell. The 80MB of
data wouldn't be a big deal if it
were just sitting on disk... but
we also erase the whole file and
rewrite it from scratch after we
merge profile counters.<br>
<br>
</div>
</blockquote>
<div><br>
</div>
<div>Can you check if name compression
is turned on in your build? </div>
<div><br>
</div>
<div>David</div>
<br>
</div>
</div>
</div>
</blockquote>
<br>
</span> I think it is. At least, I didn't
intentionally turn it off, and examining the
file with objdump I don't see any uncompressed
strings. Not sure if there's any easy way to
confirm that.</div>
</blockquote>
<div><br>
</div>
<div><br>
</div>
</span>
<div>Just a little surprised at the size of
__llvm_prf_names section. The llc I built with IR
PGO has a __llvm_prf_names section with size
~1.4MB. I expect FE instrumentation to produce
larger name section size, but not so much bigger.</div>
<span class="m_4509745092729201675HOEnZb"><font color="#888888">
<div><br>
</div>
<div>David</div>
</font></span><span>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"><span><br><p>-Eli<br>
</p>
<pre class="m_4509745092729201675m_-8320681835050143414m_-4689985255915253797moz-signature" cols="72">--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre>
</span></div>
</blockquote>
</span></div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote><p><br>
</p>
<pre class="m_4509745092729201675moz-signature" cols="72">--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre>
</div>
</div></blockquote></div></div></div><br></div></blockquote></div><br></div></div>