|
|
You can obtain a summary of profiling data by invoking lprof with
the -s option:
$ lprof -s -c sample.cnt
Because a source listing is not produced by lprof -s, the -I option need not be specified. The summary reports the percentage of lines of code that were executed for each function in the profiled program, as shown in ``Example of lprof -s Output''.
Coverage Data Source: sample.cnt Date of Coverage Data Source: Thu Apr 28 13:54:05 1994 Object: samplepercent lines total function covered covered lines name
100.0 4 4 main 83.3 5 6 sub1 0.0 0 2 sub2 100.0 2 2 sub3
78.6 11 14 TOTAL
Example of lprof -s Output
To obtain both a source listing report and a summary report, you can invoke lprof with the -s and -p options. As an exercise, divide the sample.c file into four parts:
lprof -p -s -c sample.cnt -r sample3.c