Commit 6f3102fd by Martin Liska Committed by Martin Liska

Add version to intermediate gcov file (PR gcov-profile/83669).

2018-01-04  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/83669
	* gcov.c (output_intermediate_file): Add version to intermediate
	gcov file.
	* doc/gcov.texi: Document new field 'version' in intermediate
	file format. Fix location of '-k' option of gcov command.

From-SVN: r256227
parent fcb6fced
2018-01-04 Martin Liska <mliska@suse.cz> 2018-01-04 Martin Liska <mliska@suse.cz>
PR gcov-profile/83669
* gcov.c (output_intermediate_file): Add version to intermediate
gcov file.
* doc/gcov.texi: Document new field 'version' in intermediate
file format. Fix location of '-k' option of gcov command.
2018-01-04 Martin Liska <mliska@suse.cz>
PR ipa/82352 PR ipa/82352
* ipa-icf.c (sem_function::merge): Do not cross comdat boundary. * ipa-icf.c (sem_function::merge): Do not cross comdat boundary.
......
...@@ -187,11 +187,8 @@ be used by @command{lcov} or other tools. The output is a single ...@@ -187,11 +187,8 @@ be used by @command{lcov} or other tools. The output is a single
The format of the intermediate @file{.gcov} file is plain text with The format of the intermediate @file{.gcov} file is plain text with
one entry per line one entry per line
@item -j
@itemx --human-readable
Write counts in human readable format (like 24k).
@smallexample @smallexample
version:@var{gcc_version}
file:@var{source_file_name} file:@var{source_file_name}
function:@var{start_line_number},@var{end_line_number},@var{execution_count},@var{function_name} function:@var{start_line_number},@var{end_line_number},@var{execution_count},@var{function_name}
lcount:@var{line number},@var{execution_count},@var{has_unexecuted_block} lcount:@var{line number},@var{execution_count},@var{has_unexecuted_block}
...@@ -212,6 +209,7 @@ times. ...@@ -212,6 +209,7 @@ times.
Here is a sample when @option{-i} is used in conjunction with @option{-b} option: Here is a sample when @option{-i} is used in conjunction with @option{-b} option:
@smallexample @smallexample
version: 8.1.0 20180103
file:tmp.cpp file:tmp.cpp
function:7,7,0,_ZN3FooIcEC2Ev function:7,7,0,_ZN3FooIcEC2Ev
function:7,7,1,_ZN3FooIiEC2Ev function:7,7,1,_ZN3FooIiEC2Ev
...@@ -252,6 +250,10 @@ branch:35,nottaken ...@@ -252,6 +250,10 @@ branch:35,nottaken
lcount:36,1,0 lcount:36,1,0
@end smallexample @end smallexample
@item -j
@itemx --human-readable
Write counts in human readable format (like 24k).
@item -k @item -k
@itemx --use-colors @itemx --use-colors
......
...@@ -1035,6 +1035,7 @@ file 'foo.cc.gcov' similar to the above example. */ ...@@ -1035,6 +1035,7 @@ file 'foo.cc.gcov' similar to the above example. */
static void static void
output_intermediate_file (FILE *gcov_file, source_info *src) output_intermediate_file (FILE *gcov_file, source_info *src)
{ {
fprintf (gcov_file, "version:%s\n", version_string);
fprintf (gcov_file, "file:%s\n", src->name); /* source file name */ fprintf (gcov_file, "file:%s\n", src->name); /* source file name */
std::sort (src->functions.begin (), src->functions.end (), std::sort (src->functions.begin (), src->functions.end (),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment