From: CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 15-APR-1989 02:30 To: MRGATE::"ARISIA::EVERHART" Subj: re: Profiler Received: by ge-rtp (5.57/ge-rtp.GE.COM/1.18) id AA19573; Sat, 15 Apr 89 02:14:21 EDT Received: from CRVAX.SRI.COM by mcnc.mcnc.org (5.59/MCNC/5-16-88) id AA16912; Fri, 14 Apr 89 23:01:20 EDT Message-Id: <8904150301.AA16912@mcnc.mcnc.org> Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Fri, 14 APR 89 18:44:32 PDT Received: from Venus.YCC.Yale.Edu (YALE-ENG-VENUS.ARPA) by KL.SRI.COM with TCP; Fri, 14 Apr 89 10:03:00 PDT Date: Fri, 14 Apr 89 13:06 EDT From: "Jerry Leichter (LEICHTER-JERRY@CS.YALE.EDU)" Subject: re: Profiler To: NDOWNE90%IRLEARN.BITNET@CUNYVM.CUNY.EDU, INFO-VAX@KL.SRI.COM X-Vms-To: IN%"NDOWNE90%IRLEARN.BITNET@CUNYVM.CUNY.EDU",INFOVAX ... [I]s there a way to determine how many times each line of a (Fortran) program is executed and if not how would one go about writing one's own version. I will post any suggestions I might receive. DEC sells a product called PCA (Performance and Coverage Analyzer) which will do this (and a lot more). A "poor man's" way to do it, which may be good enough if the program isn't too long and doesn't run very long - it'll slow things down by a large factor - is to use the Debugger. For example, suppose you want line counts for lines 100, 110, and 115. (Note that in straight-line code with no labels, line n+1 obviously has the same count as line n, so there's no point keeping counts separately for each of them.) Set aside a bunch of counters in your code - just define some integer variables that you never otherwise use, say Z100, Z110, and Z115. Then do: DEPOSIT Z100 = 0 SET BREAK/SILENT %LINE 100 DO (DEPOSIT Z100 = Z100 + 1; GO) and similarly for the other lines. -- Jerry