From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 37E893858430; Fri, 15 Apr 2022 22:41:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37E893858430 From: "esgergn at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug gcov-profile/105238] Regression: using -fprofile-dir: gcno files not ccache cachable anymore / gcovr report broken Date: Fri, 15 Apr 2022 22:41:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: gcov-profile X-Bugzilla-Version: 9.4.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: esgergn at hotmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2022 22:41:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105238 --- Comment #7 from Esger Abbink --- Building a real project with the patched gcc9.4 and ccache 4.5.1 (replacing -fprofile-dir with -fprofile-prefix-map=3D${CMAKE_SOURCE_DIR}=3D.) it looks= ok at first sight: - 100% cache hits for the second compilation in a different directory - gcda created next to .o & .gcda for both first and second compilations/directories However when running the unittests binaries there are quite a number of gcov warnings: [=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D] 2807 tests from 297 test suites ran. (2729= 28 ms total) [ PASSED ] 2807 tests. libgcov profiling error: :overwriting an existing profile data with a different timestamp libgcov profiling error:#:overwriting an existing profile data with a diffe= rent timestamp libgcov profiling error: :overwriting an existing profile data with a different timestamp libgcov profiling error::overwriting an existing profile data with a differ= ent timestamp libgcov profiling error::overwriting an existing profile data with a differ= ent timestamp libgcov profiling error:#:overwriting an existing profile data with a diffe= rent timestamp libgcov profiling error:&:overwriting an existing profile data with a diffe= rent timestamp libgcov profiling error:#:overwriting an existing profile data with a diffe= rent timestamp libgcov profiling error:#:overwriting an existing profile data with a diffe= rent timestamp libgcov profiling error:':overwriting an existing profile data with a diffe= rent timestamp profiling::Cannot open libgcov profiling error:#:overwriting an existing profile data with a diffe= rent timestamp libgcov profiling error:#:overwriting an existing profile data with a diffe= rent timestamp libgcov profiling error::overwriting an existing profile data with a differ= ent timestamp ... [this continues for quite a number of lines] Note that these warnings are produced both for the directory where compilat= ion really took place as for the directory where .o & .gcno were taken from the cache. Since the gcda files are created next to the .o * .gcno there should not be= any name clashes (for identical names the path would still be different). So I = am not sure what is happening here? Unfortunately, the warning lines do not include any information about which file is being written or which file is clashing. Still, gcovr is able to produce a coverage report with information that loo= ks sane, but there are differences with the gcc7.5 reports. I would assume bec= ause of the above warnings.=20 The coverage report for the second compilation (using cached .o & .gcno) is= for all intents and purposes the same as the one for the first compilation. The difference being 2 lines and 2 branches on totals of 17515 and 14727.=