[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

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 davi...@google.com wrote: The change makes gcov_info a variable length array, which is not ideal. Better just add one more field (instead of two):

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 davi...@google.com 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

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 tejohn...@google.com wrote: On Fri, May 23, 2014 at 2:28 PM, Xinliang David Li davi...@google.com wrote: for (i = 0; i num_strings; i++) +{ + if (strcmp (build_info_strings[i], gi_ptr-build_info[i])) Add also check of

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 tejohn...@google.com wrote: On May 23, 2014 2:56 PM, Xinliang David Li davi...@google.com wrote: On Fri, May 23, 2014 at 2:50 PM, Teresa Johnson tejohn...@google.com wrote: On Fri, May 23, 2014 at 2:28 PM, Xinliang David Li