profiling behavior

Simon Marlow simonmar@microsoft.com
Tue, 13 Nov 2001 16:56:26 -0000


> > > If module A imports B, and if B was compiled without the
> > > profiling options
> > > (but A was), is the final program expected to abort (illegal
> > > operation or
> > > something like that)? If it is, why?
> >
> > You must compile (and link) the whole program with -prof,=20
> because that
> > option changes certain fundamental properties of the=20
> virtual machine.
> > If you link modules compiled in different ways, the behaviour is
> > unspecified ;-)
>=20
> Then I ask: if I have a compiled version of a Haskell=20
> binding/API/(something
> like that), without the profiling options, will I have to=20
> hack the source
> code of this binding/API/(something like that) and compile it again to
> enable profiling, even though I want to profile a part of a=20
> program that
> doesn't make any call to the binding/API/(something like=20
> that) functions?

Yes.  In order to compile your program with profiling, you also need
versions of all the libraries compiled for profiling (which is why you
get two versions of all the packages shipped with GHC).

Cheers,
	Simon