This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gprof and shared libraries


Apologies if that subject has already been discussed - however I could not find recent relevant info on that subject.

I have a small application as a shared library that is loaded by the Java VM and executed. I'd like to get profiling info of that library only. I tried instrumenting the code with gcc -pg and then executing gprof java (.. some options...) that will dynamically load my shared library and execute it. It looks like the gmon.out does not get generated.

I've seen some related info in older mailing lists that suggested that it is not possible to profile shared libraries. Work around was given by using sprof, a sampling profile that however cannot produce call stack traces that I am primarily interested in.

Is there a way (maybe by writing small custom code that could get called from instrumented code on entry and exit of a function in my shared library) to profile a shared object file only?

Thanks for any hints,
-Thomas



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]