man(1) Manual page archive

     LCOMP(1)                                                 LCOMP(1)

          lcomp, lprint - line-by-line profiler

          lcomp [options] ... file ...

          lprint [options] [files]

          Lcomp is used in place of cc (1) or f77 (1) to insert
          instruction-counting code into programs.  It recognizes
          options whose initial letters are taken from the string
          ``cwpDUIRdlNnz'', and accepts files whose names end in `.c',
          `.f', `.s', or `.o'.  From each source file it derives a
          `.o' file and a `.sL' file which lprint uses to correlate
          source lines with basic blocks.  If the -c option is not
          present it creates a.out. Each time the `a.out' file is run
          statistics are added to a profiling file prof.out.

          Lprint produces on the standard output a listing (in the
          style of pr(1)) of the programs compiled by lcomp. Without
          arguments or files, each line of the listing is preceded by
          the number of times it was executed, as determined from the
          data in prof.out. Lprint interprets the following options.

          -a   Detailed listing of every machine instruction and how
               often it was executed.

          -b   Attempts to indicate how often each basic block was

          -c   Compress the prof.out file, which otherwise grows with
               every execution of a.out .

          -f   Print summary information by function: instruction exe-
               cutions, number of invocations, source instructions,
               and number of instructions never executed.

          -i   Before each line of source print the number of machine
               instructions executed.

          -p   Before each line of source print the number of times
               the first basic block in that line was executed.

          -s   Summarize the counts by source file: instruction exec-
               tuions, source instructions, instructions never exe-
               cuted, basic block executions, total number of source
               basic blocks, and how many were never executed.

          If any file names are given, the arguments "abip" apply only

     LCOMP(1)                                                 LCOMP(1)

          to them.  If no options are given, -p is assumed.  Any com-
          bination of options is allowed.

          prof.out        counts
          *.sL            for correlating with source
          /usr/lib/bb     finding basic blocks and inserting counting
          /usr/lib/nexit.oprinting counts when `a.out' exits

          cc(1), f77(1)

          A line in the source file may be in zero, one, or more basic
          blocks; the count given in the listing corresponds to some
          particular choice of the basic block to associate with the
          Processing the output of yacc(1) without removing `#line'
          directives will produce unsatisfactory results.