* [PATCH] Add version to intermediate gcov file (PR gcov-profile/83669).
@ 2018-01-03 13:25 Martin Liška
2018-01-03 15:12 ` Nathan Sidwell
2018-01-04 18:40 ` Marco Castelluccio
0 siblings, 2 replies; 3+ messages in thread
From: Martin Liška @ 2018-01-03 13:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Nathan Sidwell, Marco Castelluccio
[-- Attachment #1: Type: text/plain, Size: 649 bytes --]
Hi.
This is small enhancement reported by users of gcov tool. I'm aware of current stage of GCC,
but it's really small change in code. Apart from that, a small fix to documentation is included.
Survives gcov.exp, may I install it?
Thanks,
Martin
gcc/ChangeLog:
2018-01-03 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.
---
gcc/doc/gcov.texi | 10 ++++++----
gcc/gcov.c | 1 +
2 files changed, 7 insertions(+), 4 deletions(-)
[-- Attachment #2: 0001-Add-version-to-intermediate-gcov-file-PR-gcov-profil.patch --]
[-- Type: text/x-patch, Size: 1527 bytes --]
diff --git a/gcc/doc/gcov.texi b/gcc/doc/gcov.texi
index 8bf422e58d8..be7364d9da9 100644
--- a/gcc/doc/gcov.texi
+++ b/gcc/doc/gcov.texi
@@ -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
one entry per line
-@item -j
-@itemx --human-readable
-Write counts in human readable format (like 24k).
-
@smallexample
+version:@var{gcc_version}
file:@var{source_file_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}
@@ -212,6 +209,7 @@ times.
Here is a sample when @option{-i} is used in conjunction with @option{-b} option:
@smallexample
+version: 8.1.0 20180103
file:tmp.cpp
function:7,7,0,_ZN3FooIcEC2Ev
function:7,7,1,_ZN3FooIiEC2Ev
@@ -252,6 +250,10 @@ branch:35,nottaken
lcount:36,1,0
@end smallexample
+@item -j
+@itemx --human-readable
+Write counts in human readable format (like 24k).
+
@item -k
@itemx --use-colors
diff --git a/gcc/gcov.c b/gcc/gcov.c
index 24e6da09fcf..3c7881b13fa 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -1035,6 +1035,7 @@ file 'foo.cc.gcov' similar to the above example. */
static void
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 */
std::sort (src->functions.begin (), src->functions.end (),
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Add version to intermediate gcov file (PR gcov-profile/83669).
2018-01-03 13:25 [PATCH] Add version to intermediate gcov file (PR gcov-profile/83669) Martin Liška
@ 2018-01-03 15:12 ` Nathan Sidwell
2018-01-04 18:40 ` Marco Castelluccio
1 sibling, 0 replies; 3+ messages in thread
From: Nathan Sidwell @ 2018-01-03 15:12 UTC (permalink / raw)
To: Martin Liška, gcc-patches; +Cc: Marco Castelluccio
On 01/03/2018 08:25 AM, Martin Liška wrote:
> This is small enhancement reported by users of gcov tool. I'm aware of current stage of GCC,
> but it's really small change in code. Apart from that, a small fix to documentation is included.
yeah, this is useful, thanks.
nathan
--
Nathan Sidwell
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Add version to intermediate gcov file (PR gcov-profile/83669).
2018-01-03 13:25 [PATCH] Add version to intermediate gcov file (PR gcov-profile/83669) Martin Liška
2018-01-03 15:12 ` Nathan Sidwell
@ 2018-01-04 18:40 ` Marco Castelluccio
1 sibling, 0 replies; 3+ messages in thread
From: Marco Castelluccio @ 2018-01-04 18:40 UTC (permalink / raw)
To: Martin Liška, gcc-patches; +Cc: Nathan Sidwell
Hey Martin,
thanks for implementing this!
One quick note, given that the intermediate file contains multiple
"file" sections, maybe it would make more sense to put the "version:" at
the very beginning of the file (maybe outputting it from
https://github.com/gcc-mirror/gcc/blob/7ea14e0563d164603686df7e05bbbd20810b7f80/gcc/gcov.c#L1294)
and not repeat it before each "file:" section.
- Marco.
Il 03/01/2018 14:25, Martin Liška ha scritto:
> Hi.
>
> This is small enhancement reported by users of gcov tool. I'm aware of current stage of GCC,
> but it's really small change in code. Apart from that, a small fix to documentation is included.
>
> Survives gcov.exp, may I install it?
> Thanks,
> Martin
>
> gcc/ChangeLog:
>
> 2018-01-03 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.
> ---
> gcc/doc/gcov.texi | 10 ++++++----
> gcc/gcov.c | 1 +
> 2 files changed, 7 insertions(+), 4 deletions(-)
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-04 18:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-03 13:25 [PATCH] Add version to intermediate gcov file (PR gcov-profile/83669) Martin Liška
2018-01-03 15:12 ` Nathan Sidwell
2018-01-04 18:40 ` Marco Castelluccio
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).