Fedora Linux Support Community & Resources Center
  #1  
Old 23rd May 2008, 02:53 PM
MrGroover Offline
Registered User
 
Join Date: Oct 2005
Location: Germany
Age: 29
Posts: 38
Question [solved] gLibC with profiling support

Hello,

for a C++ project, I am looking for a way to count all function calls to mathematical functions (sin, cos, tan, ...). Counting function calls is one thing that can be done by gprof by using the -pg compiler/linker option. The problem is that the functions in libraries have to be compiled with this option as well. It is obvious that for performance reasons, this option is not used in general.

My question is now: what is the easiest way to get a math-lib with profiling support? Is it enough to install the glibc-debuginfo package? Do I have to build the glibc-package from the sources? If so, how is this done to get the -pg option (I think it may not be as easy as using rpmbuild)? Is there any way to get this done without interfering with the normal packages/libraries? I mean, I don't want to have the profiling support in general, but I'd like to have a way to specify another library, maybe something like -lm_p, to get the profiling support. This would also have the advantage of an easy integration into Eclipse, which I am using as my IDE.
If there are other ways of achieving this, please don't hesitate to enlighten me. Adding profiling capabilities to the math-lib was just the first thing I thought of...

I know that I could add some 'global' variables that are 'manually' incremented whenever a call to sin oder cosine happens, but this wouldn't be 'professional'. The profiler seems to be the easiest option, because it is just one flag that needs to be added and in Eclipse, this can be done for the Debug target, leaving the Release target untouched.

If there is no way to achieve a co-existence of normal and profiling-capable libraries, I could set up a virtual machine.

Additional informations, if necessary/summary: System is a Fedora 9 based, development is done in Eclipse/CDT and the project is a C++ one. Counting function calls (math functions, basic arithmetics are less important) is the only objective.

I hope that someone can help me or at least guide me somewhere, where I can find a solution...

Thanks in advance,

Michael

Last edited by MrGroover; 23rd May 2008 at 09:01 PM. Reason: Solution found -> title edited
Reply With Quote
  #2  
Old 23rd May 2008, 04:37 PM
stevea's Avatar
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,300
You need the glibc-profile package - but it hasn't been available for a while.
That means you'll probably have to build from source.
Reply With Quote
  #3  
Old 23rd May 2008, 08:59 PM
MrGroover Offline
Registered User
 
Join Date: Oct 2005
Location: Germany
Age: 29
Posts: 38
Thanks stevea, that was exactly what I was looking for. Although not available in any recent Fedora version, I downloaded the FC4 version of the package and installed this. It only contains some specially named static libs, so it does not interfere with an existing glibc installation.
Reply With Quote
Reply

Tags
glibc, profiling, support

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"yum install glibc-devel" = Error: glibc-common conflicts with glibc < 2.3.6 nat101l Using Fedora 22 10th November 2005 06:16 PM
Any Profiling Tools around? IanWaring Using Fedora 3 16th August 2005 11:55 PM


Current GMT-time: 23:33 (Tuesday, 21-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat