Reference: lprof
Author: Daniel Gilly & the Staff of O'Reilly & Associates
Date: 1998-08-06T21:53:35Z

#

| Chapter 2 UNIX Commands |

## lprof

    lprof [options]
    lprof -m files [-T] -d out

Display a program's profile data on a line-by-line basis. Data includes a list of source files, each source code line (with line numbers), and the number of times each line was executed. By default, lprof interprets the profile file `prog`.cnt. This file is generated by specifying cc -ql when compiling a program or when creating a shared object named `prog` (default is a.out). The PROFOPTS environment variable can be used to control profiling at run time. See also prof and gprof.

### Options

-c `file`

  Read input profile `file` instead of `prog`.cnt.

-d `out`

  Store merged profile data in file `out`. Must be used with -m.

-I `dir`

  Search for include files in `dir` as well as in the default place (/usr/include).

-m `files`

  Merge several profile `files` and total the execution counts. `files` are of the form `f1`.cnt, `f2`.cnt, `f3`.cnt , etc., where each file contains the profile data from a different run of the same program. Used with -d.

-o `prog`

  Look in the profile file for a program named `prog` instead of the name used when the profile file was created. -o is needed when files have been renamed or moved.

-p

  Print the default listing; useful with -r and -s.

-r `list`

  Used with -p to print only the source files given in `list`.

-s

  For each function, print the percentage of code lines that are executed.

-T

  Ignore timestamp of executable files being profiled. Normally, times are checked to insure that the various profiles were made from the same version of an executable.

-V

  Print the version of lprof on standard error.

-x

  Omit execution counts. For lines that executed, show only the line numbers; for lines that didn't execute, print the line number, the symbol [`U`], and the source line.

Reference: lprm |  | Reference: lpstat