bug-gplusplus
[Top][All Lists]
Advanced

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

Profiler problem in g++/gcc


From: Jim Panetta
Subject: Profiler problem in g++/gcc
Date: 21 Jun 2001 03:44:12 GMT

Summary:
When call-graph profiling an executable with a large number of
called routines, the file gmon.out is not produced.

This affects gcc/g++ 2.91.66 and 2.95.x, libc-5.3.12-31, et al.

Detail:
In the code for gmon() and mcount(), the routines that collect the
statistics for the profile, there is a hard limit of 65534 routines
that can be monitored.  In a large piece of software, this limit can
be reached rather quickly.  In addition, in gmon.cc, when the hard
limit is reached, the profile fails silently.  No gmon.out file will
be generated.

There is a comment in sys/gmon.h that says:
/*
 * histogram counters are unsigned shorts (according to the kernel).
 */
#define HISTCOUNTER     unsigned short

Does anyone know how to get around this?  We have a rather large
executable that we'd like to profile in situ.  It's a real pain in the
arse to split this puppy up.


A test case for this is located at:
http://www.slac.stanford.edu/~panetta/profiler.tar

Included files:
   
   README             Read this
   
   profile.pl         perl script to autogenerate ~125k C++ routines and
                      associated Makefile system.  
                      Routines generated are of the form a_1_1()
                      and don't really do a hell of a lot.
                      Please don't snicker at my perl.  :-)
    
   Makefile.master    Stub of the toplevel Makefile of this system
   
   Makefile.primary   Stub of the Makefile for lettered directories.
   

To compile/run this test case:

$ profile.pl       # This will take a while, it's autogenerating
                   # 125k C routines

$ gmake all        # Takes ~20 minutes on Sun T1
                   # Takes ~10 minutes on 600Mhz Pentium

$ main


Thanks.  
  --Jim Panetta


-- 
My opinions are mine...not SLAC's...not Penn's...not DOE's...mine.
(except by random, unforseeable coincidences)
address@hidden  --  Save the whales!  Free the mallocs!




reply via email to

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