iprofile.icn: Program to profile Icon procedure usage

May 2, 2001; Richard L. Goerwitz
Requires: co-expressions, keyboard functions, pipes, UNIX
This file is in the public domain.
This very simple profiler takes a single argument - an Icon program
compiled with the -t option.  Displays stats on which procedures
were called the most often, and from what lines in what files they
were called.  Use this program to figure out what procedures are
getting worked the hardest and why.  Counts only invocations and
resumptions; not suspensions, returns, failures.

If you are running a program that reads from a file, be sure to
protect the redirection symbol from the shell (i.e. "profile
'myprog < input'" instead of "profile myprog < input").  If a given
program normally reads &input, please redirect stdin to read from
another tty than the one you are running profile from.  If you
forget to do this, the results might be very interesting....  Also,
don't redirect stderr, as this contains the trace that profile will
be reading and using to obtain run-time statistics.  Profile
automatically redirects stdout to /dev/null.

Currently runs only under UNIX, but with some tweaking could be
made to run elsewhere as well.

The display should be pretty much self-explanatory.  Filenames and
procedures get truncated at nineteen characters (if the display
gets too wide, it can become hard to read).  A star is prepended to
procedures whose statistics have changed since the last screen
update.

Source code | Program Library Page | Icon Home Page