Article View: gnu.misc.discuss
Article #72052gprof and g++
From: Mike Tiller
Date: Fri, 24 Apr 1992 13:41
Date: Fri, 24 Apr 1992 13:41
56 lines
3158 bytes
3158 bytes
In case anyone cares, you can get gprof (from binutils-1.9) to handle g++ generated code gracefully by getting the latest cp-dem.c from gcc-2.1 (the one that comes with binutils-1.9 (cplus-dem.c) may be sufficient, I'm not sure) and using it when you compile gprof. Additionally, you can't remove the underscores (#define nounderscore at the top of gprof.c). The difference in gprof output is the difference between: % cumulative self self total time seconds seconds calls ms/call ms/call name 39.3 2.58 2.58 21600 0.12 0.12 ___apl__t4List1Z5EntryP5Entry [6] 11.6 3.34 0.76 mcount (149) 10.4 4.02 0.68 1 680.01 680.39 _snf_ [10] 5.8 4.40 0.38 1426 0.27 0.27 _SetSize__6Vectori [17] 5.5 4.76 0.36 _malloc [19] 2.3 4.91 0.15 1 150.00 150.00 _ssf_ [22] 1.8 5.03 0.12 1350 0.09 0.16 _Stiff__7ElementR11LocalMatri x [21] 1.4 5.12 0.09 1427 0.06 0.38 __doprnt [11] 1.4 5.21 0.09 1 90.00 90.00 _sns_ [24] 1.2 5.29 0.08 1 80.00 3308.66 _Assemble__6DomainR6MatrixR6V ector [4] and % time seconds cumsec calls function 16.51 0.88 0.88 1426 Vector::SetSize(int) 12.38 0.66 1.54 1427 _write 10.69 0.57 2.11 9224 List<Entry>::Unref(int) 9.19 0.49 2.60 mcount 9.01 0.48 3.08 1 List<Entry>::ShellSort() 6.00 0.32 3.40 21600 List<Entry>::operator+=(Entry *) 5.63 0.30 3.70 _malloc 5.07 0.27 3.97 1 _snf_ 2.81 0.15 4.12 21600 StreamFunction2D::Stiff(LocalMatrix &, Geom *, in t, int) 2.81 0.15 4.27 1 _ssf_ 2.44 0.13 4.40 1350 twod_rect::Attach(Element *, int, int, int) 1.50 0.08 4.48 1 Domain::Assemble(Matrix &, Vector &) 1.31 0.07 4.55 3847 __big_float_times_power 1.31 0.07 4.62 1350 Element::Stiff(LocalMatrix &) (yes, these are from different codes, but you get the idea) It is a fairly simple hack, but I thought I would call attention to the fact that the Gnu binutils can handle g++ in a graceful way for those out there (like me 3 days ago) who didn't know this. Good Job Gnu. Michael Tiller University of Illinois (Urbana-Champaign)
Technical Details
Message-ID:
<1992Apr24.134158.23573@ux1.cso.uiuc.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!ames!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!quattro!tillerShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1025b4,c7dd6bf74b564965,start X-Google-Attributes: gid1025b4,public X-Google-ArrivalTime: 1992-04-24 06:41:58 PST Newsgroups: gnu.misc.discuss Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!ames!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!quattro!tiller From: tiller@solace.me.uiuc.edu (Mike Tiller) Subject: gprof and g++ Message-ID: <1992Apr24.134158.23573@ux1.cso.uiuc.edu> Keywords: gprof g++ Sender: tiller@quattro (Mike Tiller) Organization: University of Illinois (Urbana-Champaign) Date: Fri, 24 Apr 1992 13:41:58 GMT Lines: 57