public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* testing GCC
@ 2004-02-23 18:21 Jane chen
  2004-02-25  2:07 ` Jim Wilson
  0 siblings, 1 reply; 6+ messages in thread
From: Jane chen @ 2004-02-23 18:21 UTC (permalink / raw)
  To: gcc-bugs

Hi, all:

I'm trying to use gcov to get the coverage information
while running testsuite for GCC. However, right after
I compile gcc source code (after I type in the command
"make bootstrap"), I run gcov, there is already
coverage info there although I did not run any
testsuite yet!

Can anybody tell me what's wrong and how to get rid of
those coverage info before I start to run testsuite?

Thank you very much!

Jane

__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: testing GCC
  2004-02-23 18:21 testing GCC Jane chen
@ 2004-02-25  2:07 ` Jim Wilson
  2004-02-25  3:55   ` Jane chen
  0 siblings, 1 reply; 6+ messages in thread
From: Jim Wilson @ 2004-02-25  2:07 UTC (permalink / raw)
  To: Jane chen; +Cc: gcc-bugs

Jane chen wrote:
> I'm trying to use gcov to get the coverage information
> while running testsuite for GCC. However, right after
> I compile gcc source code (after I type in the command
> "make bootstrap"), I run gcov, there is already
> coverage info there although I did not run any
> testsuite yet!

You need to give us more info.  What commands you typed, what output you 
got, and why you think this output is wrong.

If particular, you need to explain what you mean when you say that there 
was already coverage info there.

> Can anybody tell me what's wrong and how to get rid of
> those coverage info before I start to run testsuite?

You get rid of coverage info by deleting the files that contain it. 
Deleting the .gcda files should do.  However, I am skeptical that there 
are any .gcda files there.  (In older gcc versions, these would be .da 
files.)

If you have already run the testsuite, then there will be some coverage 
info generated because the testsuite tests gcov.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: testing GCC
  2004-02-25  2:07 ` Jim Wilson
@ 2004-02-25  3:55   ` Jane chen
  2004-02-25  6:27     ` Jim Wilson
  0 siblings, 1 reply; 6+ messages in thread
From: Jane chen @ 2004-02-25  3:55 UTC (permalink / raw)
  To: Jim Wilson; +Cc: gcc-bugs

Thank you for your reply. Here is the what I did:
1. I downloaded gcc2.95.2 and unzip it.
2. I created a Obj directory and configure gcc using
the following command:
>.../configure --prefix=.... --enable-coverage
3. I modified the makefile under the Obj directory by
changing the original line:
CC = gcc  TO
CC = gcc -fprofile-arcs -ftest-coverage
4. Then, I typed command:
>make bootstrap
5. Under directory: ..../Obj/gcc I typed in:
>gcov genrtl.c
48.77% of 365 source lines executed in file genrtl.c
Creating genrtl.c.gcov

By now, I did not run the testsuite yet. But I've got
48.77% covered for genrtl.c. 
I modified the Makefile because only by adding
--enable-coverage no .bb file generated. Therefore
gcov cannot be used. I doubt if I added the
"-fprofile-arcs -ftest-coverage" option in wrong
place. I do want the coverage info showing when I run
the testsuite one by one. That's why What I'm doing.

Hope this will help you help me figure out the fault I
made. Thank you again for your help.

Jane
--- Jim Wilson <wilson@specifixinc.com> wrote:
> Jane chen wrote:
> > I'm trying to use gcov to get the coverage
> information
> > while running testsuite for GCC. However, right
> after
> > I compile gcc source code (after I type in the
> command
> > "make bootstrap"), I run gcov, there is already
> > coverage info there although I did not run any
> > testsuite yet!
> 
> You need to give us more info.  What commands you
> typed, what output you 
> got, and why you think this output is wrong.
> 
> If particular, you need to explain what you mean
> when you say that there 
> was already coverage info there.
> 
> > Can anybody tell me what's wrong and how to get
> rid of
> > those coverage info before I start to run
> testsuite?
> 
> You get rid of coverage info by deleting the files
> that contain it. 
> Deleting the .gcda files should do.  However, I am
> skeptical that there 
> are any .gcda files there.  (In older gcc versions,
> these would be .da 
> files.)
> 
> If you have already run the testsuite, then there
> will be some coverage 
> info generated because the testsuite tests gcov.
> -- 
> Jim Wilson, GNU Tools Support,
> http://www.SpecifixInc.com
> 


