<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 6/27/2017 2:41 PM, <a class="moz-txt-link-abbreviated" href="mailto:vsk@apple.com">vsk@apple.com</a>
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:F12A400A-6D6C-4625-85CD-B074DEDA2D18@apple.com">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <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>
    I'm using the default set of targets for now (DLLVM_TARGETS_TO_BUILD
    not specified).<br>
    <br>
    <blockquote type="cite"
      cite="mid:F12A400A-6D6C-4625-85CD-B074DEDA2D18@apple.com">
      <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>
    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).<br>
    <br>
    I'll experiment a bit more.<br>
    <br>
    -Eli<br>
    <br>
    <blockquote type="cite"
      cite="mid:F12A400A-6D6C-4625-85CD-B074DEDA2D18@apple.com">
      <div class=""><br class="">
      </div>
      <div class=""><br class="">
      </div>
      <div>
        <blockquote type="cite" class="">
          <div class="">On Jun 27, 2017, at 2:40 PM, Friedman, Eli <<a
              href="mailto:efriedma@codeaurora.org" class=""
              moz-do-not-send="true">efriedma@codeaurora.org</a>>
            wrote:</div>
          <br class="Apple-interchange-newline">
          <div class="">
            <meta http-equiv="Content-Type" content="text/html;
              charset=utf-8" class="">
            <div text="#000000" bgcolor="#FFFFFF" class="">
              <div class="moz-cite-prefix">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="">
              </div>
            </div>
          </div>
        </blockquote>
        <div><br class="">
        </div>
        <div>This looks compressed to me.</div>
        <div><br class="">
        </div>
        <div>vedant</div>
        <div><br class="">
        </div>
        <br class="">
        <blockquote type="cite" class="">
          <div class="">
            <div text="#000000" bgcolor="#FFFFFF" class="">
              <div class="moz-cite-prefix"> <br class="">
                -Eli<br class="">
                <br class="">
                On 6/27/2017 2:32 PM, Xinliang David Li wrote:<br
                  class="">
              </div>
              <blockquote type="cite"
cite="mid:CAAkRFZK9fN2jvL9-T9Sd=nRdjk7eDzJndXU87kRUxx9Ud7bXdw@mail.gmail.com"
                class="">
                <div dir="ltr" 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.
                  <div class=""><br class="">
                  </div>
                  <div class="">What do you see when </div>
                  <div class=""><br class="">
                  </div>
                  <div class="">readelf --string-dump=__llvm_prf_names
                    llc</div>
                  <div class=""><br class="">
                  </div>
                  <div class="">David</div>
                </div>
                <div class="gmail_extra"><br class="">
                  <div class="gmail_quote">On Tue, Jun 27, 2017 at 2:23
                    PM, Xinliang David Li <span dir="ltr" class=""><<a
                        href="mailto:davidxl@google.com" target="_blank"
                        moz-do-not-send="true" class="">davidxl@google.com</a>></span>
                    wrote:<br class="">
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div dir="ltr" class=""><br class="">
                        <div class="gmail_extra"><br class="">
                          <div class="gmail_quote"><span class="">On
                              Tue, Jun 27, 2017 at 2:09 PM, Friedman,
                              Eli <span dir="ltr" class=""><<a
                                  href="mailto:efriedma@codeaurora.org"
                                  target="_blank" moz-do-not-send="true"
                                  class="">efriedma@codeaurora.org</a>></span>
                              wrote:<br class="">
                              <blockquote class="gmail_quote"
                                style="margin:0 0 0 .8ex;border-left:1px
                                #ccc solid;padding-left:1ex">
                                <div text="#000000" bgcolor="#FFFFFF"
                                  class=""><span class="">
                                    <div
                                      class="m_-8320681835050143414m_-4689985255915253797moz-cite-prefix">On
                                      6/27/2017 1:47 PM, Xinliang David
                                      Li wrote:<br class="">
                                    </div>
                                    <blockquote type="cite" class="">
                                      <div dir="ltr" class=""><br
                                          class="">
                                        <div class="gmail_extra"><br
                                            class="">
                                          <div class="gmail_quote">On
                                            Mon, Jun 26, 2017 at 7:24
                                            PM, Friedman, Eli <span
                                              dir="ltr" class=""><<a
