From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119418 invoked by alias); 2 Jul 2018 08:51:47 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 119301 invoked by uid 89); 2 Jul 2018 08:51:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=Thats, pain, funny, DOC X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 02 Jul 2018 08:51:43 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 08F9D478; Mon, 2 Jul 2018 10:51:39 +0200 (CEST) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id XR7-rDRxj-Pw; Mon, 2 Jul 2018 10:51:36 +0200 (CEST) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.152]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 41FF8477; Mon, 2 Jul 2018 10:51:36 +0200 (CEST) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.2+Sun/8.15.2/Submit) id w628pYdY019034; Mon, 2 Jul 2018 10:51:34 +0200 (MEST) From: Rainer Orth To: Martin =?utf-8?Q?Li=C5=A1ka?= Cc: Jeff Law , Jakub Jelinek , Martin Sebor , GCC Patches , Richard Biener , Jan Hubicka Subject: Re: [PATCH] When using -fprofile-generate=/some/path mangle absolute path of file (PR lto/85759). References: <41f0b7e4-1a6b-3f5e-1e3a-750502e73043@suse.cz> <08c9b11b-6420-f056-ae27-38394662deca@gmail.com> <20171220174525.GK2353@tucnak> <3b996c3b-6dc5-12d3-26bf-0aa27977dc66@suse.cz> <2408b916-3011-6b17-6176-90049725235f@redhat.com> <1a288329-e200-c458-6adf-9748c84a1033@suse.cz> Date: Mon, 02 Jul 2018 08:51:00 -0000 In-Reply-To: <1a288329-e200-c458-6adf-9748c84a1033@suse.cz> ("Martin =?utf-8?Q?Li=C5=A1ka=22's?= message of "Fri, 29 Jun 2018 15:54:42 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00023.txt.bz2 Hi Martin, > On 06/22/2018 10:35 PM, Jeff Law wrote: >> On 05/16/2018 05:53 AM, Martin Li=C5=A1ka wrote: >>> On 12/21/2017 10:13 AM, Martin Li=C5=A1ka wrote: >>>> On 12/20/2017 06:45 PM, Jakub Jelinek wrote: >>>>> Another thing is that the "/" in there is wrong, so >>>>> const char dir_separator_str[] =3D { DIR_SEPARATOR, '\0' }; >>>>> char *b =3D concat (profile_data_prefix, dir_separator_str, pwd, NU= LL); >>>>> needs to be used instead. >>>> This looks much nicer, I forgot about DIR_SEPARATOR. >>>> >>>>> Does profile_data_prefix have any dir separators stripped from the en= d? >>>> That's easy to achieve.. >>>> >>>>> Is pwd guaranteed to be relative in this case? >>>> .. however this is absolute path, which would be problematic on a DOC >>>> based FS. >>>> Maybe we should do the same path mangling as we do for purpose of gcov: >>>> >>>> https://github.com/gcc-mirror/gcc/blob/master/gcc/gcov.c#L2424 >>> Hi. >>> >>> I decided to implement that. Which means for: >>> >>> $ gcc -fprofile-generate=3D/tmp/myfolder empty.c -O2 && ./a.out=20 >>> >>> we get following file: >>> /tmp/myfolder/#home#marxin#Programming#testcases#tmp#empty.gcda >>> >>> That guarantees we have a unique file path. As seen in the PR it >>> can produce a funny ICE. >>> >>> I've been testing the patch. >>> Ready after it finishes tests? >>> >>> Martin >>> >>>> What do you think about it? >>>> Regarding the string manipulation: I'm not an expert, but work with >>>> string in C >>>> is for me always a pain :) >>>> >>>> Martin >>>> >>> >>> 0001-When-using-fprofile-generate-some-path-mangle-absolu.patch >>> >>> >>> From 386a4561a4d1501e8959871791289e95f6a89af5 Mon Sep 17 00:00:00 2001 >>> From: marxin >>> Date: Wed, 16 Aug 2017 10:22:57 +0200 >>> Subject: [PATCH] When using -fprofile-generate=3D/some/path mangle abso= lute path >>> of file (PR lto/85759). >>> >>> gcc/ChangeLog: >>> >>> 2018-05-16 Martin Liska >>> >>> PR lto/85759 >>> * coverage.c (coverage_init): Mangle full path name. >>> * doc/invoke.texi: Document the change. >>> * gcov-io.c (mangle_path): New. >>> * gcov-io.h (mangle_path): Likewise. >>> * gcov.c (mangle_name): Use mangle_path for path mangling. >> ISTM you can self-approve this now if you want it to move forward :-) >>=20 >> jeff >>=20 > > Sure, let me install the patch then. your patch caused 3 testcases to regress everywhere: +UNRESOLVED: gcc.dg/pr47793.c scan-file . +FAIL: gcc.dg/profile-dir-1.c scan-ipa-dump cgraph " ./profile-dir-1.gcda" +FAIL: gcc.dg/profile-dir-3.c scan-ipa-dump cgraph " ./profile-dir-3.gcda" Please fix. Rainer --=20 ---------------------------------------------------------------------------= -- Rainer Orth, Center for Biotechnology, Bielefeld University