low-level profiling

Johan Tibell johan.tibell at gmail.com
Fri Feb 15 19:18:33 CET 2013


On Fri, Feb 15, 2013 at 10:05 AM, Nicolas Frisby
<nicolas.frisby at gmail.com>wrote:

> I'm way below my depth here, but I'd like to use the perf tool to see
> where a program is spending its time.
>
> Unfortunately, the recipe here
>
> http://hackage.haskell.org/trac/ghc/wiki/Debugging/LowLevelProfiling/Perf
>
> isn't working for me. I get output like this instead
>
> 90.20%  drbg_test  drbg_test          [.] 0x2515ef
>   5.71%  drbg_test  [kernel.kallsyms]  [k] 0xffffffff8103e0ca
>   1.53%  drbg_test  libc-2.15.so       [.] bsearch
>   1.02%  drbg_test  libc-2.15.so       [.] 0x9194c
>   0.43%  drbg_test  libgmp.so.10.0.2   [.] __gmpz_mul_2exp
>   0.27%  drbg_test  libgmp.so.10.0.2   [.] __gmpz_add
>   0.16%  drbg_test  [vdso]             [.] 0x7fffd3d25983
>   0.16%  drbg_test  libgmp.so.10.0.2   [.] __gmpn_lshift
>   0.10%  drbg_test  libgmp.so.10.0.2   [.] 0x13565
>   0.05%  drbg_test  libgmp.so.10.0.2   [.] __gmpz_init
>   0.05%  drbg_test  libc-2.15.so       [.] __select
>   0.05%  drbg_test  libgmp.so.10.0.2   [.] __gmpn_modexact_1_odd
>   0.05%  drbg_test  libgmp.so.10.0.2   [.] __gmpz_realloc
>   0.05%  drbg_test  libc-2.15.so       [.] __errno_location
>   0.05%  drbg_test  drbg_test          [.] __gmpz_init at plt
>   0.05%  drbg_test  librt-2.15.so      [.] clock_gettime
>   0.05%  drbg_test  libgmp.so.10.0.2   [.] __gmpn_add_n
>
> Again --- below my depth here --- but I don't know how to investigate what
> 0x2515ef indicates. Does anyone have any pointers?
>
> I was hoping that the address would be a nice RTS-ish symbol, like in the
> Wiki's examples.
>

I thought I fixed this issue (at least in the native backend). What was
missing before was .size assembler directives that would let tools like
perf know where a function started and ended. See this commit
https://github.com/ghc/ghc/commit/32f24ddfd9549010dd345733c6f46f67196cacf6

Perhaps it broke at some point? Are you using the x86 backend?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130215/353a87c6/attachment.htm>


More information about the ghc-devs mailing list