[comp.lang.c++] Profiling C++

cohler@batcomputer.UUCP (02/18/87)

This may be of general interest so I am replying to the group. We use
profiling with C++ and found we had to use a small kludge to get
things to go through. 

As I understand it, the profiler uses its own version of the 
standard c library, in particular the usual exit code is replaced to 
by an exit that creates the gmon.out file. C++ merrily takes over 
exit thus preventing this file from being written. One simple way 
out is to use ar to suck out exit.o from the C++ libC.a file and 
then link to that instead. This means that global destructors will 
not be called - that has not been a problem for us.

Presumably, what is required to do it properly would be to adjust the C++
exit code to do the right thing (A profiled libCp.a ?). 

Gene Cohler (cohler@tcgould.tn.cornell.edu)
-- 
Gene Cohler      		ARPA:	cohler@tcgould.tn.cornell.edu
Newman Lab/Cornell Univ		Usenet:	cornell!batcomputer!cohler
Ithaca NY 14853 		Bitnet: jbvy@cornella.bitnet