SPP Task Profiling
Mike Fitzpatrick wrote on Oct 01, 1998
> What do I need to do to be able to "profile" an SPP program? (i.e.
> determine what fraction of time is spent in each routine?)
You need to compile with a host compiler "-p" flag to enable
profiling. For an SPP program you must escape the flag so it's
passed to the host and not read by the XC compiler itself ('-p' is used by
XC to load a package environment. For example, on a command line use
% xc -c -/p foo.x
In a mkpkg file you could reset the XFLAGS to include this, e.g.
libpkg.a:
$set XFLAGS = "$(XFLAGS) -/p -F"
foo.x
:
would reset XFLAGS prior to compiling any of the objects in the libpkg.a,
the above also sets the flags for keeping the intermediate fortran source
around. Lastly, because of the way the profile info is dumped and the
way IRAF shuts down, you'll need to put the following as the last line of
your SPP program:
call exit_(0)
This exit call dumps the profiling output to 'mon.out'
Once you have the executable you would run 'prof' on the binary
at the host level. To do this you'll need the task parameters as would be
generated by 'dpar'. For example,
cl> dpar foo > foo.dpar
.....get out of the CL
% x_foo.e foo @foo.dpar # run the task from the csh
% prof x_foo.e # dump profiling info
These details vary a bit between platforms but this should be what you need
for Solaris. Let me know if you have any problems.
Cheers,
-Mike
Last post on Oct 01, 1998