home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam    

UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: lprm Chapter 2
UNIX Commands
Next: Reference: lpstat






lprof -m









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 .


-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.


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

-r list

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


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


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.


Print the version of lprof on standard error.


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.

Previous: Reference: lprm UNIX in a Nutshell: System V Edition Next: Reference: lpstat
Reference: lprm Book Index Reference: lpstat

The UNIX CD Bookshelf Navigation The UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System