gprof output for shared libraries

chanaka Nanayakkara <[email protected]>
Newsgroups gmane.comp.gnu.utils
Message-ID <[email protected]>
I'm working with, solaris-9 and using g++ compiler.

I’m trying to get gprof output for a binary file which includes a shared library.
So I wrote a library like this,
It contains one .cpp file called comp.cpp.
So I compiled it like this,
            g++ -c –fPIC –pg comp.cpp
Then I linked it like this,
            ld –G comp.o –o libmitTest.so
Likewise I made a library called libmitTest.so
 
And I wrote a program with two .cpp files.
Let’s say cat.cpp and zoo.cpp
So I compiled those files like this,
            g++ -c –pg cat.cpp
            g++ -c –pg zoo.cpp
Then I linked that program like this,
            g++ -pg –L. –lmitTest zoo.o cat.o –o y.out
After that I changed the environment variables like this,
            export LD_PROFILE=y.out:libmitTest.so
After that using  ./y.out I ran the program to generate gmon.out file.
Then I tried to get gprof output using the command.
            gprof –b y.out gmon.out
But it only shows details about functions in y.out file only. It won’t show details about function in that shared library. Instead those library functions there’s a syntax called <external>. But I want to get details about those shared library functions.
If I delete that shared library functions in my program, previous <external> command will disappear from the gprof output.
 
Could you please tell me what did I do wrong here? I think I did something wrong while linking my shared library using command,
            ld –G comp.o –o libmitTest.so
have I done anything wrong here?
Or please tell me the way to get details about a shared library.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com

_______________________________________________
help-gnu-utils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gnu-utils
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.