[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Profiling shared libraries

From: Dan Kegel
Subject: RE: Profiling shared libraries
Date: Tue, 17 Jun 2003 08:11:29 -0700

Is your program multithreaded?
See http://www.kegel.com/gprof.html
Not sure if that's related, but it sure could be.
- Dan

-----Original Message-----
From: Simon Perreault
To: address@hidden
Sent: 17.06.2003 07:43
Subject: Profiling shared libraries

I want to profile a shared library using ld.so's LD_PROFILE environment 
variable. Here are the steps I follow:

1) Compile and link my shared library (lib3di.so.1) as usual, without 
using -pg.
2) export LD_PROFILE=lib3di.so.1
3) Run a program (named "prewitt") that uses that library.
4) The file lib3di.so.1.profile is created. It's 203k big, but 
inspection revealed that except for the 56 first bytes, the file only 
contains zeroes.
5) The command "file lib3di.so.1.profile" prints: "lib3di.so.1.profile: 
GNU prof performance data - version 131071". I think the version is
6) I couldn't figure out the correct order of arguments to give to gprof

to analyze that file. "gprof lib3di.so.1.profile" gives "gprof: 
lib3di.so.1.profile: not in a.out format". "gprof prewitt 
lib3di.so.1.profile" gives "gprof: file `lib3di.so.1.profile' has 
unsupported version 131071".

I also tried with using "-pg" in step 1, although I believe it should 
not be used. I am running glibc 2.3.2 and binutils as 
provided in Red Hat 9.

What did I do incorrectly? Or is there a bug somewhere?

I will pay for a helpful answer with a contribution to either ld.so's or

gprof's manual, where instructions should be clearer. Thank you in

Bug-glibc mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]