X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:references :in-reply-to:content-type:content-transfer-encoding :mime-version; q=dns; s=default; b=hKHVcG8+emMxSmywrwPPxMKH2NUTd fsVRH3GcQU1qpKG2fWWcNP7zX96SrjEF6enAyA0vkKtv5j69lChXRmNpk1F/An9L nxsBiSolW4n1Su2YESX+4PONdl7Xyawft5xVAsaPyGnqAZWEXH6O3hcfeweDYFii DhVOTwPupzbJlY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:references :in-reply-to:content-type:content-transfer-encoding :mime-version; s=default; bh=01JfuUWrt/hSmS8XAc8r6onWrBI=; b=ffV t/cqnzEsIMQDACPHbe/uFwbnf8oR7jisNNa2TemBJ/8xCwJwYhELxX+qRkDFLAqO h8kLltKnWDpL3cawEcFJZ42KK3AbA7k9iHxgjwK44UeW6umnI8Sh6K43MjvHXZiy Daxs3NMq/lJCZolLKuUhFoQSszT/ysb5QZTTc4C4= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD autolearn=ham version=3.3.1 From: "J.B.W.Webber" To: "cygwin AT cygwin DOT com" Subject: RE: What is a good profiling tool ? - problem with gprof Date: Tue, 18 Jun 2013 14:06:49 +0000 Message-ID: <2CF6002E09D8F54E9839DA08786D3200958D9548@EX10-LIVE-MBN2.ad.kent.ac.uk> References: <2CF6002E09D8F54E9839DA08786D3200958D7B7A AT EX10-LIVE-MBN2 DOT ad DOT kent DOT ac DOT uk> <51BF3EC0 DOT 4040906 AT cygwin DOT com> <20130618101107 DOT GA27405 AT calimero DOT vinschen DOT de> <20130618103825 DOT GD27405 AT calimero DOT vinschen DOT de> In-Reply-To: <20130618103825.GD27405@calimero.vinschen.de> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id r5IE7Awt028129 -----Original Message----- Subject: Re: What is a good profiling tool ? - problem with gprof On Jun 18 12:11, Corinna Vinschen wrote: > On Jun 17 12:52, Larry Hall (Cygwin) wrote: > > On 6/17/2013 12:19 PM, J.B.W.Webber wrote: > > >Hi, I am trying to find in which function call the most time is being spent. > > > > > >I am using gcc and trying to compile and link with -g and -pg. > > >i.e. for a trivial test : > > > > > >$ cat helloworld.c > > >/* Hello World program */ > > >#include > > >main() > > >{ > > > printf("Hello World\n"); > > >} > > > > > >$ gcc -g -pg -c helloworld.c > > >$ gcc -pg helloworld.o > > >helloworld.o: In function `main': > > >helloworld.c:6: undefined reference to `_mcount' > > >collect2: ld returned 1 exit status > > > > > >Any ideas ? Am I missing a .h call ? Or do I need to link to something ? > > > > Worked for me. Perhaps your Strawberry gcc installation is interfering. > > I don't know how you succeeed to build that, Larry. I could easily > reproduce the problem. It was a build problem in Cygwin. I fixed > that now and at the same time made the 64 bit profiling workable, > curtesy the > Mingw-w64 project, which already did the required work. The original > profiling code was created within the Cygwin project ages ago, so I > could included the latest Mingw-w64 profiling code (almost) verbatim > into Cygwin and now it seems to work fine again for 32 and 64 bit. > > I'm just about to create a 2013-06-18 32 bit snapshot on > http://cygwin.com/snapshots/ and a 64 bit test release 1.7.12-5, which > both should be ready in an hour. Uploaded. Please note that it's *not* enough to install the snapshot Cygwin DLL. The important items here are gcrt0.o and libgmon.a. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat _____________________________________________ Really thanks to all. That now works. Sorry for the slow reply, I did the install with the snapshot as suggested - no difference, at first, but I had been given the clues I needed. I used find to track all libgmon.a on my laptop : C:/Altera/12.0sp2/quartus/bin/cygwin/lib/libgmon.a C:/Altera/12.0sp2/quartus/bin/cygwin/lib/mingw/libgmon.a C:/Altera/12.0sp2/quartus/bin/cygwin/usr/i686-pc-mingw32/lib/libgmon.a C:/Applications/Strawberry/c/x86_64-w64-mingw32/lib/libgmon.a C:/cygwin/lib/libgmon.a C:/cygwin/usr/i686-pc-mingw32/sys-root/mingw/lib/libgmon.a C:/cygwin/usr/lib/libgmon.a I blocked access to the Altera and Strawberry Cygwins, which made no difference, (no, XMOS does not use Cygwin) But the answer was the version C:/cygwin/lib/libgmon.a I copied the new gcrt0.o and libgmon.a into C:/cygwin/lib/ and all now works fine. I have the answer I needed. I do thank you all, Cheers, Beau