bug-glibc
[Top][All Lists]
Advanced

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

Overflow problem in gmon/mcount profiler.


From: Jim Panetta <Jim Panetta
Subject: Overflow problem in gmon/mcount profiler.
Date: Tue, 31 Jul 2001 17:26:05 -0700

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

Software environments:
  gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
  glibc-2.2.3  (apparent from reading the code...)

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

  Is the previous comment a reference to a true hard limit on
  the number of routines that can be profiled?  

Test Case:
  The test case is included at the end of the email as an attached
  tar file.  

  Included in the file are:
     
    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 ~10 minutes on 600Mhz Pentium
  
  $ main


Thanks.  
  --Jim Panetta


Attachment: profiler.tar
Description: profile.tar test case

-- 
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!

"Truth decays into beauty, while beauty soon becomes merely charm. Charm
ends up as strangeness, and even that doesn't last, but up and down are
forever."
                                                                Anonymous

reply via email to

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