Bug 20093 - gprof doesn't work
gprof doesn't work
Status: CLOSED ERRATA
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
7.0
i386 Linux
high Severity high
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-10-31 07:37 EST by Need Real Name
Modified: 2016-11-24 09:59 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-11-24 21:43:21 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Here is the output of gprof (1020.54 KB, text/plain)
2000-10-31 07:39 EST, Need Real Name
no flags Details

  None (edit)
Description Need Real Name 2000-10-31 07:37:21 EST
With Redhat 7.0 gprof does not work anymore.
It simply reports all the times to be 0.
I tried on differents machines with the same result.
Every program I tried an compiled with the
-g -pg options does not report the time when profiled.
The number of calls are correct.
Comment 1 Need Real Name 2000-10-31 07:39:22 EST
Created attachment 4816 [details]
Here is the output of gprof
Comment 2 Need Real Name 2000-10-31 07:49:55 EST
Some more informations:
it does not work on machines upgraded from RH 6.2,
but on machines fresh installed with RH 7.0 the profiler works.
I don't know which component to blame: gcc/binutils/glibc.
Comment 3 Jakub Jelinek 2000-10-31 08:06:13 EST
What version of packages do you have on the 7.0 upgraded from 6.2?
Particularly interesting are gcc, binutils, glibc, glibc-devel, glibc-profile.
Any chance some package is left from the 6.2 install?
I've just checked native 7.0 install and profiling works for me well
(like you said with 7.0 install, not upgrade).
Comment 4 Need Real Name 2000-10-31 08:11:34 EST
Here are the versions:

binutils-2.10.0.18-1
glibc-2.1.94-3
glibc-devel-2.1.94-3
glibc-profile-2.1.94-3
gcc-2.96-54

Hmmm, I don't think there could be any package left out, since this problem
showed up on two different machines, both upgraded from RH 6.2.
Anyway, I also tried to compile the sources with the egcs compiler egcs from
package compat-egcs-6.2-1.1.2.9, but nothing changed.

Comment 5 Jakub Jelinek 2000-11-02 09:33:11 EST
Could you post the same minimal testcase (e.g. main which just calls
some function with a for(i=1;i<0x10000000;i++); loop ) build with -g -pg on
both the upgraded system and fresh install, so that I can compare what's different?
Thanks.
Comment 6 Need Real Name 2000-11-02 10:51:45 EST
I don't have a fresh 7.0 install around now, but here is some additional
information.

Here is the profiler result for a program, under an updated 7.0:
Flat profile:

Each sample counts as 0.01 seconds.
 no time accumulated

  %   cumulative   self              self     total           
 time   seconds   seconds    calls  Ts/call  Ts/call  name    
  0.00      0.00     0.00  3825819     0.00     0.00  basic_string<char,
string_char_traits<char>, __default_alloc_template<true, 0> >::rep(void) const
  0.00      0.00     0.00  3270679     0.00     0.00  less<unsigned
long>::operator()(unsigned long const &, unsigned long const &) const
  0.00      0.00     0.00  2233206     0.00     0.00  basic_string<char,
string_char_traits<char>, __default_alloc_template<true, 0> >::length(void)
const
  0.00      0.00     0.00  1710096     0.00     0.00  vector<Atom *,
allocator<Atom *> >::begin(void)
  0.00      0.00     0.00  1640434     0.00     0.00  vector<Atom *,
allocator<Atom *> >::operator[](unsigned int)
  0.00      0.00     0.00  1451358     0.00     0.00  basic_string<char,
string_char_traits<char>, __default_alloc_template<true, 0> >::Rep::data(void)

The same under RH 6.2:

Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls  us/call  us/call  name    
  5.62      0.23     0.23   274208     0.84     2.07  rb_tree<unsigned long,
pair<unsigned long const, map<unsigned long, Instance *, less<unsigned long>,
__default_alloc_template<true, 0> > *>, select1st<pair<unsigned long const,
map<unsigned long, Instance *, less<unsigned long>,
__default_alloc_template<true, 0> > *> >, less<unsigned long>,
__default_alloc_template<true, 0> >::insert_unique(pair<unsigned long const,
map<unsigned long, Instance *, less<unsigned long>,
__default_alloc_template<true, 0> > *> const &)
  5.38      0.45     0.22  3323250     0.07     0.07  less<unsigned
long>::operator()(unsigned long const &, unsigned long const &) const
  3.18      0.58     0.13    13785     9.43   125.35  Utils::getPTypeOC(char *,
int)
  2.93      0.70     0.12   174190     0.69     2.03  rb_tree<unsigned long,
pair<unsigned long const, Instance *>, select1st<pair<unsigned long const,
Instance *> >, less<unsigned long>, __default_alloc_template<true, 0>
>::insert_unique(pair<unsigned long const, Instance *> const &)
  2.69      0.81     0.11   124014     0.89     2.94  rb_tree<unsigned long,
unsigned long, identity<unsigned long>, less<unsigned long>,
__default_alloc_template<true, 0> >::insert_unique(unsigned long const &)


Note: Both machine use the exact same hardware.

Comment 7 Need Real Name 2000-11-02 11:31:29 EST
OK. I did some more tests.
I compiled my source on a RH 6.2, let it run, tried the gprof: everything ok.
I took the compiled executable, along with the gmon.out to the updated RH 7.0
machine. I started gprof, and the results were correct.
I started the program, so that it generated a new gmon.out, run gprof: the
results were incorrect.

Comment 8 Need Real Name 2000-11-24 21:43:18 EST
This is solved with the latest glibc!
It is working with glibc-2.2-5 / glibc-devel-2.2-5 / glibc-profile-2.2-5
Comment 9 Jakub Jelinek 2000-12-19 05:37:46 EST
Great.

Note You need to log in before you can comment on or make changes to this bug.