[Bug gcov-profile/89959] gcov: "--long-file-names" is ignored when used in combination with "--hash-filenames"

2019-04-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89959

Martin Liška  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Martin Liška  ---
Documentation fix applied, closing.

[Bug gcov-profile/89959] gcov: "--long-file-names" is ignored when used in combination with "--hash-filenames"

2019-04-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89959

--- Comment #3 from Martin Liška  ---
Author: marxin
Date: Wed Apr 10 11:44:08 2019
New Revision: 270251

URL: https://gcc.gnu.org/viewcvs?rev=270251=gcc=rev
Log:
Make gcov docs more precise (PR gcov-profile/89959).

2019-04-10  Martin Liska  

PR gcov-profile/89959
* doc/gcov.texi: Make documentation of -x option
more precise.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/doc/gcov.texi

[Bug gcov-profile/89959] gcov: "--long-file-names" is ignored when used in combination with "--hash-filenames"

2019-04-04 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89959

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-04-04
   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org
   Target Milestone|--- |9.0
 Ever confirmed|0   |1

--- Comment #2 from Martin Liška  ---
Hi.

Thank you very much for using the GCOV.

> 
> a) Running "gcov -r -s  -o  <.gcda file>" I
> get files like
> 
> .gcov
> 
> 
> b) Running "gcov -p -r -s  -o  <.gcda file>" I
> get files like
> 
> .gcov
> 
> 
> c) Running "gcov -x -r -s  -o  <.gcda file>" I
> get files like
> 
> ##.gcov
> 
> 
> d) Running "gcov -p -l -r -s  -o  <.gcda
> file>" I get files like
> 
> ##.gcov
> 
> 
> e) Running "gcov -x -l -r -s  -o  <.gcda
> file>" I get files like
> 
> ##.gcov
> 
> 
> 
> Notice that 'c' and 'e' are identical, "-l" in 'e' has had no effect. I
> would have expected 'e' to be
> 
> .gcov
> 
> 
> 
> Also, notice that the documentation for --hash-filenames starts by saying:
> "By default, gcov uses the full pathname of the source files to create an
> output filename." That's incorrect, by default it uses only the filename.

Correct, I'll fix that in documentation.

> The documentation would be more clear if it would describe
> "--hash-filenames" as an alternative to "--preserve-paths".

Exactly, the documentation describes problem of long file-names, but it should
make it clear that -l would be ignored.

 Interestingly,
> when "-x" is being used "-l" is ignored... but "-p" isn't. So it's possible
> to use "-p" and "-x" simultaneously, which makes no sense. You are using
> "-x" to avoid long filenames, but by using it together with "-p" you are
> just making the filename *longer*.

You are right, -p should be also ignored in case of -x usage.

> 
> 
> 
> 
> FWIW the reason I'm using "-l" is not because I "want to see the individual
> contributions". My problem is that I'm using CDash (www.cdash.org), which
> runs gcov once per .gcda instead of running it a single time taking all the
> .gcda files as input (they should fix this
> https://gitlab.kitware.com/cmake/cmake/issues/19124#note_554321, but there
> may be others).
> By running gcov once per .gcda file the .gcov file for a header created by
> one invocation can get overwritten by the next .gcov invocation. Using "-l"
> works around this issue.
> Again, the problem is that CDash is using gcov incorrectly and they should
> fix the issue. But since I suspect they are not the only ones... maybe it
> makes sense to have another option to use the hash of the .gcda file?
> Meaning, running "gcov -x --hash-long-file-names -r -s  -o
>  <.gcda file>" I would get files like
> 
> .gcov

Please now, even now the complexity of option combination is quite huge :)

> 
> Which would let me, using short file names, call gcov once per .gcda file
> without the risk of overwriting .gcov files.

Then I would recommend using -l option.

[Bug gcov-profile/89959] gcov: "--long-file-names" is ignored when used in combination with "--hash-filenames"

2019-04-04 Thread christian.morales.vega at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89959

--- Comment #1 from Cristian Morales Vega  ---
At the end of my previous comment

.gcov

should actually be

##.gcov