[Google/4_8] Support for embedding build info into gcda files

2014-05-23 Thread Teresa Johnson
Support for embedding arbitrary build information from the profile-generate compile into the gcda file in a new BUILD_INFO record. Lines from a file passed to the -fprofile-generate compile via a new -fprofile-generate-buildinfo=filename option are embedded as strings in the gcov_info struct and em

Re: [Google/4_8] Support for embedding build info into gcda files

2014-05-23 Thread Xinliang David Li
The change makes gcov_info a variable length array, which is not ideal. Better just add one more field (instead of two): struct gcov_info { ... char ** build_info; }; For regular case, it is null, for case where the build info is available, make it point to a string array (with an null end

Re: [Google/4_8] Support for embedding build info into gcda files

2014-05-23 Thread Teresa Johnson
Done. Passes manual testing, rerunning regression testing. New patch attached. Thanks, Teresa On Fri, May 23, 2014 at 11:35 AM, Xinliang David Li wrote: > The change makes gcov_info a variable length array, which is not ideal. > > Better just add one more field (instead of two): > > struct gcov_

Re: [Google/4_8] Support for embedding build info into gcda files

2014-05-23 Thread Xinliang David Li
for (i = 0; i < num_strings; i++) +{ + if (strcmp (build_info_strings[i], gi_ptr->build_info[i])) Add also check of gi_ptr->build_info: if (!gi_ptr->build_info || strcmp ( ) +{ + gcov_error ("profiling:%s:Mismatched build info string " +

Re: [Google/4_8] Support for embedding build info into gcda files

2014-05-23 Thread Teresa Johnson
On Fri, May 23, 2014 at 2:28 PM, Xinliang David Li wrote: > for (i = 0; i < num_strings; i++) > +{ > + if (strcmp (build_info_strings[i], gi_ptr->build_info[i])) > > Add also check of gi_ptr->build_info: > >if (!gi_ptr->build_info || strcmp ( ) Added the check earli

Re: [Google/4_8] Support for embedding build info into gcda files

2014-05-23 Thread Xinliang David Li
On Fri, May 23, 2014 at 2:50 PM, Teresa Johnson wrote: > On Fri, May 23, 2014 at 2:28 PM, Xinliang David Li wrote: >> for (i = 0; i < num_strings; i++) >> +{ >> + if (strcmp (build_info_strings[i], gi_ptr->build_info[i])) >> >> Add also check of gi_ptr->build_info: >> >>

Re: [Google/4_8] Support for embedding build info into gcda files

2014-05-23 Thread Xinliang David Li
ok On Fri, May 23, 2014 at 3:14 PM, Teresa Johnson wrote: > > On May 23, 2014 2:56 PM, "Xinliang David Li" wrote: >> >> On Fri, May 23, 2014 at 2:50 PM, Teresa Johnson >> wrote: >> > On Fri, May 23, 2014 at 2:28 PM, Xinliang David Li >> > wrote: >> >> for (i = 0; i < num_strings; i++) >>