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

See the CrossGCC FAQ for lots more information.


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

Re: Profiling libraries


Linux Newbie wrote:
I am trying to profile a program which uses zlib1.2.1 i.e. libz.so.1.2.1

As I read on internet, it is easier to get profile data when linked statically.
so I am trying that first.

1st: Just compile source of the lib with -pg option.
Compile example.c, that comes with zlib , with -pg option
statically linked the libz.a
Run the make test, it also executes example and creates gmon.out
gprof ./example
It shows all the lib functions in the profile , but timing is 0.00 for all

A couple questions: 1. did you compile and link the main program with -pg? 2. was runtime long enough (tens of seconds) to accumulate sufficient samples?

- Dan

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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