[MLton-devel] New release of MLton: call-graphs

Matthew Fluet MLton@mlton.org
Fri, 21 Mar 2003 11:32:42 -0500 (EST)


> Having now carefully read the semantics of -ignore, I think its
> behaviour is a bit simplistic. In the following situation:
>
> fun f1 x = (g1 o h1) x;
> fun f2 x = (g2 o h2) x;
>
> I'd really like -ignore "o" to produce (solid) edges in the call graph
> from f1 to g1 and h1, and from f2 to g2 and h2. But from my reading of
> section 6.2 (and as I've verified in the appended program), it seems
> that it also adds edges from f1 to g2 and h2, and from f2 to g1 and
> h1. This would explain why my call-graphs seem to contain many more
> edges than I'd expect. Would it be possible for -ignore to be
> implemented the way I'd like?

In this specific instance, you can get the desired behavior by compiling
your program with -profile-split "o" and then running mlprof with -ignore
"o".  However, this only works because o is inlined, hence duplicated by
the compiler, and each instance can be counted separately in separate call
stacks.

You'll notice that if you compile the program without -profile-split "o"
and run mlprof without -ignore "o", that there will be exactly one
instance of "o" in the call-graph, with incoming edges from f1 and f2 and
outgoing edges to g1, h2, g2, and h2.  If you ignore "o", there is no way
to recover the fact that calls to f1 thru o only reach g1 and h1, while
calls to f2 thru o only reach g2 and h2.




-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel