🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.help
Article #648

Gprof for g++; fixed - here's how.

#648
From: Lawrence De Vooght
Date: Wed, 26 Jun 1991 15:50
66 lines
2222 bytes
I sent this letter out the other day:

===================================
>> Subject: Gprof -gnu profiler - I need advise
>> Message-ID: <ugenblf3ra@ads.com>
>> Sender: usenet@ads.com (USENET News)
>>Organization: Advanced Decision Systems, Mtn. View, CA (415) 960-7300
>>Distribution: usa
>>Date: Fri, 21 Jun 91 10:15:23 PDT
>>Lines: 34

>>   I am trying to find out if it us possible to use the Gnu Profiler -
>>Gprof - with g++ compiled code. 

>>   I have quite a large image (20mg) that I want to profile and I am
>>having problems getting the GPROF to work. I have done the following.


>>On a Sparc station:

>>the code consists of, Xwindow, Interviews and g++

>>compiled the source with the -pg option -- g++ compiler

>>linked the o's with the -pg option

>>make sure that the program executes in the prescribed manner - with
>>exit(0)

>>---- 

>>result is no gmon.out is generated, any suggestion or insights ?

>>	Thanks in advance,
>>	devooght@ads.com

====================

I received a number of answers to my problem some of them complex
other simple. I choose the most simple -- and it worked with one
exception. I defined the extern function as 
- extern "C" void monitor() --. 

The following is the fix ---- Thanks Miron Cuperman.



From: miron@cs.sfu.ca (Miron Cuperman)
Newsgroups: gnu.emacs.help,gnu.g++.help,gnu.gcc.help,gnu.emac
Subject: Re: Gprof -gnu profiler - I need advise
Message-ID: <1991Jun22.022027.1185@cs.sfu.ca>
Date: 22 Jun 91 02:20:27 GMT
References: <ugenblf3ra@ads.com>
Distribution: usa
Organization: Simon Fraser University
Lines: 9



You have to execute the following code before exiting:

extern void monitor(int);
monitor(0);

--	
	by Miron Cuperman <miron@cs.sfu.ca>
Technical Details
Message-ID: <9106270137.AA04979@rice-chex>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ads.com!devooght

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.help,comp.lang.c++
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ads.com!devooght
From: devooght@ads.com (Lawrence De Vooght)
Subject: Gprof for g++; fixed - here's how.
Message-ID: <9106270137.AA04979@rice-chex>
Sender: gnulists@ai.mit.edu
Organization: Advanced Decision Systems, Mtn. View, CA (415) 960-7300
Date: Wed, 26 Jun 1991 15:50:47 GMT
Lines: 67