gprof and MICRO FOCUS COBOL
I am using MICRO FOCUS COBOL v3.1.59 PRN=6a.1a.10.10. Will this version
1) Support the use of the -pg compiler?
2) Will the COBOL compiler directive "profile" profile my "C" programs?
3) I want to get the gmon.out file, why do i get mon.out?
4) When I compile my "C" programs with the -pg option and link with
COBOL I lose the detail "C" statistics, how can I prevent this?
1) MICRO FOCUS does not support the -pg compiler option. MICRO FOCUS
only supports the -p option as described in the System Reference
Manual in Appendix B page 13.
2) NO. The COBOL compiler directive "profile" is ONLY for COBOL
programs, it cannot provide statistics for "C" routines.
3) You get the mon.out file for two reasons. First COBOL is setup to
only support the -p option (minimum profiling, ie mon.out) and not
-pg (maximum profiling ie gmon.out). Second COBOL uses the startup
module crt0.o instead of gcrt0.o (required for gmon.out). It must
be pointed out MICRO FOCUS WILL NOT SUPPORT anyone who uses the
gcrt0.o startup routine.
4) The only way to retain the "C" detail is as follows:
a. Compile all "C" programs with the -pg option
b. Make a copy of the file "liblist" located in the directory
/usr/lib/cobol/coblib to someplace like /usr/tmp/mylist.
NEVER MODIFY THE LIBLIST FILE IN /USR/LIB/COBOL/COBLIB.
c. Edit the "mylist" file and change the line that reads
i/lib/crt0.o to read i/lib/gcrt0.o.
d. Set the variable LIBLIST=/usr/tmp/mylist
e. When building a new rts32 or compiling you own executable
use the COBOL compiler flag -g as described in the System
Reference manual Appendix B page 7.
If you follow steps a through e, when you execute the program a gmon.out
will be produced. You then use the gprof command to process the
gmon.out file and produce the statistical report, which will
contain the detail for the "C" programs.
One again steps b through e should ONLY be used for testing
and performance tuning. NEVER use this method for installing
production programs, as MICRO FOCUS WILL NOT SUPPORT anyone who
uses the gcrt0.o startup module.
Support Line: gprof and MICRO FOCUS COBOL ITEM: BA0345L
Dated: October 1995 Category: N/A
This HTML file was generated 99/06/24~13:30:24
Comments or suggestions?