[gcov-profile/91971] Profile directory concatenated with object file path

Message ID 9AE41208-93E9-472F-85EC-5C55C7447F87@ORACLE.COM
State New
Headers show
Series
  • [gcov-profile/91971] Profile directory concatenated with object file path
Related show

Commit Message

Qing Zhao Oct. 9, 2019, 3:30 p.m.
Hi,

This is a patch for fix PR 91971: Profile directory concatenated with object file path

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

Gcc/ChangeLog:

+2019-10-09  qing zhao  <qing.zhao@oracle.com>
+
+       * coverage.c (coverage_init): Mangle the full path of filename when
+       filename is a absolute path.
+
 2019-10-07  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

$ git diff  gcc/coverage.c

Okay to commit?

thanks.

Qing
 

> On Oct 2, 2019, at 11:05 AM, Qing Zhao <qing.zhao@oracle.com> wrote:

> 

> Ping on:

> 

> https://gcc.gnu.org/ml/gcc-patches/2019-09/msg01554.html <https://gcc.gnu.org/ml/gcc-patches/2019-09/msg01554.html>

> 

> Anyway, I filed an gcc bug on this issue as:

> 

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91971 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91971>

> 

> If you think that this is NOT a bug, please let me know.

> 

> thanks.

> 

> Qing

Comments

Qing Zhao Oct. 14, 2019, 2:52 p.m. | #1
Hi, 

This is a ping to the following patch.

Thanks,

Qing

> Begin forwarded message:

> 

> From: Qing Zhao <QING.ZHAO@ORACLE.COM>

> Subject: [PATCH][gcov-profile/91971]Profile directory concatenated with object file path

> Date: October 9, 2019 at 10:30:04 AM CDT

> To: hubicka@ucw.cz

> Cc: gcc-patches@gcc.gnu.org

> 

> Hi,

> 

> This is a patch for fix PR 91971: Profile directory concatenated with object file path

> 

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

> 

> Gcc/ChangeLog:

> 

> +2019-10-09  qing zhao  <qing.zhao@oracle.com>

> +

> +       * coverage.c (coverage_init): Mangle the full path of filename when

> +       filename is a absolute path.

> +

> 2019-10-07  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

> 

> $ git diff  gcc/coverage.c

> diff --git a/gcc/coverage.c b/gcc/coverage.c

> index 0d5138f..bcba61c 100644

> --- a/gcc/coverage.c

> +++ b/gcc/coverage.c

> @@ -1229,6 +1229,14 @@ coverage_init (const char *filename)

>       else

>        profile_data_prefix = getpwd ();

>     }

> +  else

> +    {

> +      /* when filename is a absolute path, we also need to mangle the full

> +      path of filename to prevent the profiling data being stored into a

> +      different path than that specified by profile_data_prefix.  */

> +      filename = mangle_path (filename);

> +      len = strlen (filename);

> +    }

> 

>   if (profile_data_prefix)

>     prefix_len = strlen (profile_data_prefix);

> 

> Okay to commit?

> 

> thanks.

> 

> Qing

> 

> 

>> On Oct 2, 2019, at 11:05 AM, Qing Zhao <qing.zhao@oracle.com> wrote:

>> 

>> Ping on:

>> 

>> https://gcc.gnu.org/ml/gcc-patches/2019-09/msg01554.html <https://gcc.gnu.org/ml/gcc-patches/2019-09/msg01554.html>

>> 

>> Anyway, I filed an gcc bug on this issue as:

>> 

>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91971 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91971>

>> 

>> If you think that this is NOT a bug, please let me know.

>> 

>> thanks.

>> 

>> Qing

>
Qing Zhao Oct. 21, 2019, 3:32 p.m. | #2
Hi,

This is 2nd ping of this simple patch.

We are waiting for this patch for one of our important project.

Please let me know whether this patch is reasonable or not.

Thanks a lot.

Qing

> Begin forwarded message:

> 

> From: Qing Zhao <QING.ZHAO@ORACLE.COM>

> Subject: PING: Fwd: [PATCH][gcov-profile/91971]Profile directory concatenated with object file path

