From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Yicong Yang <yangyicong@huawei.com>
Cc: <will@kernel.org>, <mark.rutland@arm.com>, <hejunhao3@huawei.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <yangyicong@hisilicon.com>,
<linuxarm@huawei.com>, <prime.zeng@hisilicon.com>,
<fanghao11@huawei.com>
Subject: Re: [PATCH v2 3/8] drivers/perf: hisi_pcie: Fix incorrect counting under metric mode
Date: Mon, 26 Feb 2024 15:12:30 +0000 [thread overview]
Message-ID: <20240226151230.00002654@Huawei.com> (raw)
In-Reply-To: <20240223103359.18669-4-yangyicong@huawei.com>
On Fri, 23 Feb 2024 18:33:54 +0800
Yicong Yang <yangyicong@huawei.com> wrote:
> From: Yicong Yang <yangyicong@hisilicon.com>
>
> The metric counting shows incorrect results if the events in the
> metric group using the same event but different filter options.
> This is because we only judge the event code to decide whether
> the event in the metric group should share the same hardware
> counter, but ignore the settings of the filter.
>
> For example, on a platform of 2 ports 0x1 and 0x2 but only port
> 0x1 has a downstream PCIe NVME device. The metric counting
> shows both ports have the same counts because we misassign these
> two events to one same hardware counter:
> [root@localhost perf-iostat]# ./perf stat -e '{hisi_pcie0_core1/event=0x0104,port=0x2/,hisi_pcie0_core1/event=0x0104,port=0x1/}'
>
> Performance counter stats for 'system wide':
>
> 7907484924 hisi_pcie0_core1/event=0x0104,port=0x2/
> 7907484924 hisi_pcie0_core1/event=0x0104,port=0x1/
>
> 10.153863691 seconds time elapsed
>
> Fix this by using the whole config rather than the event only
> to judge whether two events are the same and should share the
> same hardware counter. With this patch, the metric counting in
> the above case tends to be corrected:
>
> [root@localhost perf-iostat]# ./perf stat -e '{hisi_pcie0_core1/event=0x0104,port=0x2/,hisi_pcie0_core1/event=0x0104,port=0x1/}'
>
> Performance counter stats for 'system wide':
>
> 0 hisi_pcie0_core1/event=0x0104,port=0x2/
> 8123122077 hisi_pcie0_core1/event=0x0104,port=0x1/
>
> 10.152875631 seconds time elapsed
>
> Fixes: 8404b0fbc7fb ("drivers/perf: hisi: Add driver for HiSilicon PCIe PMU")
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-02-26 15:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-23 10:33 [PATCH v2 0/8] drivers/perf: hisi_pcie: Several updates for HiSilicon PCIe PMU driver Yicong Yang
2024-02-23 10:33 ` [PATCH v2 1/8] drivers/perf: hisi_pcie: Rename hisi_pcie_pmu_{config,clear}_filter() Yicong Yang
2024-02-26 15:11 ` Jonathan Cameron
2024-02-23 10:33 ` [PATCH v2 2/8] drivers/perf: hisi_pcie: Introduce hisi_pcie_pmu_get_event_ctrl_val() Yicong Yang
2024-02-23 10:33 ` [PATCH v2 3/8] drivers/perf: hisi_pcie: Fix incorrect counting under metric mode Yicong Yang
2024-02-26 15:12 ` Jonathan Cameron [this message]
2024-02-23 10:33 ` [PATCH v2 4/8] drivers/perf: hisi_pcie: Add more events for counting TLP bandwidth Yicong Yang
2024-02-23 10:33 ` [PATCH v2 5/8] drivers/perf: hisi_pcie: Check the target filter properly Yicong Yang
2024-02-26 15:14 ` Jonathan Cameron
2024-02-23 10:33 ` [PATCH v2 6/8] drivers/perf: hisi_pcie: Relax the check on related events Yicong Yang
2024-02-26 15:16 ` Jonathan Cameron
2024-02-23 10:33 ` [PATCH v2 7/8] drivers/perf: hisi_pcie: Merge find_related_event() and get_event_idx() Yicong Yang
2024-02-26 15:18 ` Jonathan Cameron
2024-02-23 10:33 ` [PATCH v2 8/8] docs: perf: Update usage for target filter of hisi-pcie-pmu Yicong Yang
2024-02-26 15:20 ` Jonathan Cameron
2024-03-04 15:17 ` [PATCH v2 0/8] drivers/perf: hisi_pcie: Several updates for HiSilicon PCIe PMU driver Will Deacon
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=20240226151230.00002654@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=fanghao11@huawei.com \
--cc=hejunhao3@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mark.rutland@arm.com \
--cc=prime.zeng@hisilicon.com \
--cc=will@kernel.org \
--cc=yangyicong@hisilicon.com \
--cc=yangyicong@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).