summaryrefslogtreecommitdiff
path: root/gcc/doc/gcov.texi
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-09 12:54:19 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-09 12:54:19 +0000
commit90c2be4439c656f63074408d6c91442511a9e061 (patch)
treeda04474c0297ae3c91b3bdce0c519ca2f9d2e5a8 /gcc/doc/gcov.texi
parent40734805198ef874623eb7be9ec3de9251c799b7 (diff)
downloadgcc-90c2be4439c656f63074408d6c91442511a9e061.tar.gz
* final.c (end_final): Use C trees to output data structures for profiling.
* Makefile.in (LIBGCC_DEPS): Added missing dependency on gcov-io.h (profile.o): New dependency profile.h (final.o): New dependency profile.h * profile.h: New file. New global structure profile_info. * final.h (count_edges_instrumented_now): Declare. (current_function_cfg_checksum): Declare. (function_list): New structure. (functions_head, functions_tail): New static variables. (end_final): Emits more data, removed some -ax stuff. (final): Stores function names and chcksums. * gcov-io.h (__write_gcov_string): New function. (__read_gcov_string): New function. * gcov.c (read_profile): New function. (create_program_flow_graph): Uses read_profile instead of reading da_file. (read_files): Removed da_file checking, it's done by read_profile now. * libgcc2.c (bb_function_info): New structure. (bb): New field in structure, removed some -ax stuff. (__bb_exit_func): Changed structure of da_file. * profile.c (count_edges_instrumented_now): New global variable. (current_function_cfg_checksum): New global variable. (max_counter_in_program): New global variable. (get_exec_counts): New function. (compute_checksum): New function. (instrument_edges): Sets count_edges_instrumented_now. (compute_branch_probabilities): Uses get_exec_counts instead of reading da_file. (branch_prob): Calls compute_checksum and writes extra data to bbg_file. (init_branch_prob): Removed da_file checking, done in get_exec_counts now. (end_branch_prob): Removed da_file checking, done in get_exec_counts now. * gcov.texi: Updated information about gcov file format. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53326 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doc/gcov.texi')
-rw-r--r--gcc/doc/gcov.texi40
1 files changed, 31 insertions, 9 deletions
diff --git a/gcc/doc/gcov.texi b/gcc/doc/gcov.texi
index 86b64e0e8e5..5f5f18bd6d1 100644
--- a/gcc/doc/gcov.texi
+++ b/gcc/doc/gcov.texi
@@ -363,6 +363,8 @@ program flow.
In the @file{.bbg} file, the format is:
@smallexample
+ name of function #0
+ checksum of function #0
number of basic blocks for function #0 (4-byte number)
total number of arcs for function #0 (4-byte number)
count of arcs in basic block #0 (4-byte number)
@@ -383,6 +385,9 @@ A @minus{}1 (stored as a 4-byte number) is used to separate each function's
list of basic blocks, and to verify that the file has been read
correctly.
+The function name is stored as a @minus{}1 (4 bytes), the length (4 bytes),
+the name itself (padded to 4-byte boundary) followed by a @minus{}1 (4 bytes).
+
The @file{.da} file is generated when a program containing object files
built with the GCC @option{-fprofile-arcs} option is executed. A
separate @file{.da} file is created for each source file compiled with
@@ -390,15 +395,32 @@ this option, and the name of the @file{.da} file is stored as an
absolute pathname in the resulting object file. This path name is
derived from the source file name by substituting a @file{.da} suffix.
-The format of the @file{.da} file is fairly simple. The first 8-byte
-number is the number of counts in the file, followed by the counts
-(stored as 8-byte numbers). Each count corresponds to the number of
-times each arc in the program is executed. The counts are cumulative;
-each time the program is executed, it attempts to combine the existing
-@file{.da} files with the new counts for this invocation of the
-program. It ignores the contents of any @file{.da} files whose number of
-arcs doesn't correspond to the current program, and merely overwrites
-them instead.
+The @file{.da} consists of several blocks (one for each run) with the following structure:
+@smallexample
+ "magic" number @minus{}123 (4-byte number)
+ number of functions (4-byte number)
+ length of the "extension block" in bytes
+ extension block (variable length)
+ name of function #0 (the same format as in .bbg file)
+ checksum of function #0
+ number of instrumented arcs (4-byte number)
+ count of arc #0 (8-byte number)
+ count of arc #1 (8-byte number)
+ @dots{}
+ count of arc #M_0 (8-byte number)
+ name of function #1 (the same format as in .bbg file)
+ checksum of function #1
+ @dots{}
+@end smallexample
+The current structure of the extension block is as follows:
+@smallexample
+ number of instrumented arcs in whole program (4-byte number)
+ sum all of instrumented arcs in whole program (8-byte number)
+ maximal value of counter in whole program (8-byte number)
+ number of instrumented arcs in the object file (4-byte number)
+ sum all of instrumented arcs in the object file (8-byte number)
+ maximal value of counter in the object file (8-byte number)
+@end smallexample
All three of these files use the functions in @file{gcov-io.h} to store
integers; the functions in this header provide a machine-independent