Analyzing Program Performance With Sun WorkShop

Creating tcov Profiled Shared Libraries

It is possible to create a tcov profiled shareable library and use it in place of one where binaries have already been linked. Include the -xa (C) or -a (other compilers) option when creating the shareable libraries. For example:

 %cc -G -xa -o foo.so.1 foo.o

This command includes a copy of the tcov profiling subroutines in the shareable libraries, so that clients of the library do not need to relink. If a client of the library is also linked for profiling, then the version of the tcov subroutines used by the client is used to profile the shareable library.