+2005-03-21 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR other/20564
+ * gcov.c (output_lines): Only output function block summary when
+ outputting branch information.
+ * doc/gcov.texi: Document format of preamble and additional block
+ information lines.
+
2005-03-21 Richard Sandiford <rsandifo@redhat.com>
* libgcc2.h (LIBGCC2_HAS_SF_MODE): New macro.
scale_bbs_frequencies_int.
* tree-ssa-loop-ch.c (copy_loop_headers): Fix profiling info.
->>>>>>> 2.7929
2005-03-18 Kazu Hirata <kazu@cs.umass.edu>
* config/m32r/m32r-protos.h: Remove the prototypes for
(arc_rodata_string, TARGET_OPTIONS): Delete.
* config/arc/arc.opt: New file.
+>>>>>>> 2.7930
2005-03-17 Richard Henderson <rth@redhat.com>
* doc/extend.texi (Weak Pragmas): New section.
@item -u
@itemx --unconditional-branches
-When branch counts are given, include those of unconditional branches.
+When branch probabilities are given, include those of unconditional branches.
Unconditional branches are normally not interesting.
@end table
Additional block information may succeed each line, when requested by
command line option. The @var{execution_count} is @samp{-} for lines
-containing no code and @samp{#####} for lines which were never
-executed. Some lines of information at the start have @var{line_number}
-of zero.
+containing no code and @samp{#####} for lines which were never executed.
+Some lines of information at the start have @var{line_number} of zero.
+
+The preamble lines are of the form
+
+@smallexample
+-:0:@var{tag}:@var{value}
+@end smallexample
+
+The ordering and number of these preamble lines will be augmented as
+@command{gcov} development progresses --- do not rely on them remaining
+unchanged. Use @var{tag} to locate a particular preamble line.
+
+The additional block information is of the form
+
+@smallexample
+@var{tag} @var{information}
+@end smallexample
+
+The @var{information} is human readable, but designed to be simple
+enough for machine parsing too.
When printing percentages, 0% and 100% are only printed when the values
are @emph{exactly} 0% and 100% respectively. Other values which would
-: 1:#include <stdio.h>
-: 2:
-: 3:int main (void)
-function main called 1 returned 1 blocks executed 75%
1: 4:@{
1: 5: int i, total;
-: 6:
-: 1:#include <stdio.h>
-: 2:
-: 3:int main (void)
-function main called 1 returned 1 blocks executed 75%
1: 4:@{
1: 4-block 0
1: 5: int i, total;
-: 17:@}
@end smallexample
+For each function, a line is printed showing how many times the function
+is called, how many times it returns and what percentage of the
+function's blocks were executed.
+
For each basic block, a line is printed after the last line of the basic
block describing the branch or call that ends the basic block. There can
be multiple branches and calls listed for a single source line if there
const line_t *line; /* current line info ptr. */
char string[STRING_SIZE]; /* line buffer. */
char const *retval = ""; /* status of source file reading. */
- function_t *fn = src->functions;
+ function_t *fn = NULL;
fprintf (gcov_file, "%9s:%5d:Source:%s\n", "-", 0, src->name);
fprintf (gcov_file, "%9s:%5d:Graph:%s\n", "-", 0, bbg_file_name);
}
}
+ if (flag_branches)
+ fn = src->functions;
+
for (line_num = 1, line = &src->lines[line_num];
line_num < src->num_lines; line_num++, line++)
{
{
arc_t *arc = fn->blocks[fn->num_blocks - 1].pred;
gcov_type return_count = fn->blocks[fn->num_blocks - 1].count;
-
+
for (; arc; arc = arc->pred_next)
if (arc->fake)
return_count -= arc->count;
-
+
fprintf (gcov_file, "function %s", fn->name);
fprintf (gcov_file, " called %s",
format_gcov (fn->blocks[0].count, 0, -1));