href="mailto:efriedma@codeaurora.org" target="_blank"
                                                moz-do-not-send="true"
                                                class="">efriedma@codeaurora.org</a>></span>
                                            wrote:<br class="">
                                            <blockquote
                                              class="gmail_quote"
                                              style="margin:0 0 0
                                              .8ex;border-left:1px #ccc
                                              solid;padding-left:1ex">
                                              <div text="#000000"
                                                bgcolor="#FFFFFF"
                                                class=""><span class="">
                                                  <div
class="m_-8320681835050143414m_-4689985255915253797m_-8178743545387745684moz-cite-prefix">On
                                                    6/19/2017 7:29 PM,
                                                    Vedant Kumar wrote:<br
                                                      class="">
                                                  </div>
                                                  <blockquote
                                                    type="cite" class=""><br
                                                      class="">
                                                    <div class="">
                                                      <blockquote
                                                        type="cite"
                                                        class="">
                                                        <div class="">
                                                          <div
                                                          text="#000000"
bgcolor="#FFFFFF" class="">
                                                          <blockquote
                                                          type="cite"
                                                          class="">
                                                          <div class="">
                                                          <div class="">
                                                          <div class="">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" moz-do-not-send="true" class="">llvm.org/PR33501</a>.</div>
                                                          <div class=""><br
                                                          class="">
                                                          </div>
                                                          <blockquote
                                                          type="cite"
                                                          class="">
                                                          <div class="">
                                                          <div class="">3.
                                                          The generated
                                                          profile
                                                          information
                                                          takes up a lot
                                                          of space: llc
                                                          generates a
                                                          90MB profraw
                                                          file.<br
                                                          class="">
                                                          </div>
                                                          </div>
                                                          </blockquote>
                                                          <div class=""><br
                                                          class="">
                                                          </div>
                                                          <div class="">I
                                                          don't have any
                                                          ideas about
                                                          how to fix
                                                          this. You can
                                                          decrease the
                                                          space overhead
                                                          for raw
                                                          profiles by
                                                          altering <span
                                                          class="">LLVM_PROFILE_</span><span
                                                          class="">MERGE_P</span><span
                                                          class="">O<wbr
                                                          class="">OL_SIZE
                                                          from 4 to a
                                                          lower value.</span></div>
                                                          </div>
                                                          </div>
                                                          </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="">
                                                          </div>
                                                        </div>
                                                      </blockquote>
                                                      <div class=""><br
                                                          class="">
                                                      </div>
                                                      <div class="">You
                                                        can speed up
                                                        "make check" a
                                                        bit by using
                                                        non-instrumented
                                                        versions of
                                                        count, not,
                                                        FileCheck, etc.</div>
                                                    </div>
                                                  </blockquote>
                                                  <br class="">
                                                </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
                                                  class="">
                                                <br class="">
                                              </div>
                                            </blockquote>
                                            <div class=""><br class="">
                                            </div>
                                            <div class="">Can you check
                                              if name compression is
                                              turned on in your build?
                                                </div>
                                            <div class=""><br class="">
                                            </div>
                                            <div class="">David</div>
                                            <br class="">
                                          </div>
                                        </div>
                                      </div>
                                    </blockquote>
                                    <br class="">
                                  </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 class=""><br class="">
                              </div>
                              <div class=""><br class="">
                              </div>
                            </span>
                            <div 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.</div>
                            <span class="HOEnZb"><font class=""
                                color="#888888">
                                <div class=""><br class="">
                                </div>
                                <div class="">David</div>
                              </font></span><span class="">
                              <blockquote class="gmail_quote"
                                style="margin:0 0 0 .8ex;border-left:1px
                                #ccc solid;padding-left:1ex">
                                <div text="#000000" bgcolor="#FFFFFF"
                                  class=""><span class=""><br class="">
                                    <p class="">-Eli<br class="">
                                    </p>
                                    <pre class="m_-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 class="">
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <br class="">
                </div>
              </blockquote>
              <p class=""><br class="">
              </p>
              <pre class="moz-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>
      <br class="">
    </blockquote>
    <p><br>
    </p>
    <pre class="moz-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>
  </body>
</html>