<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 27, 2017, at 3:20 PM, Friedman, Eli <<a href="mailto:efriedma@codeaurora.org" class="">efriedma@codeaurora.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="moz-cite-prefix" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">On 6/27/2017 2:41 PM,<span class="Apple-converted-space"> </span><a class="moz-txt-link-abbreviated" href="mailto:vsk@apple.com">vsk@apple.com</a><span class="Apple-converted-space"> </span>wrote:<br class=""></div><blockquote type="cite" cite="mid:F12A400A-6D6C-4625-85CD-B074DEDA2D18@apple.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><div class="">With llc, the size of the names section can vary widely depending on the value of -DLLVM_TARGETS_TO_BUILD.</div></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); float: none; display: inline !important;" class="">I'm using the default set of targets for now (DLLVM_TARGETS_TO_BUILD not specified).</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><blockquote type="cite" cite="mid:F12A400A-6D6C-4625-85CD-B074DEDA2D18@apple.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><div class="">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 class=""><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" class="" moz-do-not-send="true">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</a></div></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); float: none; display: inline !important;" class="">Are you sure it's actually rare in practice?  I can get roughly 20KB of data in the name section of an object file just by including llvm/IR/Module.h (without any other code in the file).</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""></div></blockquote><div><br class=""></div><div>Hm, I looked at CoverageMappingGen.cpp.o and found that enabling coverage increases the size of the profile names section from 21K to 254K. It's more common than I expected.</div><div><br class=""></div><div>vedant</div></div><div class=""><span class=""><br class=""><blockquote type="cite" class=""><br class="">I'll experiment a bit more.<br class=""><br class="">-Eli<br class=""><br class=""><blockquote type="cite" cite="mid:F12A400A-6D6C-4625-85CD-B074DEDA2D18@apple.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><br class=""><br class=""><blockquote type="cite" class="">On Jun 27, 2017, at 2:40 PM, Friedman, Eli <<a href="mailto:efriedma@codeaurora.org" class="">efriedma@codeaurora.org</a>> wrote:<br class=""><br class="">I get a bunch of unreadable binary.  Output piped to "less":<br class=""><br class="">String dump of section '__llvm_prf_names':<br class="">  [     2]  #<CA>^Ex<DA><D4>is<E3>(^Z<EF>^O<DD>^P<A9><D5><F7><9B><CB><FB><A8>d<97>^U<96>O<9F><89><FB><85>AQ<B4>M<B5><B6>&)Wy~<FD>C^B\<B0>/$<A5><EA>s<E3><CE>L<97>E$^R<89>Dn<C8>L<84><FF><br class=""><EF><C7>h<B7><FB><DC>ߊ,=<BC><BF>$ow~<B0>\<C4><FF>_X<FE><E0><C7><D1>&<C9>c<F4><E7>^_<AB><B0><F9>,`<BE>H^Oi1G<BF>{<E3><D7>({O<8A><E7>S<91>^^^O<B9>7<BB><CD><F7><F3>C^d<E7>}r("<F8>c^P P<83><br class=""><D0><F3>`T^Z<ED><D2><FF>M<B2><F9>k^X^D/<8B><D5>8<A4><E1>N><A3><DD>9<C9><E7><DF><F1><F7>c^B38<9C><F7>^<BF><C2>ߕ^_<D6><F0>_<F2><BB>]<94><E7><C1><FD><E9><95>^A3<<9E>^\<B0>{\^O0<CC><C9>)<CA>r<84><D9>j^H<B3><DC><F9><F3><EF><B7><FE> <8C><E1>'L^Q<C9>"<F0><A7>"><E8><FF><DD>^^V^R<A4><D6><FC>d<EB>j*oHO<D5>^F<C2>p<D0>^U<82><EF>^Y!<90><9D>O5;:^TgL<F9>^Y<D3>z<D5>#=<81><E1><C3>6<C4>^\u%<85>7<EE>^Jaf^D0C<8B><8C>r^D^E<9D><B5>^W^L<A3>dx<FA><A3>1<FE><88>l^OO<AB>^Z<80>^\~^I<EE><DE>^O>]V~c<C9>^D<B7><88>[4|0^R<89><B5>ʳ<96><D7>Ӽ<E7><F9>^D<EB>^<BF><A5><9B>Mr^Ht<CC>A^PP<EF><br class=""><8D>n<BA><89>q<91><DE><br class=""></blockquote><br class="">This looks compressed to me.<br class=""><br class="">vedant<br class=""><br class=""><br class=""><blockquote type="cite" class=""><br class="">-Eli<br class=""><br class="">On 6/27/2017 2:32 PM, Xinliang David Li wrote:<br class=""><blockquote type="cite" cite="mid:CAAkRFZK9fN2jvL9-T9Sd=nRdjk7eDzJndXU87kRUxx9Ud7bXdw@mail.gmail.com" class="">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.<br class=""><br class="">What do you see when <br class=""><br class="">readelf --string-dump=__llvm_prf_names llc<br class=""><br class="">David<br class=""><br class="">On Tue, Jun 27, 2017 at 2:23 PM, Xinliang David Li <<a href="mailto:davidxl@google.com" class="">davidxl@google.com</a>> wrote:<br class=""><br class=""><br class="">On Tue, Jun 27, 2017 at 2:09 PM, Friedman, Eli <efriedma@codeaurora.org> wrote:<br class="">On 6/27/2017 1:47 PM, Xinliang David Li wrote:<br class=""><blockquote type="cite" class=""><br class=""><br class="">On Mon, Jun 26, 2017 at 7:24 PM, Friedman, Eli <efriedma@codeaurora.org> wrote:<br class="">On 6/19/2017 7:29 PM, Vedant Kumar wrote:<br class=""><blockquote type="cite" class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">We can reduce testing time by *not* instrumented basic tools like count, not, FileCheck etc. I filed: llvm.org/PR33501.<br class=""><br class=""><blockquote type="cite" class="">3. The generated profile information takes up a lot of space: llc generates a 90MB profraw file.<br class=""></blockquote><br class="">I don't have any ideas about how to fix this. You can decrease the space overhead for raw profiles by altering LLVM_PROFILE_MERGE_POOL_SIZE from 4 to a lower value.<br class=""></blockquote><br class="">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 class=""></blockquote><br class="">You can speed up "make check" a bit by using non-instrumented versions of count, not, FileCheck, etc.<br class=""></blockquote><br class="">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 class=""><br class=""><br class="">Can you check if name compression is turned on in your build?   <br class=""><br class="">David<br class=""><br class=""></blockquote><br class="">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.<br class=""><br class=""><br class="">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.<br class=""><br class="">David<br class=""><br class="">-Eli<br class=""><br class=""><div class="">-- </div><div class="">Employee of Qualcomm Innovation Center, Inc.</div><div class="">Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</div><br class=""><br class=""><br class=""></blockquote><br class=""><br class=""><div class="">-- </div><div class="">Employee of Qualcomm Innovation Center, Inc.</div><div class="">Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</div><br class=""></blockquote><br class=""></blockquote><br class=""><br class=""><div class="">-- </div><div class="">Employee of Qualcomm Innovation Center, Inc.</div><div class="">Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</div><br class=""></blockquote></span><br class=""></div></body></html>