<div class="gmail_quote">On Fri, Nov 11, 2011 at 11:45 AM, reed kotler <span dir="ltr"><<a href="mailto:rkotler@mips.com">rkotler@mips.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<u></u>

  
    
  
  <div bgcolor="#ffffff" text="#000000"><div><div class="h5">
    On 11/11/2011 11:39 AM, Chandler Carruth wrote:
    <blockquote type="cite">
      
      <div class="gmail_quote">On Fri, Nov 11, 2011 at 11:36 AM, reed
        kotler <span dir="ltr"><<a href="mailto:rkotler@mips.com" target="_blank">rkotler@mips.com</a>></span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
          Is anybody using the google heap profiler to analyze
          clang/llvm ??<br>
          <br>
          <a href="http://google-perftools.googlecode.com/svn/trunk/doc/heapprofile.html" target="_blank">http://google-perftools.googlecode.com/svn/trunk/doc/heapprofile.html</a><br>
          <br>
          If so, do you know how to modify the build scripts to enable
          that.<br>
          <br>
          Tia.</blockquote>
        <div><br>
        </div>
        <div>I have tried to use this in the past without terribly much
          success. Instead, I usually use Valgrind to analyze the
          allocation patterns: <a href="http://valgrind.org/docs/manual/ms-manual.html" target="_blank">http://valgrind.org/docs/manual/ms-manual.html</a> </div>
      </div>
    </blockquote></div></div>
    I've been using valgrind too. It seems to work fine.<br>
    <br>
    I need to independently validate some numbers though because the
    answer has big implications for some planning we are doing.</div></blockquote><div><br></div><div>In the past I have use the Google perf tools by using LDPRELOAD to inject them into the running binary.</div><div><br>
</div><div>Note that the subprocess-ing can impact things, you need to drop down to the cc1 invocation first.</div><div><br></div><div>Still, I have found that the heap profiling in these tools is strictly inferior to massif. I'd trust it. There are lots of flags you can give to massif to cause it to be very very accurate despite being quite slow. Do those help?</div>
<div><br></div><div>You can also look at the '-print-stats' option (or something like that) which prints out internal allocation stats for various significant parts of Clang, and might be able to correlate the two to gain confidence. </div>
</div>