__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: testing GCC
  2004-02-25  3:55   ` Jane chen
@ 2004-02-25  6:27     ` Jim Wilson
  2004-02-26  5:43       ` Jane chen
  0 siblings, 1 reply; 6+ messages in thread
From: Jim Wilson @ 2004-02-25  6:27 UTC (permalink / raw)
  To: Jane chen; +Cc: gcc-bugs

On Tue, 2004-02-24 at 19:55, Jane chen wrote:
> By now, I did not run the testsuite yet. But I've got
> 48.77% covered for genrtl.c. 

The "make bootstrap" command causes gcc to be built 3 times.  The first
time it is built by the compiler in the path.  The second and third
times it builds itself.  This allows us to perform a consistency check
to make sure the compiler is working before it is installed.

Since the instrumented compiler is building itself, it will generate
profile data when this happens.

Also, the "make bootstrap" command causes various libraries to be built,
and profile data will be generated when the libraries are built.

If you want to ignore this profile data, you can delete the .da (.gcda)
files before running the testsuite.

> I modified the Makefile because only by adding
> --enable-coverage no .bb file generated. Therefore
> gcov cannot be used. 

This is because gcc-2.95 is old, and does not support the
--enable-coverage configure option.  This configure option just gets
silently ignored.  You need gcc-3.3 or later for this to work.  Hence
for gcc-2.95 you have to modify the Makefile.

Setting CC is probably wrong.  This only gets used for the first
compiler build.  It will not be used for the second or third compiler
builds.  I think you want to put the options in ALL_CFLAGS instead,
which is what gcc-3.3 does.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: testing GCC
  2004-02-25  6:27     ` Jim Wilson
@ 2004-02-26  5:43       ` Jane chen
  2004-02-26 21:53         ` Jim Wilson
  0 siblings, 1 reply; 6+ messages in thread
From: Jane chen @ 2004-02-26  5:43 UTC (permalink / raw)
  To: Jim Wilson; +Cc: gcc-bugs

Thank you so much for your reply. They are pretty
useful. There are no ALL_FLAGS in the Makefile I'm
working on and I tried to put the coverage option in
different places. For example, I put it into
BASE_FLAGS_TO_PASS (in the comments, it said those are
"flags to pass down to all sub_makes"). However, there
are totally 106 *.bb files generated. And there are
totally 139 *.c files existed.
My question is: Is that true that each .c file will
have a corresponding .bb file if I put the coverage
option in right place?

Jane
--- Jim Wilson <wilson@specifixinc.com> wrote:
> On Tue, 2004-02-24 at 19:55, Jane chen wrote:
> > By now, I did not run the testsuite yet. But I've
> got
> > 48.77% covered for genrtl.c. 
> 
> The "make bootstrap" command causes gcc to be built
> 3 times.  The first
> time it is built by the compiler in the path.  The
> second and third
> times it builds itself.  This allows us to perform a
> consistency check
> to make sure the compiler is working before it is
> installed.
> 
> Since the instrumented compiler is building itself,
> it will generate
> profile data when this happens.
> 
> Also, the "make bootstrap" command causes various
> libraries to be built,
> and profile data will be generated when the
> libraries are built.
> 
> If you want to ignore this profile data, you can
> delete the .da (.gcda)
> files before running the testsuite.
> 
> > I modified the Makefile because only by adding
> > --enable-coverage no .bb file generated. Therefore
> > gcov cannot be used. 
> 
> This is because gcc-2.95 is old, and does not
> support the
> --enable-coverage configure option.  This configure
> option just gets
> silently ignored.  You need gcc-3.3 or later for
> this to work.  Hence
> for gcc-2.95 you have to modify the Makefile.
> 
> Setting CC is probably wrong.  This only gets used
> for the first
> compiler build.  It will not be used for the second
> or third compiler
> builds.  I think you want to put the options in
> ALL_CFLAGS instead,
> which is what gcc-3.3 does.
> -- 
> Jim Wilson, GNU Tools Support,
> http://www.SpecifixInc.com
> 


__________________________________
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: testing GCC
  2004-02-26  5:43       ` Jane chen
@ 2004-02-26 21:53         ` Jim Wilson
  0 siblings, 0 replies; 6+ messages in thread
From: Jim Wilson @ 2004-02-26 21:53 UTC (permalink / raw)
  To: Jane chen; +Cc: gcc-bugs

On Wed, 2004-02-25 at 21:43, Jane chen wrote:
> useful. There are no ALL_FLAGS in the Makefile I'm
> working on and I tried to put the coverage option in

You are looking at the toplevel Makefile, which is used to build gcc and
everything else.  Try looking at gcc/Makefile instead, which has
ALL_CFLAGS.

See also more recent gcc sources, and look at the COVERAGE_FLAGS support

>"flags to pass down to all sub_makes"). However, there
>are totally 106 *.bb files generated. And there are
>totally 139 *.c files existed.

Some files are only used for some targets, and hence not every .c file
will be compiled for your target.  A better check would be to compare
the number of .bb files against the number of .o files.

Some files are generator programs.  They get compiled by the build
compiler, and then generate a .c file that gets linked into cc1.  The
generator files do not need to be compiled with profile info, as they
will not be part of the compiler.  This may account for some of the
difference in the counts.

I believe that files that contain only data, no code, won't get .bb
files created for them, but I am not sure about this, and there are
probably no such files in the gcc sources anyways.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-02-26 21:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-23 18:21 testing GCC Jane chen
2004-02-25  2:07 ` Jim Wilson
2004-02-25  3:55   ` Jane chen
2004-02-25  6:27     ` Jim Wilson
2004-02-26  5:43       ` Jane chen
2004-02-26 21:53         ` Jim Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).