From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id CAB1F3858427; Mon, 28 Feb 2022 09:37:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CAB1F3858427 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/marxin/heads/PR104677-update-gcda-names-docs)] docs: Document more .gcda file name generation. X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/users/marxin/heads/PR104677-update-gcda-names-docs X-Git-Oldrev: f485b0ed7d06482d2f212ff0d9f5519a4f2c9a15 X-Git-Newrev: f9ac37e503780b28e2a40072d15f0637a942b9b0 Message-Id: <20220228093757.CAB1F3858427@sourceware.org> Date: Mon, 28 Feb 2022 09:37:57 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2022 09:37:57 -0000 https://gcc.gnu.org/g:f9ac37e503780b28e2a40072d15f0637a942b9b0 commit f9ac37e503780b28e2a40072d15f0637a942b9b0 Author: Martin Liska Date: Mon Feb 28 10:37:15 2022 +0100 docs: Document more .gcda file name generation. PR gcov-profile/104677 gcc/ChangeLog: * doc/invoke.texi: Document more .gcda file name generation. Diff: --- gcc/doc/invoke.texi | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index ec291c06542..07da1eb2047 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -13459,6 +13459,7 @@ counts to a file called @file{@var{sourcename}.gcda} for each source file. The information in this data file is very dependent on the structure of the generated code, so you must use the same source code and the same optimization options for both compilations. +See details about the file naming in @option{-fprofile-arcs}. With @option{-fbranch-probabilities}, GCC puts a @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}. @@ -15237,6 +15238,12 @@ explicitly specified and it is not the final executable, otherwise it is the basename of the source file. In both cases any suffix is removed (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}). + +Note that if a command line directly links source files, the corresponding +@var{.gcda} files will be prefixed with a name of the output file. +E.g. @code{gcc a.c b.c -o binary} would generate @file{binary-a.gcda} and +@file{binary-b.gcda} files. + @xref{Cross-profiling}. @cindex @command{gcov} @@ -15330,7 +15337,8 @@ profile data file appears in the same directory as the object file. In order to prevent the file name clashing, if the object file name is not an absolute path, we mangle the absolute path of the @file{@var{sourcename}.gcda} file and use it as the file name of a -@file{.gcda} file. See similar option @option{-fprofile-note}. +@file{.gcda} file. See details about the file naming in @option{-fprofile-arcs}. +See similar option @option{-fprofile-note}. When an executable is run in a massive parallel environment, it is recommended to save profile to different folders. That can be done with variables