This is the mail archive of the
mailing list for the GCC project.
Re: profiling a MT-App (with shared libs) on Linux
- To: Lothar Werzinger <werzinger dot lothar at krones dot de>
- Subject: Re: profiling a MT-App (with shared libs) on Linux
- From: Andreas Jaeger <aj at suse dot de>
- Date: 07 Nov 2000 15:08:45 +0100
- Cc: gcc at gcc dot gnu dot org
- References: <3A080C39.760F8F69@krones.de>
>>>>> Lothar Werzinger writes:
> has anybody being successfully using the profiling support of gcc with a
> multithreaded app on Linux. The code I want to profile is inside a
> shared library, that gets loaded manually by the application program. I
> have the source to both the app and the lib. Due to some architectual
> constraints I can NOT statically link the library.
Use LD_PROFILE=libsomething.so, e.g.:
$ LD_PROFILE=libc.so.6 ls
$ sprof libc.so.6 libc.so.6.profile
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls us/call us/call name
0.00 0.00 0.00 2958 0.00 __overflow
0.00 0.00 0.00 1782 0.00 strncmp
0.00 0.00 0.00 788 0.00 strcmp
0.00 0.00 0.00 723 0.00 mempcpy
0.00 0.00 0.00 314 0.00 memcpy
LD_PROFILE_OUTPUT determines the path where it's written - this only
works with glibc 2.1 and newer. AFAIR it should work with
multithreaded apps - if not complain on the glibc lists.
SuSE Labs email@example.com