#  FILE NAME awk_sctl
#
#  @(#)awk_sctl	2.2 84/06/13
#
#  This awk file generates a statement level optimization instrumenter run 
#  time control file.  The basic format of the file is a title as the
#  first line, timer resolution in milliseconds as the second a list of
#  routines to be profiled at the statement level as the third line, and
#  an end statement as the last line.
#
#  The title, end, and resolution statements are optional (since resolution
#  defaults to 1 millisecond).
#
#  The list of routines which will be profiled at the statement level is
#  taken from the file which is passed to the calling shell script.
#
BEGIN {
         file = "stmt.ctl";
         print ( "TITLE  Statement Level Profile" ) > file;
         print ( "" ) >> file;
         print ( "RESOLUTION 1" ) >> file;
         print ( "" ) >> file;
         string = " ";
      }
{
  if (( $1 ~ /[pP]/ ) && ( substr ( $0,2,1 ) == " " ))
     string = string " *MAIN"
  else
     string = string " " $1;
}
END {
       print ( "ROUTINES " string ) >> file;
       print ( "" ) >> file;
       print ( "END" ) >> file;
    }
