Profiling options

Axel Simon Axel.Simon at ens.fr
Mon Dec 1 07:41:29 EST 2008


Hi all,

I'm trying to build a library with Cabal and then profile certain
modules. I'm not very proficient with profiling, so it might be
genuinely wrong what I'm doing.

I compile my library with --enable-library-profiling and at the moment
have

ghc-prof-options: -auto-all

in my cabal file. However, I only want to use -auto in one core module
since seeing all the other functions is just obfuscating the profile
since the costs are also accredited to callers of the functions that I
want to profile.

I tried to use {-# OPTIONS -auto #-} in the specific module but ghc
ignores this since -auto is a static option. Cabal, on the other hand,
does not allow me to add an option when compiling a specific module.

It it true that I'm stuck with using -auto on either all or no module
when I build my library using Cabal? The only thing on profiling and
Cabal I've found is Ticket #200, however, this ticket seems to advocate
that the user never needs any control over what is being profiled and
what is not.

So, is my attempt to profile a single module really a stupid idea or is
it Cabal that should provide better support for profiling individual
modules?

Thanks,
Axel.




More information about the Libraries mailing list