Re: [PATCH 06/19] perf stat: Add 'needs_sort' argument to cpu_aggr_map__new()

From: Namhyung Kim
Date: Tue Oct 11 2022 - 19:33:15 EST


On Mon, Oct 10, 2022 at 3:53 PM Ian Rogers <irogers@xxxxxxxxxx> wrote:
>
> On Sun, Oct 9, 2022 at 10:36 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> >
> > In case of no aggregation, it needs to keep the original (cpu) ordering
> > in the aggr_map so that it can be in sync with the cpu map. This will
> > make the code easier to handle AGGR_NONE similar to others.
> >
>
> The CPU map is sorted and so sorting the aggr_map should be fine. If
> the data is already sorted then it is O(n) to sort. I think this is
> preferable to having additional complexity around whether the aggr_map
> is sorted.

The problem is that aggr_cpu_id__cmp() only checks socket, die and core
so it will have CPUs in the same core together - like 0, 4, 1, 5, 2, 6, 3, 7.

Thanks,
Namhyung