/*
LPC Profiling module; works by alarming every second
and gathering statistics on whether or not the stack
machine is executing at that time. If it is it determines
in what object:function and adds this to the profile
data. This data can be accessed via the PROFILE()
efun which returns the raw data for processing.
(oh well - you gotta use dumpallobj at the moment).
Geoff Wong, 1994
See the file "Copying" distributed with this file.
*/
/* It's not working yet :-) */
extern int executing;
/* this gets called by the alarm */
int doing_prog = 0, doing_other = 0;
profile()
{
if (executing) {
doing_prog++;
if (Scurrent()) Scurrent()->prof++;
}
else {
doing_other++;
}
signal(SIGUSR1, profile);
}