implementing profiling (mostly) in SML

Stephen Weeks MLton@sourcelight.com
Fri, 23 Mar 2001 10:08:07 -0800 (PST)


> The point is that the only thing that the signal handler does is grab the
> interrupted pc, check if it is in range, and if it is, increment an array
> entry.  Id on't see much gain in trying to do this in ML since it needs extra
> stuff anyway (like the interrupted pc).

I agree.  It was the other stuff (like writing the gmon file) that I thought
would be more robust and portable in SML.  Also, the possibility of making
profiling data available to the running program is nice.

At the very least, we should add "val MLton.profile: bool" and check it in
Itimer.set and report an error if someone is setting the profile timer.