From patchwork Mon Feb 28 09:39:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 1598575 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=1RRyTddv; dkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=3WjCy/r0; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K6b2C69wVz9sGS for ; Mon, 28 Feb 2022 20:39:46 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 43B85385802B for ; Mon, 28 Feb 2022 09:39:44 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 0B4B83858C20 for ; Mon, 28 Feb 2022 09:39:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0B4B83858C20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B54901F3AB for ; Mon, 28 Feb 2022 09:39:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1646041171; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a26pMEW6MeAUm3iOB4j90M2vLBf2RgiJQ+j0slLiMWY=; b=1RRyTddvI3Aq1pikGcFjlrbDs2czbUEuS7rI0MyYBkKbQ2yNSpjGFsfLTCHJYoy/C8vgYZ dca+0TvzJ7sGc8n6aCVwMF3OiZ/yVrge3blPLHW6F0wTF40kCloUlUOgeYrWy+5Yj9BWVp dGx7L7spTnwm3UoX+rmXBA4Xx0VvgEc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1646041171; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a26pMEW6MeAUm3iOB4j90M2vLBf2RgiJQ+j0slLiMWY=; b=3WjCy/r0jNFCgJ+1w0tqxE+ldDD0y+g95V7jOMYNC09iX7yZAAz788wtmJNYGzToDfiIcT VNsS/m/ZSmxONaCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9998413AA8 for ; Mon, 28 Feb 2022 09:39:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gln/I1OYHGL1WgAAMHmgww (envelope-from ) for ; Mon, 28 Feb 2022 09:39:31 +0000 Message-ID: <9c1a2563-9e05-b167-f6e7-5a78237812cc@suse.cz> Date: Mon, 28 Feb 2022 10:39:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] docs: Document more .gcda file name generation. To: gcc-patches@gcc.gnu.org Content-Language: en-US X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This makes documentation more precise. Ready to be installed? Thanks, Martin PR gcov-profile/104677 gcc/ChangeLog: * doc/invoke.texi: Document more .gcda file name generation. --- 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