mirror of git://gcc.gnu.org/git/gcc.git
coverage.c: Refer to "notes file" instead of "graph file" in all comments.
gcc/ * coverage.c: Refer to "notes file" instead of "graph file" in all comments. Explain history of bbg prefix. * gcov-io.h: Likewise. * gcov.c: Likewise. (find_source): Likewise in fnotice. (read_graph_file): Likewise. (read_count_file): Likewise. * doc/gcov.texi: Document -fprofile-dir flag. Add "notes file" and "data file" explicitly in the explanation of the files. libgcc/ * libgcov.c (__gcov_ior_profiler): Benign comment fix. From-SVN: r189781
This commit is contained in:
parent
fa0f401775
commit
efbb59b21b
|
|
@ -1,3 +1,15 @@
|
||||||
|
2012-07-22 Steven Bosscher <steven@gcc.gnu.org>
|
||||||
|
|
||||||
|
* coverage.c: Refer to "notes file" instead of "graph file"
|
||||||
|
in all comments. Explain history of bbg prefix.
|
||||||
|
* gcov-io.h: Likewise.
|
||||||
|
* gcov.c: Likewise.
|
||||||
|
(find_source): Likewise in fnotice.
|
||||||
|
(read_graph_file): Likewise.
|
||||||
|
(read_count_file): Likewise.
|
||||||
|
* doc/gcov.texi: Document -fprofile-dir flag. Add "notes file"
|
||||||
|
and "data file" explicitly in the explanation of the files.
|
||||||
|
|
||||||
2012-07-22 Steven Bosscher <steven@gcc.gnu.org>
|
2012-07-22 Steven Bosscher <steven@gcc.gnu.org>
|
||||||
|
|
||||||
PR tree-optimization/53881
|
PR tree-optimization/53881
|
||||||
|
|
|
||||||
|
|
@ -97,14 +97,16 @@ static GTY(()) tree gcov_info_var;
|
||||||
static GTY(()) tree gcov_fn_info_type;
|
static GTY(()) tree gcov_fn_info_type;
|
||||||
static GTY(()) tree gcov_fn_info_ptr_type;
|
static GTY(()) tree gcov_fn_info_ptr_type;
|
||||||
|
|
||||||
/* Name of the output file for coverage output file. If this is NULL
|
/* Name of the notes (gcno) output file. The "bbg" prefix is for
|
||||||
we're not writing to the notes file. */
|
historical reasons, when the notes file contained only the
|
||||||
|
basic block graph notes.
|
||||||
|
If this is NULL we're not writing to the notes file. */
|
||||||
static char *bbg_file_name;
|
static char *bbg_file_name;
|
||||||
|
|
||||||
/* File stamp for graph file. */
|
/* File stamp for notes file. */
|
||||||
static unsigned bbg_file_stamp;
|
static unsigned bbg_file_stamp;
|
||||||
|
|
||||||
/* Name of the count data file. */
|
/* Name of the count data (gcda) file. */
|
||||||
static char *da_file_name;
|
static char *da_file_name;
|
||||||
|
|
||||||
/* Hash table of count data. */
|
/* Hash table of count data. */
|
||||||
|
|
@ -566,7 +568,7 @@ coverage_compute_cfg_checksum (void)
|
||||||
return chksum;
|
return chksum;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Begin output to the graph file for the current function.
|
/* Begin output to the notes file for the current function.
|
||||||
Writes the function header. Returns nonzero if data should be output. */
|
Writes the function header. Returns nonzero if data should be output. */
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
@ -1079,7 +1081,7 @@ coverage_obj_finish (VEC(constructor_elt,gc) *ctor)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Perform file-level initialization. Read in data file, generate name
|
/* Perform file-level initialization. Read in data file, generate name
|
||||||
of graph file. */
|
of notes file. */
|
||||||
|
|
||||||
void
|
void
|
||||||
coverage_init (const char *filename)
|
coverage_init (const char *filename)
|
||||||
|
|
@ -1131,7 +1133,7 @@ coverage_init (const char *filename)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Performs file-level cleanup. Close graph file, generate coverage
|
/* Performs file-level cleanup. Close notes file, generate coverage
|
||||||
variables and constructor. */
|
variables and constructor. */
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -551,20 +551,23 @@ collected at that point to be dumped to @file{.gcda} output files.
|
||||||
|
|
||||||
@command{gcov} uses two files for profiling. The names of these files
|
@command{gcov} uses two files for profiling. The names of these files
|
||||||
are derived from the original @emph{object} file by substituting the
|
are derived from the original @emph{object} file by substituting the
|
||||||
file suffix with either @file{.gcno}, or @file{.gcda}. All of these files
|
file suffix with either @file{.gcno}, or @file{.gcda}. The files
|
||||||
are placed in the same directory as the object file, and contain data
|
contain coverage and profile data stored in a platform-independent format.
|
||||||
stored in a platform-independent format.
|
The @file{.gcno} files are placed in the same directory as the object
|
||||||
|
file. By default, the @file{.gcda} files are also stored in the same
|
||||||
|
directory as the object file, but the GCC @option{-profile-dir} option
|
||||||
|
may be used to store the @file{.gcda} files in a separate directory.
|
||||||
|
|
||||||
The @file{.gcno} file is generated when the source file is compiled with
|
The @file{.gcno} notes file is generated when the source file is compiled
|
||||||
the GCC @option{-ftest-coverage} option. It contains information to
|
with the GCC @option{-ftest-coverage} option. It contains information to
|
||||||
reconstruct the basic block graphs and assign source line numbers to
|
reconstruct the basic block graphs and assign source line numbers to
|
||||||
blocks.
|
blocks.
|
||||||
|
|
||||||
The @file{.gcda} file is generated when a program containing object files
|
The @file{.gcda} count data file is generated when a program containing
|
||||||
built with the GCC @option{-fprofile-arcs} option is executed. A
|
object files built with the GCC @option{-fprofile-arcs} option is executed.
|
||||||
separate @file{.gcda} file is created for each object file compiled with
|
A separate @file{.gcda} file is created for each object file compiled with
|
||||||
this option. It contains arc transition counts, and some summary
|
this option. It contains arc transition counts, value profile counts, and
|
||||||
information.
|
some summary information.
|
||||||
|
|
||||||
The full details of the file format is specified in @file{gcov-io.h},
|
The full details of the file format is specified in @file{gcov-io.h},
|
||||||
and functions provided in that header file should be used to access the
|
and functions provided in that header file should be used to access the
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||||
tags, values [41..9f] for the notes file and [a1..ff] for the data
|
tags, values [41..9f] for the notes file and [a1..ff] for the data
|
||||||
file.
|
file.
|
||||||
|
|
||||||
The basic block graph file contains the following records
|
The notes file contains the following records
|
||||||
note: unit function-graph*
|
note: unit function-graph*
|
||||||
unit: header int32:checksum string:source
|
unit: header int32:checksum string:source
|
||||||
function-graph: announce_function basic_blocks {arcs | lines}*
|
function-graph: announce_function basic_blocks {arcs | lines}*
|
||||||
|
|
|
||||||
16
gcc/gcov.c
16
gcc/gcov.c
|
|
@ -286,14 +286,16 @@ static unsigned total_executed;
|
||||||
|
|
||||||
static time_t bbg_file_time;
|
static time_t bbg_file_time;
|
||||||
|
|
||||||
/* Name and file pointer of the input file for the basic block graph. */
|
/* Name of the notes (gcno) output file. The "bbg" prefix is for
|
||||||
|
historical reasons, when the notes file contained only the
|
||||||
|
basic block graph notes. */
|
||||||
|
|
||||||
static char *bbg_file_name;
|
static char *bbg_file_name;
|
||||||
|
|
||||||
/* Stamp of the bbg file */
|
/* Stamp of the bbg file */
|
||||||
static unsigned bbg_stamp;
|
static unsigned bbg_stamp;
|
||||||
|
|
||||||
/* Name and file pointer of the input file for the arc count data. */
|
/* Name and file pointer of the input file for the count data (gcda). */
|
||||||
|
|
||||||
static char *da_file_name;
|
static char *da_file_name;
|
||||||
|
|
||||||
|
|
@ -976,7 +978,7 @@ find_source (const char *file_name)
|
||||||
{
|
{
|
||||||
static int info_emitted;
|
static int info_emitted;
|
||||||
|
|
||||||
fnotice (stderr, "%s:source file is newer than graph file '%s'\n",
|
fnotice (stderr, "%s:source file is newer than notes file '%s'\n",
|
||||||
file_name, bbg_file_name);
|
file_name, bbg_file_name);
|
||||||
if (!info_emitted)
|
if (!info_emitted)
|
||||||
{
|
{
|
||||||
|
|
@ -990,7 +992,7 @@ find_source (const char *file_name)
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read the graph file. Return list of functions read -- in reverse order. */
|
/* Read the notes file. Return list of functions read -- in reverse order. */
|
||||||
|
|
||||||
static function_t *
|
static function_t *
|
||||||
read_graph_file (void)
|
read_graph_file (void)
|
||||||
|
|
@ -1006,13 +1008,13 @@ read_graph_file (void)
|
||||||
|
|
||||||
if (!gcov_open (bbg_file_name, 1))
|
if (!gcov_open (bbg_file_name, 1))
|
||||||
{
|
{
|
||||||
fnotice (stderr, "%s:cannot open graph file\n", bbg_file_name);
|
fnotice (stderr, "%s:cannot open notes file\n", bbg_file_name);
|
||||||
return fns;
|
return fns;
|
||||||
}
|
}
|
||||||
bbg_file_time = gcov_time ();
|
bbg_file_time = gcov_time ();
|
||||||
if (!gcov_magic (gcov_read_unsigned (), GCOV_NOTE_MAGIC))
|
if (!gcov_magic (gcov_read_unsigned (), GCOV_NOTE_MAGIC))
|
||||||
{
|
{
|
||||||
fnotice (stderr, "%s:not a gcov graph file\n", bbg_file_name);
|
fnotice (stderr, "%s:not a gcov notes file\n", bbg_file_name);
|
||||||
gcov_close ();
|
gcov_close ();
|
||||||
return fns;
|
return fns;
|
||||||
}
|
}
|
||||||
|
|
@ -1248,7 +1250,7 @@ read_count_file (function_t *fns)
|
||||||
tag = gcov_read_unsigned ();
|
tag = gcov_read_unsigned ();
|
||||||
if (tag != bbg_stamp)
|
if (tag != bbg_stamp)
|
||||||
{
|
{
|
||||||
fnotice (stderr, "%s:stamp mismatch with graph file\n", da_file_name);
|
fnotice (stderr, "%s:stamp mismatch with notes file\n", da_file_name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
2012-07-22 Steven Bosscher <steven@gcc.gnu.org>
|
||||||
|
|
||||||
|
* libgcov.c (__gcov_ior_profiler): Benign comment fix.
|
||||||
|
|
||||||
2012-07-19 Tristan Gingold <gingold@adacore.com>
|
2012-07-19 Tristan Gingold <gingold@adacore.com>
|
||||||
Richard Henderson <rth@redhat.com>
|
Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1040,8 +1040,7 @@ __gcov_average_profiler (gcov_type *counters, gcov_type value)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef L_gcov_ior_profiler
|
#ifdef L_gcov_ior_profiler
|
||||||
/* Increase corresponding COUNTER by VALUE. FIXME: Perhaps we want
|
/* Bitwise-OR VALUE into COUNTER. */
|
||||||
to saturate up. */
|
|
||||||
|
|
||||||
void
|
void
|
||||||
__gcov_ior_profiler (gcov_type *counters, gcov_type value)
|
__gcov_ior_profiler (gcov_type *counters, gcov_type value)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue