
Hi, I am profiling a Haskell program using GHC, and after executing the program with +RTS -p, I get a .prof file that lists the cost centers of the program. Some of the cost centers listed are for function symbols that do not exist in the given module. For example, I have in my .prof file: COST CENTRE MODULE %time %alloc ==_a2MT Foo 19.8 0.0 ==_a2R8 Foo 17.8 0.0 ==_a2Bg Bar 13.7 0.0 .... .... It appears these are generated symbols; how do I find out what those function symbols correspond to? (In this case, my assumption is that these symbols refer to instances of the Eq class, but I'm not sure.) [I couldn't find anything about this in the GHC online documentation or via Googling, but sorry if I missed it.] Thanks, Lee

Hi Lee,
I would also guess that these are probably the implementations of equality
in the given modules.
One way to test this would be to name the equality function explicitly. For
example, something like this:
myEquality x y = ...
instance Eq MyType where (==) = myEquality
Another option would be to look at the generated core by using -ddump-simpl
when compiling. This will generate a whole bunch of output, which you can
redirect to a file and the search for the mysterious symbols inside.
Hope this helps,
-Iavor
On Mon, Feb 7, 2011 at 11:12 PM, Lee Pike
Hi,
I am profiling a Haskell program using GHC, and after executing the program with +RTS -p, I get a .prof file that lists the cost centers of the program. Some of the cost centers listed are for function symbols that do not exist in the given module. For example, I have in my .prof file:
COST CENTRE MODULE %time %alloc ==_a2MT Foo 19.8 0.0 ==_a2R8 Foo 17.8 0.0 ==_a2Bg Bar 13.7 0.0 .... ....
It appears these are generated symbols; how do I find out what those function symbols correspond to? (In this case, my assumption is that these symbols refer to instances of the Eq class, but I'm not sure.)
[I couldn't find anything about this in the GHC online documentation or via Googling, but sorry if I missed it.]
Thanks, Lee
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Iavor, Thanks.
One way to test this would be to name the equality function explicitly. For example, something like this: myEquality x y = ... instance Eq MyType where (==) = myEquality
Good idea (but a little painful!).
Another option would be to look at the generated core by using -ddump-simpl when compiling. This will generate a whole bunch of output, which you can redirect to a file and the search for the mysterious symbols inside.
The symbols aren't in the core of the module I'm profiling---sorry, I didn't mention that the symbols are from an imported library (compiled with -auto-all, so the library symbols are included in the .prof). Is there a convenient way to dump core when building libraries with cabal? (--ghc-options=-ddump-simpl doesn't seem to do it). Anyway, I'll resort to your option #1. Thanks, Lee
Hi,
I am profiling a Haskell program using GHC, and after executing the program with +RTS -p, I get a .prof file that lists the cost centers of the program. Some of the cost centers listed are for function symbols that do not exist in the given module. For example, I have in my .prof file:
COST CENTRE MODULE %time %alloc ==_a2MT Foo 19.8 0.0 ==_a2R8 Foo 17.8 0.0 ==_a2Bg Bar 13.7 0.0 .... ....
It appears these are generated symbols; how do I find out what those function symbols correspond to? (In this case, my assumption is that these symbols refer to instances of the Eq class, but I'm not sure.)
[I couldn't find anything about this in the GHC online documentation or via Googling, but sorry if I missed it.]
Thanks, Lee
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

* Iavor Diatchki
Another option would be to look at the generated core by using -ddump-simpl when compiling. This will generate a whole bunch of output, which you can redirect to a file and the search for the mysterious symbols inside.
IIRC they are generated at random each time.
On Mon, Feb 7, 2011 at 11:12 PM, Lee Pike
wrote: Hi,
I am profiling a Haskell program using GHC, and after executing the program with +RTS -p, I get a .prof file that lists the cost centers of the program. Some of the cost centers listed are for function symbols that do not exist in the given module. For example, I have in my .prof file:
COST CENTRE MODULE %time %alloc ==_a2MT Foo 19.8 0.0 ==_a2R8 Foo 17.8 0.0 ==_a2Bg Bar 13.7 0.0 .... ....
It appears these are generated symbols; how do I find out what those function symbols correspond to? (In this case, my assumption is that these symbols refer to instances of the Eq class, but I'm not sure.)
[I couldn't find anything about this in the GHC online documentation or via Googling, but sorry if I missed it.]
-- Roman I. Cheplyaka :: http://ro-che.info/ Don't worry what people think, they don't do it very often.

On Tuesday 08 February 2011 22:18:14, Roman Cheplyaka wrote:
* Iavor Diatchki
[2011-02-07 23:45:58-0800] Another option would be to look at the generated core by using -ddump-simpl when compiling. This will generate a whole bunch of output, which you can redirect to a file and the search for the mysterious symbols inside.
IIRC they are generated at random each time.
Yes, but if you -ddump-simpl the profiling compilation, the profiling symbols should be those in the generated core, shouldn't they? Unfortunately, that won't help Lee since his mysterious symbols come from a library (unless he goes to the trouble of unpacking the library and recompiling it in his source tree to get the symbols).
On Mon, Feb 7, 2011 at 11:12 PM, Lee Pike
wrote: Hi,
I am profiling a Haskell program using GHC, and after executing the program with +RTS -p, I get a .prof file that lists the cost centers of the program. Some of the cost centers listed are for function symbols that do not exist in the given module. For example, I have in my .prof file:
COST CENTRE MODULE %time %alloc ==_a2MT Foo 19.8 0.0 ==_a2R8 Foo 17.8 0.0 ==_a2Bg Bar 13.7 0.0
participants (4)
-
Daniel Fischer
-
Iavor Diatchki
-
Lee Pike
-
Roman Cheplyaka