|
|
To produce the source listing output described in the next section, lprof must be able to access the source and header files that comprise the profiled program (or the profiled part of it). By default, lprof searches
If your source or header files are in directories different from these, you must specify their paths with the -I option. Unlike cc -I, you use lprof -I to specify directories to be searched for source files as well as header files. If some of the source and header files for the profiled program sample are stored in the directory /usr/src/cmd, and the rest in your current directory and the standard place for header files, you use the command
$ lprof -c sample.cnt -I/usr/src/cmdto produce a source listing for all your profiled files. You can specify -I more than once on the lprof command line. Directories are searched in the order they appear on the command line.
If you want a source listing for selected source files, you specify the files with the -r option:
$ lprof -c sample.cnt -r sample.c -r sample2.cThis command produces source listing output only for sample.c and sample2.c of the profiled program sample, provided, of course, that the source files are in your current directory.