Looks good to me. A couple questions:
> static void > -__gcov_scale_icall_topn (gcov_type *counters, unsigned n_counters, double f) > +__gcov_icall_topn_op (gcov_type *counters, unsigned n_counters, > + counter_op_fn fn, void *data1, void *data2) > { > unsigned i; > > @@ -950,41 +949,65 @@ static void > gcov_type *value_array = &counters[i + 1]; > > for (j = 0; j < GCOV_ICALL_TOPN_NCOUNTS - 1; j += 2) > - value_array[1] *= f; Was the above a bug (always updating index 1)? > + value_array[j + 1] = fn (value_array[j + 1], data1, data2); > } > } > > static void > -__gcov_scale_dc (gcov_type *counters, unsigned n_counters, double f) > +__gcov_dc_op (gcov_type *counters, unsigned n_counters, > + counter_op_fn fn, void *data1, void *data2) > { > unsigned i; > > gcc_assert (!(n_counters % 2)); > for (i = 0; i < n_counters; i += 2) > - counters[1] *= f; Same question here > + counters[i + 1] = fn (counters[i + 1], data1, data2); > } Teresa On Tue, Feb 4, 2014 at 3:54 PM, Rong Xu <x...@google.com> wrote: > Hi, > > The attached patch uses a callback function to unify the integer and > floating-point scaling in gcov-tool. (Also fix a bug in fp scaling of > ic and dc counters in earlier code). > > Tested with spec2006 profiles. > > OK for checking in? > > Thanks, > > -Rong -- Teresa Johnson | Software Engineer | tejohn...@google.com | 408-460-2413