> On 1/21/21 7:45 PM, Jan Hubicka wrote: > > For this reason we merge by computing average, which is stable over > > reordering the indices.... > > Looking at the implementation, we merge by using minimum value: > > /* Time profiles are merged so that minimum from all valid (greater than zero) > is stored. There could be a fork that creates new counters. To have > the profile stable, we chosen to pick the smallest function visit time. */
Yep, sorry for confussion. I just noticed that as well. Minimum should be still safe for parallel-run profiling (not for multithreaded where we probably really want to disabe it, but we can do that on per-function basis using opt_for_fn so it works with LTO). Honza > void > __gcov_merge_time_profile (gcov_type *counters, unsigned n_counters) > { > unsigned int i; > gcov_type value; > > for (i = 0; i < n_counters; i++) > { > value = gcov_get_counter_target (); > > if (value && (!counters[i] || value < counters[i])) > counters[i] = value; > } > } > #endif /* L_gcov_merge_time_profile */ > > Martin