From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: John Garry <john.garry@huawei.com>
Cc: will@kernel.org, mathieu.poirier@linaro.org, leo.yan@linaro.org,
peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com,
alexander.shishkin@linux.intel.com, jolsa@redhat.com,
namhyung@kernel.org, irogers@google.com, linuxarm@huawei.com,
kjain@linux.ibm.com, kan.liang@linux.intel.com,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, zhangshaokun@hisilicon.com,
pc@us.ibm.com
Subject: Re: [PATCH v3 0/6] perf arm64 metricgroup support
Date: Wed, 7 Apr 2021 10:11:23 -0300 [thread overview]
Message-ID: <YG2ve4j8IwyJ7W2N@kernel.org> (raw)
In-Reply-To: <1617791570-165223-1-git-send-email-john.garry@huawei.com>
Em Wed, Apr 07, 2021 at 06:32:44PM +0800, John Garry escreveu:
> This series contains support to get basic metricgroups working for
> arm64 CPUs.
>
> Initial support is added for HiSilicon hip08 platform.
>
> Some sample usage on Huawei D06 board:
>
> $ ./perf list metric
Thanks, applied.
- Arnaldo
> List of pre-defined events (to be used in -e):
>
> Metrics:
>
> bp_misp_flush
> [BP misp flush L3 topdown metric]
> branch_mispredicts
> [Branch mispredicts L2 topdown metric]
> core_bound
> [Core bound L2 topdown metric]
> divider
> [Divider L3 topdown metric]
> exe_ports_util
> [EXE ports util L3 topdown metric]
> fetch_bandwidth_bound
> [Fetch bandwidth bound L2 topdown metric]
> fetch_latency_bound
> [Fetch latency bound L2 topdown metric]
> fsu_stall
> [FSU stall L3 topdown metric]
> idle_by_icache_miss
>
> $ sudo ./perf stat -v -M core_bound sleep 1
> Using CPUID 0x00000000480fd010
> metric expr (exe_stall_cycle - (mem_stall_anyload + armv8_pmuv3_0@event\=0x7005@)) / cpu_cycles for core_bound
> found event cpu_cycles
> found event armv8_pmuv3_0/event=0x7005/
> found event exe_stall_cycle
> found event mem_stall_anyload
> adding {cpu_cycles -> armv8_pmuv3_0/event=0x7001/
> mem_stall_anyload -> armv8_pmuv3_0/event=0x7004/
> Control descriptor is not initialized
> cpu_cycles: 989433 385050 385050
> armv8_pmuv3_0/event=0x7005/: 19207 385050 385050
> exe_stall_cycle: 900825 385050 385050
> mem_stall_anyload: 253516 385050 385050
>
> Performance counter stats for 'sleep':
>
> 989,433 cpu_cycles # 0.63 core_bound
> 19,207 armv8_pmuv3_0/event=0x7005/
> 900,825 exe_stall_cycle
> 253,516 mem_stall_anyload
>
> 0.000805809 seconds time elapsed
>
> 0.000875000 seconds user
> 0.000000000 seconds sys
>
> perf stat --topdown is not supported, as this requires the CPU PMU to
> expose (alias) events for the TopDown L1 metrics from sysfs, which arm
> does not do. To get that to work, we probably need to make perf use the
> pmu-events cpumap to learn about those alias events.
>
> Metric reuse support is added for pmu-events parse metric testcase.
> This had been broken on power9 recently:
> https://lore.kernel.org/lkml/20210324015418.GC8931@li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com/
>
> Differences to v2:
> - Add TB and RB tags (Thanks!)
> - Rename metricgroup__find_metric() from metricgroup_find_metric()
> - Change resolve_metric_simple() to rescan after any insert
>
> Differences to v1:
> - Add pmu_events_map__find() as arm64-specific function
> - Fix metric reuse for pmu-events parse metric testcase
>
> John Garry (6):
> perf metricgroup: Make find_metric() public with name change
> perf test: Handle metric reuse in pmu-events parsing test
> perf pmu: Add pmu_events_map__find()
> perf vendor events arm64: Add Hisi hip08 L1 metrics
> perf vendor events arm64: Add Hisi hip08 L2 metrics
> perf vendor events arm64: Add Hisi hip08 L3 metrics
>
> tools/perf/arch/arm64/util/Build | 1 +
> tools/perf/arch/arm64/util/pmu.c | 25 ++
> .../arch/arm64/hisilicon/hip08/metrics.json | 233 ++++++++++++++++++
> tools/perf/tests/pmu-events.c | 83 ++++++-
> tools/perf/util/metricgroup.c | 12 +-
> tools/perf/util/metricgroup.h | 3 +-
> tools/perf/util/pmu.c | 5 +
> tools/perf/util/pmu.h | 1 +
> tools/perf/util/s390-sample-raw.c | 4 +-
> 9 files changed, 356 insertions(+), 11 deletions(-)
> create mode 100644 tools/perf/arch/arm64/util/pmu.c
> create mode 100644 tools/perf/pmu-events/arch/arm64/hisilicon/hip08/metrics.json
>
> --
> 2.26.2
>
--
- Arnaldo
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: John Garry <john.garry@huawei.com>
Cc: will@kernel.org, mathieu.poirier@linaro.org, leo.yan@linaro.org,
peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com,
alexander.shishkin@linux.intel.com, jolsa@redhat.com,
namhyung@kernel.org, irogers@google.com, linuxarm@huawei.com,
kjain@linux.ibm.com, kan.liang@linux.intel.com,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, zhangshaokun@hisilicon.com,
pc@us.ibm.com
Subject: Re: [PATCH v3 0/6] perf arm64 metricgroup support
Date: Wed, 7 Apr 2021 10:11:23 -0300 [thread overview]
Message-ID: <YG2ve4j8IwyJ7W2N@kernel.org> (raw)
In-Reply-To: <1617791570-165223-1-git-send-email-john.garry@huawei.com>
Em Wed, Apr 07, 2021 at 06:32:44PM +0800, John Garry escreveu:
> This series contains support to get basic metricgroups working for
> arm64 CPUs.
>
> Initial support is added for HiSilicon hip08 platform.
>
> Some sample usage on Huawei D06 board:
>
> $ ./perf list metric
Thanks, applied.
- Arnaldo
> List of pre-defined events (to be used in -e):
>
> Metrics:
>
> bp_misp_flush
> [BP misp flush L3 topdown metric]
> branch_mispredicts
> [Branch mispredicts L2 topdown metric]
> core_bound
> [Core bound L2 topdown metric]
> divider
> [Divider L3 topdown metric]
> exe_ports_util
> [EXE ports util L3 topdown metric]
> fetch_bandwidth_bound
> [Fetch bandwidth bound L2 topdown metric]
> fetch_latency_bound
> [Fetch latency bound L2 topdown metric]
> fsu_stall
> [FSU stall L3 topdown metric]
> idle_by_icache_miss
>
> $ sudo ./perf stat -v -M core_bound sleep 1
> Using CPUID 0x00000000480fd010
> metric expr (exe_stall_cycle - (mem_stall_anyload + armv8_pmuv3_0@event\=0x7005@)) / cpu_cycles for core_bound
> found event cpu_cycles
> found event armv8_pmuv3_0/event=0x7005/
> found event exe_stall_cycle
> found event mem_stall_anyload
> adding {cpu_cycles -> armv8_pmuv3_0/event=0x7001/
> mem_stall_anyload -> armv8_pmuv3_0/event=0x7004/
> Control descriptor is not initialized
> cpu_cycles: 989433 385050 385050
> armv8_pmuv3_0/event=0x7005/: 19207 385050 385050
> exe_stall_cycle: 900825 385050 385050
> mem_stall_anyload: 253516 385050 385050
>
> Performance counter stats for 'sleep':
>
> 989,433 cpu_cycles # 0.63 core_bound
> 19,207 armv8_pmuv3_0/event=0x7005/
> 900,825 exe_stall_cycle
> 253,516 mem_stall_anyload
>
> 0.000805809 seconds time elapsed
>
> 0.000875000 seconds user
> 0.000000000 seconds sys
>
> perf stat --topdown is not supported, as this requires the CPU PMU to
> expose (alias) events for the TopDown L1 metrics from sysfs, which arm
> does not do. To get that to work, we probably need to make perf use the
> pmu-events cpumap to learn about those alias events.
>
> Metric reuse support is added for pmu-events parse metric testcase.
> This had been broken on power9 recently:
> https://lore.kernel.org/lkml/20210324015418.GC8931@li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com/
>
> Differences to v2:
> - Add TB and RB tags (Thanks!)
> - Rename metricgroup__find_metric() from metricgroup_find_metric()
> - Change resolve_metric_simple() to rescan after any insert
>
> Differences to v1:
> - Add pmu_events_map__find() as arm64-specific function
> - Fix metric reuse for pmu-events parse metric testcase
>
> John Garry (6):
> perf metricgroup: Make find_metric() public with name change
> perf test: Handle metric reuse in pmu-events parsing test
> perf pmu: Add pmu_events_map__find()
> perf vendor events arm64: Add Hisi hip08 L1 metrics
> perf vendor events arm64: Add Hisi hip08 L2 metrics
> perf vendor events arm64: Add Hisi hip08 L3 metrics
>
> tools/perf/arch/arm64/util/Build | 1 +
> tools/perf/arch/arm64/util/pmu.c | 25 ++
> .../arch/arm64/hisilicon/hip08/metrics.json | 233 ++++++++++++++++++
> tools/perf/tests/pmu-events.c | 83 ++++++-
> tools/perf/util/metricgroup.c | 12 +-
> tools/perf/util/metricgroup.h | 3 +-
> tools/perf/util/pmu.c | 5 +
> tools/perf/util/pmu.h | 1 +
> tools/perf/util/s390-sample-raw.c | 4 +-
> 9 files changed, 356 insertions(+), 11 deletions(-)
> create mode 100644 tools/perf/arch/arm64/util/pmu.c
> create mode 100644 tools/perf/pmu-events/arch/arm64/hisilicon/hip08/metrics.json
>
> --
> 2.26.2
>
--
- Arnaldo
next prev parent reply other threads:[~2021-04-07 13:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-07 10:32 [PATCH v3 0/6] perf arm64 metricgroup support John Garry
2021-04-07 10:32 ` John Garry
2021-04-07 10:32 ` [PATCH v3 1/6] perf metricgroup: Make find_metric() public with name change John Garry
2021-04-07 10:32 ` John Garry
2021-04-07 10:32 ` [PATCH v3 2/6] perf test: Handle metric reuse in pmu-events parsing test John Garry
2021-04-07 10:32 ` John Garry
2021-04-07 10:32 ` [PATCH v3 3/6] perf pmu: Add pmu_events_map__find() John Garry
2021-04-07 10:32 ` John Garry
2021-04-07 10:32 ` [PATCH v3 4/6] perf vendor events arm64: Add Hisi hip08 L1 metrics John Garry
2021-04-07 10:32 ` John Garry
2021-04-07 10:32 ` [PATCH v3 5/6] perf vendor events arm64: Add Hisi hip08 L2 metrics John Garry
2021-04-07 10:32 ` John Garry
2021-04-07 10:32 ` [PATCH v3 6/6] perf vendor events arm64: Add Hisi hip08 L3 metrics John Garry
2021-04-07 10:32 ` John Garry
2021-04-07 13:11 ` Arnaldo Carvalho de Melo [this message]
2021-04-07 13:11 ` [PATCH v3 0/6] perf arm64 metricgroup support Arnaldo Carvalho de Melo
2021-04-08 12:06 ` Jiri Olsa
2021-04-08 12:06 ` Jiri Olsa
2021-04-13 9:45 ` perf arm64 --topdown support (was "perf arm64 metricgroup support") John Garry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YG2ve4j8IwyJ7W2N@kernel.org \
--to=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=john.garry@huawei.com \
--cc=jolsa@redhat.com \
--cc=kan.liang@linux.intel.com \
--cc=kjain@linux.ibm.com \
--cc=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mark.rutland@arm.com \
--cc=mathieu.poirier@linaro.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=pc@us.ibm.com \
--cc=peterz@infradead.org \
--cc=will@kernel.org \
--cc=zhangshaokun@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.