low-level profiling

Geoffrey Mainland gmainlan at microsoft.com
Fri Feb 15 20:55:33 CET 2013


Try invoking ghc with -optl-g?

Geoff

From: ghc-devs-bounces at haskell.org [mailto:ghc-devs-bounces at haskell.org] On Behalf Of Nicolas Frisby
Sent: Friday, February 15, 2013 7:41 PM
To: Johan Tibell
Cc: ghc-devs at haskell.org
Subject: Re: low-level profiling

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?



On Fri, Feb 15, 2013 at 7:18 PM, Nicolas Frisby <nicolas.frisby at gmail.com<mailto:nicolas.frisby at gmail.com>> wrote:
No, nothing fancy. It's just a nofib program.

I am seeing the .size directives in the .s files. And objdump -S gives output like this:

0000000000000368 <c2hw_info>:
 368: 48 83 e3 07           and    $0x7,%rbx
 36c: 48 83 fb 02           cmp    $0x2,%rbx
 370: 0f 83 96 00 00 00     jae    40c <c2hA_info+0x5c>
 376: 48 8b 45 08           mov    0x8(%rbp),%rax
...

so it's just perf that's going awry?

... investigating perf ...

This might be my issue:

http://us.generation-nt.com/answer/tip-perf-urgent-perf-symbols-handle-proc-sys-kernel-kptr-restrict-help-203499422.html

Now I just have to decode all of that!

On Fri, Feb 15, 2013 at 6:48 PM, Johan Tibell <johan.tibell at gmail.com<mailto:johan.tibell at gmail.com>> wrote:
On Fri, Feb 15, 2013 at 10:24 AM, Nicolas Frisby <nicolas.frisby at gmail.com<mailto:nicolas.frisby at gmail.com>> wrote:
I'm not passing any flags related to code generation, I don't think.

$HC -H64m -O -Rghc-timing -package array -H32m -hisuf hi -O1 -rtsopts -c Main.hs -o Main.o

So that'd just be the native code generator, right?.

$ uname -a
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

Is there a objdump-ish way to directly look for these .size directives?

Thanks Johan.

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?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130215/1e3e6aa1/attachment-0001.htm>


More information about the ghc-devs mailing list