profiling for stack usage

Simon Marlow
Mon, 18 Aug 2003 16:01:01 +0100

> >> 1. Is there a way to profile stack usage, so that I can=20
> identify the
> >> culprit and deal with the problem at the root?
> >  =20
> >=20
> > in particular, the -xt flag.
> Hmm, sorry for being so dense, but I'm having a tough time with this.
> It seems profiling by itself tends to blow the stack -- is that
> correct/normal behavior?  (I'm also using -O2, if that matters)

It is possible for profiling to change the stack behaviour,
unfortunately.  This is because certain optimisations are disabled when
profiling is on, so that we can retain useful profiling information (oh
the irony :-).

> Is there any way to know what kind of data resides on the stack, or
> what function generated it?  The TSO tells med its size, but isn't
> really helpful beyond that (or am I missing something?)

I'm afraid not, no.  We don't have a way to profile the contents of the
stack, only its size.