public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/105063] New: [GCOV] Ability to map .gcda paths
@ 2022-03-26 16:31 vit9696 at protonmail dot com
  2022-03-28 10:34 ` [Bug gcov-profile/105063] " marxin at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: vit9696 at protonmail dot com @ 2022-03-26 16:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105063

            Bug ID: 105063
           Summary: [GCOV] Ability to map .gcda paths
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vit9696 at protonmail dot com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

When compiling code with `-fprofile-arcs` gcc encodes .gcda file path relative
to object file. In some cases this is infeasible, as the compilation directory
may have extra long prefix, which is not practical to store on embedded
targets.

To avoid this issue we would like to replace this prefix with a custom value.
Currently there are 3 options in GCC, which allow one to do coverage file
mapping:

* -fprofile-dir
* -fprofile-prefix-map
* -fprofile-prefix-path

We assumed that at least one of them should do what we need, yet it is not
true:

* Normal gives /app/output.gcda (https://godbolt.org/z/jaj6vhnd5)
* -fprofile-dir=/test gives /test//app/output.gcda
(https://godbolt.org/z/8h7brYE84)
* -fprofile-prefix-map=/app=/test gives /app/output.gcda
(https://godbolt.org/z/c9TxeMPzM)
* -fprofile-prefix-path=/test -fprofile-generate=/app give
/app//app/output.gcda (https://godbolt.org/z/bh7esxPcK)

I see two routes to solve this issue:

1. One of the existing options is fixed to do this. E.g.
-fprofile-prefix-map=/app=/test could result in /test/output.gcda.
2. A new option is introduced to map gcda files.

The relevant code is in coverage.cc:coverage_init
(https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/coverage.cc;h=8ece5db680e614f8225d9e8407dd89bd27020b4d;hb=refs/heads/master#l1253).

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2024-05-07  7:40 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-26 16:31 [Bug gcov-profile/105063] New: [GCOV] Ability to map .gcda paths vit9696 at protonmail dot com
2022-03-28 10:34 ` [Bug gcov-profile/105063] " marxin at gcc dot gnu.org
2022-03-30  9:15 ` vit9696 at protonmail dot com
2022-03-30 10:46 ` marxin at gcc dot gnu.org
2022-03-30 17:22 ` vit9696 at protonmail dot com
2022-03-31  7:06 ` marxin at gcc dot gnu.org
2022-03-31  7:19 ` vit9696 at protonmail dot com
2022-03-31  7:45 ` marxin at gcc dot gnu.org
2022-03-31  8:27 ` vit9696 at protonmail dot com
2022-03-31  8:46 ` marxin at gcc dot gnu.org
2022-03-31 11:30 ` vit9696 at protonmail dot com
2022-03-31 11:34 ` marxin at gcc dot gnu.org
2022-03-31 11:47 ` vit9696 at protonmail dot com
2022-03-31 12:27 ` marxin at gcc dot gnu.org
2022-03-31 16:16 ` vit9696 at protonmail dot com
2022-04-06 12:14 ` marxin at gcc dot gnu.org
2023-04-03  8:57 ` marxin at gcc dot gnu.org
2023-04-03  9:03 ` marxin at gcc dot gnu.org
2024-05-07  7:39 ` rguenth at gcc dot gnu.org

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).