> Date: October 14, 2019 at 9:52:34 AM CDT

> To: hubicka@ucw.cz

> Cc: gcc-patches@gcc.gnu.org

> 

> Hi, 

> 

> This is a ping to the following patch.

> 

> Thanks,

> 

> Qing

> 

>> Begin forwarded message:

>> 

>> From: Qing Zhao <QING.ZHAO@ORACLE.COM>

>> Subject: [PATCH][gcov-profile/91971]Profile directory concatenated with object file path

>> Date: October 9, 2019 at 10:30:04 AM CDT

>> To: hubicka@ucw.cz

>> Cc: gcc-patches@gcc.gnu.org

>> 

>> Hi,

>> 

>> This is a patch for fix PR 91971: Profile directory concatenated with object file path

>> 

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

>> 

>> Gcc/ChangeLog:

>> 

>> +2019-10-09  qing zhao  <qing.zhao@oracle.com>

>> +

>> +       * coverage.c (coverage_init): Mangle the full path of filename when

>> +       filename is a absolute path.

>> +

>> 2019-10-07  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

>> 

>> $ git diff  gcc/coverage.c

>> diff --git a/gcc/coverage.c b/gcc/coverage.c

>> index 0d5138f..bcba61c 100644

>> --- a/gcc/coverage.c

>> +++ b/gcc/coverage.c

>> @@ -1229,6 +1229,14 @@ coverage_init (const char *filename)

>>      else

>>       profile_data_prefix = getpwd ();

>>    }

>> +  else

>> +    {

>> +      /* when filename is a absolute path, we also need to mangle the full

>> +      path of filename to prevent the profiling data being stored into a

>> +      different path than that specified by profile_data_prefix.  */

>> +      filename = mangle_path (filename);

>> +      len = strlen (filename);

>> +    }

>> 

>>  if (profile_data_prefix)

>>    prefix_len = strlen (profile_data_prefix);

>> 

>> Okay to commit?

>> 

>> thanks.

>> 

>> Qing

>> 

>> 

>>> On Oct 2, 2019, at 11:05 AM, Qing Zhao <qing.zhao@oracle.com> wrote:

>>> 

>>> Ping on:

>>> 

>>> https://gcc.gnu.org/ml/gcc-patches/2019-09/msg01554.html <https://gcc.gnu.org/ml/gcc-patches/2019-09/msg01554.html>

>>> 

>>> Anyway, I filed an gcc bug on this issue as:

>>> 

>>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91971 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91971>

>>> 

>>> If you think that this is NOT a bug, please let me know.

>>> 

>>> thanks.

>>> 

>>> Qing

>> 

>
Martin Liška Oct. 23, 2019, 10:15 a.m. | #3
On 10/21/19 5:32 PM, Qing Zhao wrote:
> Please let me know whether this patch is reasonable or not.


The patch is fine. Please add PR entry to the ChangeLog and
install the patch.

Thanks,
Martin
Qing Zhao Oct. 23, 2019, 6:15 p.m. | #4
Thank you!

Just committed the change at:

https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=277344 <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=277344>

Qing
> On Oct 23, 2019, at 5:15 AM, Martin Liška <mliska@suse.cz> wrote:

> 

> On 10/21/19 5:32 PM, Qing Zhao wrote:

>> Please let me know whether this patch is reasonable or not.

> 

> The patch is fine. Please add PR entry to the ChangeLog and

> install the patch.

> 

> Thanks,

> Martin

Patch

diff --git a/gcc/coverage.c b/gcc/coverage.c
index 0d5138f..bcba61c 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -1229,6 +1229,14 @@  coverage_init (const char *filename)
       else
        profile_data_prefix = getpwd ();
     }
+  else
+    {
+      /* when filename is a absolute path, we also need to mangle the full
+      path of filename to prevent the profiling data being stored into a
+      different path than that specified by profile_data_prefix.  */
+      filename = mangle_path (filename);
+      len = strlen (filename);
+    }
 
   if (profile_data_prefix)
     prefix_len = strlen (profile_data_prefix);