This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: What is a good profiling tool ? - problem with gprof
- From: J.B.W.Webber <J dot B dot W dot Webber at kent dot ac dot uk>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Mon, 17 Jun 2013 18:42:05 +0000
- Subject: RE: What is a good profiling tool ? - problem with gprof
- References: <2CF6002E09D8F54E9839DA08786D3200958D7B7A at EX10-LIVE-MBN2 dot ad dot kent dot ac dot uk> <51BF503E dot 2020909 at aol dot com>
Subject: Re: What is a good profiling tool ? - problem with gprof
On 06/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<stdio.h>
> 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 ?
>
> I have just updated cygwin. I attach cygcheck.out
>
> Or any suggestions for another profiling tool that actually reports times ?
> Cheers,
> Beau
>
If the gprof section of binutils is properly built and installed, it should satisfy the mcount reference.
It's a bit strange to make a .o with -g -pg together, particularly when you don't link with the same options.
FWIW, latest version of Intel VTune works with cygwin builds with -g3
-gdwarf-2 (and of course PATH considerations).
--
Tim Prince
_____________________
Thanks Larry and Tim,
I was not sure if -g was required as well, and tried all combinations.
May I ask if VTune works with non-MinGW compilations ?
I looked and was not clear.
I am reluctant to change my other ygwin installations, they are required for other projects.
I have certainly had interaction in the past with Altera Cygwin package and_____________________
Thanks Larry and Tim,
I was not sure if -g was required as well, and tried all combinations.
May I ask if VTune works with non-MinGW compilations ? I looked and was not clear.
I am reluctant to change my other Cygwin installations, they are required for other projects.
I have certainly had problems in the past with the Altera Cygwin package and the XMOS one interacting, but they seem to have sorted that.
Cheers,
Beau
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple