<div dir="ltr"><div>Thanks for rallying everyone! I made a bit of a breakthrough while trying to pinpoint where the linker is invoked.</div><div> </div><div>Here&#39;s the situation:</div><div> </div><div>  * If I use nofib&#39;s &quot;make&quot; command to build the text, the executable does not have the function symbols in its .text section. The .o files do have them.</div>

<div> </div><div>  * If I use ghc --make instead, the symbols survive in the executable.</div><div> </div><div>I&#39;m not up to sleuthing out the details at the moment. Should I open a Trac ticket?</div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Fri, Feb 15, 2013 at 7:55 PM, Geoffrey Mainland <span dir="ltr">&lt;<a href="mailto:gmainlan@microsoft.com" target="_blank">gmainlan@microsoft.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">







<div lang="EN-US" vlink="purple" link="blue">
<div>
<p class="MsoNormal"><span style="color:rgb(31,73,125);font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;font-size:11pt">Try invoking ghc with -optl-g?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125);font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125);font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;font-size:11pt">Geoff<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125);font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;font-size:10pt">From:</span></b><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;font-size:10pt"> <a href="mailto:ghc-devs-bounces@haskell.org" target="_blank">ghc-devs-bounces@haskell.org</a> [mailto:<a href="mailto:ghc-devs-bounces@haskell.org" target="_blank">ghc-devs-bounces@haskell.org</a>]
<b>On Behalf Of </b>Nicolas Frisby<br>
<b>Sent:</b> Friday, February 15, 2013 7:41 PM<br>
<b>To:</b> Johan Tibell<br>
<b>Cc:</b> <a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<b>Subject:</b> Re: low-level profiling<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">Ah, looks like the symbol information exists in the .o files, but not in my actual executable. Could I invoke ld manually with some incantation to preserve the function symbols?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Fri, Feb 15, 2013 at 7:18 PM, Nicolas Frisby &lt;<a href="mailto:nicolas.frisby@gmail.com" target="_blank">nicolas.frisby@gmail.com</a>&gt; wrote:<u></u><u></u></p>
<div>
<div>
<div>
<p class="MsoNormal">No, nothing fancy. It&#39;s just a nofib program.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal">I am seeing the .size directives in the .s files. And objdump -S gives output like this:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">0000000000000368 &lt;c2hw_info&gt;:<br>
 368: 48 83 e3 07           and    $0x7,%rbx<br>
 36c: 48 83 fb 02           cmp    $0x2,%rbx<br>
 370: 0f 83 96 00 00 00     jae    40c &lt;c2hA_info+0x5c&gt;<br>
 376: 48 8b 45 08           mov    0x8(%rbp),%rax<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">...<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">so it&#39;s just perf that&#39;s going awry? <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">... investigating perf ...<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">This might be my issue:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="http://us.generation-nt.com/answer/tip-perf-urgent-perf-symbols-handle-proc-sys-kernel-kptr-restrict-help-203499422.html" target="_blank">http://us.generation-nt.com/answer/tip-perf-urgent-perf-symbols-handle-proc-sys-kernel-kptr-restrict-help-203499422.html</a><u></u><u></u></p>


</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Now I just have to decode all of that!<u></u><u></u></p>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Fri, Feb 15, 2013 at 6:48 PM, Johan Tibell &lt;<a href="mailto:johan.tibell@gmail.com" target="_blank">johan.tibell@gmail.com</a>&gt; wrote:<u></u><u></u></p>
<div>
<p class="MsoNormal">On Fri, Feb 15, 2013 at 10:24 AM, Nicolas Frisby &lt;<a href="mailto:nicolas.frisby@gmail.com" target="_blank">nicolas.frisby@gmail.com</a>&gt; wrote:<u></u><u></u></p>
</div>
<div>
<div>
<blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentColor currentColor currentColor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-right:0in;margin-left:4.8pt">


<div>
<div>
<p class="MsoNormal">I&#39;m not passing any flags related to code generation, I don&#39;t think.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">$HC -H64m -O -Rghc-timing -package array -H32m -hisuf hi -O1 -rtsopts -c Main.hs -o Main.o<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">So that&#39;d just be the native code generator, right?.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">$ uname -a<br>
Linux cam-05-unx 3.2.0-35-generic #55-Ubuntu SMP Wed Dec 5 17:42:16 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Is there a objdump-ish way to directly look for these .size directives?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks Johan.<u></u><u></u></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<div>
<p class="MsoNormal">If you tell GHC to keep all temporary file you could look in the .S files for the .size directive. It could be that I missed some place where we ought to put a .size directive. Are you doing dynamic linking? <u></u><u></u></p>


</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>

</blockquote></div><br></div>