Re: [google][gcc-4_9] encode and compress cc1 option strings in gcov_module_info

2015-10-06 Thread Rong Xu
It's 1:3 to 1:4 in the programs I tested. But it really depends on how the options are used. I think your idea of using combined strlen works better. I just make the code a little clumsy but it does not cause any performance issue. On Tue, Oct 6, 2015 at 10:21 AM, Xinliang David Li

Re: [google][gcc-4_9] encode and compress cc1 option strings in gcov_module_info

2015-10-06 Thread Rong Xu
Here is the patch set 2 that integrates David's comments. Note that this uses the combined strlen (i.e. encoding compressed and uncompressed strlen into one gcov_unsigned_t). Testing is ongoing. -Rong On Tue, Oct 6, 2015 at 11:30 AM, Rong Xu wrote: > It's 1:3 to 1:4 in the

Re: [google][gcc-4_9] encode and compress cc1 option strings in gcov_module_info

2015-10-06 Thread Xinliang David Li
ok with the following changes (and after testing). + * sizeof (char*)); for (unsigned j = 0; j < total_num - num_array[0]; j++) -module->string_array[j] = xstrdup (gcov_read_string ()); +string_array[j] = xstrdup (gcov_read_string ());

Re: [google][gcc-4_9] encode and compress cc1 option strings in gcov_module_info

2015-10-06 Thread Rong Xu
On Mon, Oct 5, 2015 at 5:33 PM, Xinliang David Li wrote: >unsigned ggc_memory = gcov_read_unsigned (); > + unsigned marker = 0, len = 0, k; > + char **string_array, *saved_cc1_strings; > + >for (unsigned j = 0; j < 7; j++) > > > Do not use hard coded

Re: [google][gcc-4_9] encode and compress cc1 option strings in gcov_module_info

2015-10-06 Thread Xinliang David Li
On Tue, Oct 6, 2015 at 9:26 AM, Rong Xu wrote: > On Mon, Oct 5, 2015 at 5:33 PM, Xinliang David Li wrote: >>unsigned ggc_memory = gcov_read_unsigned (); >> + unsigned marker = 0, len = 0, k; >> + char **string_array, *saved_cc1_strings; >> +

Re: [google][gcc-4_9] encode and compress cc1 option strings in gcov_module_info

2015-10-05 Thread Xinliang David Li
unsigned ggc_memory = gcov_read_unsigned (); + unsigned marker = 0, len = 0, k; + char **string_array, *saved_cc1_strings; + for (unsigned j = 0; j < 7; j++) Do not use hard coded number. Use the enum defined in coverage.c. +string_array[j] = xstrdup

[google][gcc-4_9] encode and compress cc1 option strings in gcov_module_info

2015-10-05 Thread Rong Xu
Hi, This patch is for google branch only. It encodes and compresses various cc1 option strings in gcov_module_info to reduce the lipo instrumented object size. The savings are from string compression and the reduced number of relocations. More specifically, we replace the following fields in