Re: [PATCH v6 00/26] perf tool: AlderLake hybrid support series 1

From: Arnaldo Carvalho de Melo
Date: Tue Apr 27 2021 - 09:14:20 EST


Em Tue, Apr 27, 2021 at 02:50:17PM +0200, Jiri Olsa escreveu:
> On Tue, Apr 27, 2021 at 03:01:13PM +0800, Jin Yao wrote:
> > AlderLake uses a hybrid architecture utilizing Golden Cove cores
> > (core cpu) and Gracemont cores (atom cpu). Each cpu has dedicated
> > event list. Some events are available on core cpu, some events
> > are available on atom cpu and some events can be available on both.
> >
> > Kernel exports new pmus "cpu_core" and "cpu_atom" through sysfs:
> > /sys/devices/cpu_core
> > /sys/devices/cpu_atom
> >
> > cat /sys/devices/cpu_core/cpus
> > 0-15
> >
> > cat /sys/devices/cpu_atom/cpus
> > 16-23
> >
> > In this example, core cpus are 0-15 and atom cpus are 16-23.
> >
> > To enable a core only event or atom only event:
> >
> > cpu_core/<event name>/
> > or
> > cpu_atom/<event name>/
> >
> > Count the 'cycles' event on core cpus.
> >
> > # perf stat -e cpu_core/cycles/ -a -- sleep 1
> >
> > Performance counter stats for 'system wide':
> >
> > 12,853,951,349 cpu_core/cycles/
> >
> > 1.002581249 seconds time elapsed
> >
> > If one event is available on both atom cpu and core cpu, two events
> > are created automatically.
> >
> > # perf stat -e cycles -a -- sleep 1
> >
> > Performance counter stats for 'system wide':
> >
> > 12,856,467,438 cpu_core/cycles/
> > 6,404,634,785 cpu_atom/cycles/
> >
> > 1.002453013 seconds time elapsed
> >
> > Group is supported if the events are from same pmu, otherwise a warning
> > is displayed and disable grouping automatically.
> >
> > # perf stat -e '{cpu_core/cycles/,cpu_core/instructions/}' -a -- sleep 1
> >
> > Performance counter stats for 'system wide':
> >
> > 12,863,866,968 cpu_core/cycles/
> > 554,795,017 cpu_core/instructions/
> >
> > 1.002616117 seconds time elapsed
> >
> > # perf stat -e '{cpu_core/cycles/,cpu_atom/instructions/}' -a -- sleep 1
> > WARNING: events in group from different hybrid PMUs!
> > WARNING: grouped events cpus do not match, disabling group:
> > anon group { cpu_core/cycles/, cpu_atom/instructions/ }
> >
> > Performance counter stats for 'system wide':
> >
> > 6,283,970 cpu_core/cycles/
> > 765,635 cpu_atom/instructions/
> >
> > 1.003959036 seconds time elapsed
> >
> > Note that, since the whole patchset for AlderLake hybrid support is very
> > large (40+ patches). For simplicity, it's splitted into several patch
> > series.
> >
> > The patch series 1 only supports the basic functionality. The advanced
> > supports for perf-c2c/perf-mem/topdown/metrics/topology header and others
> > will be added in follow-up patch series.
> >
> > The perf tool codes can also be found at:
> > https://github.com/yaoj/perf.git
>
> hi,
> did you update the branch for v6? I think I can't see
> the new update there

I'm putting it in my tmp.perf/core while I'm testing it and you
reviewing, I'll do some reviewing as well, now it applied ok:

[acme@five perf]$ git am ./v6_20210427_yao_jin_perf_tool_alderlake_hybrid_support_series_1.mbx
Applying: tools headers uapi: Update tools's copy of linux/perf_event.h
Applying: perf jevents: Support unit value "cpu_core" and "cpu_atom"
Applying: perf pmu: Simplify arguments of __perf_pmu__new_alias
Applying: perf pmu: Save pmu name
Applying: perf pmu: Save detected hybrid pmus to a global pmu list
Applying: perf pmu: Add hybrid helper functions
Applying: perf stat: Uniquify hybrid event name
Applying: perf parse-events: Create two hybrid hardware events
Applying: perf parse-events: Create two hybrid cache events
Applying: perf parse-events: Create two hybrid raw events
Applying: perf parse-events: Compare with hybrid pmu name
Applying: perf parse-events: Support event inside hybrid pmu
Applying: perf record: Create two hybrid 'cycles' events by default
Applying: perf stat: Add default hybrid events
Applying: perf stat: Filter out unmatched aggregation for hybrid event
Applying: perf stat: Warn group events from different hybrid PMU
Applying: perf record: Uniquify hybrid event name
Applying: perf tests: Add hybrid cases for 'Parse event definition strings' test
Applying: perf tests: Add hybrid cases for 'Roundtrip evsel->name' test
Applying: perf tests: Skip 'Setup struct perf_event_attr' test for hybrid
Applying: perf tests: Support 'Track with sched_switch' test for hybrid
Applying: perf tests: Support 'Parse and process metrics' test for hybrid
Applying: perf tests: Support 'Session topology' test for hybrid
Applying: perf tests: Support 'Convert perf time to TSC' test for hybrid
Applying: perf tests: Skip 'perf stat metrics (shadow stat) test' for hybrid
Applying: perf Documentation: Document intel-hybrid support
[acme@five perf]$