linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Garry <john.garry@huawei.com>
To: "liuqi (BA)" <liuqi115@huawei.com>,
	Linuxarm <linuxarm@huawei.com>,
	"will@kernel.org" <will@kernel.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"bhelgaas@google.com" <bhelgaas@google.com>
Cc: "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Zhangshaokun <zhangshaokun@hisilicon.com>
Subject: Re: [PATCH v7 2/2] drivers/perf: hisi: Add driver for HiSilicon PCIe PMU
Date: Mon, 28 Jun 2021 13:11:33 +0100	[thread overview]
Message-ID: <f2e0ac61-d46d-1245-46e7-aea9bb83c64d@huawei.com> (raw)
In-Reply-To: <403d09f8-6fe8-c04c-151b-40816c344b55@huawei.com>

On 28/06/2021 11:49, liuqi (BA) wrote:
>>> Hardware counter and ext_counter work together for bandwidth, latency,
>>> bus utilization and buffer occupancy events. For example, for latency
>>> events(idx = 0x10), counter counts total delay cycles and ext_counter
>>> counts PCIe packets number.
>>>
>>> As we don't want PMU driver to process these two data, "delay cycles"
>>> can be treated as an event(id = 0x10), "packets number" as another event
>>> (id = 0x10 << 8), and driver could export these data separately.
>>>
>>> if the user want to calculate latency of rx memory read, they should:
>>> ./perf stat -v -e '{hisi_pcieX/event=0x10,
>>> subevent=0x01/,hisi_pcieX/event=0x0400, subevent=0x01/
>>>
>>> and for bandwidth event:
>>> ./perf stat -v -e '{hisi_pcieX/event=0x4,
>>> subevent=0x02/,hisi_pcieX/event=0x1000, subevent=0x02/
> Hi John,
>> I would suggest supporting a perf metric for this then, which would be
>> like:
>>
>> {
>>      "BriefDescription": "Latency for inbound traffic...",
>>      "MetricName": "hisi_pcie_lat_rx_mrd",
>>      "MetricExpr": "hisi_pcieX@event\\=0x4@subevent\\=0x02 \
>> hisi_pcieX@event\\=0x1000@subevent\\=0x02 \",
>>      "Unit": "hisi_pci",
>>      "Compat": "v1"
>> },
>>
>> (syntax may be incorrect - illustration only)
>>
> yes, we could add these metrics in json file, thanks.

The syntax is actually like:
    "MetricExpr": "hisi_pcieX@event\\=0x4\\,subevent\\=0x2@ / 
hisi_pcieX@event\\=0x1000\\,subevent\\=0x2@",

>>> Then the value in HISI_PCIE_CNT and HISI_PCIE_EXT_CNT returned
>>> separately, and userspace could do the calculation.
>> But I am still curious about lat_rx_mrd and the other events which we
>> continue to advertise. They don't really provide latency or bandwidth on
>> their own, but only half the necessary data. So I doubt their purpose.
>>
> So how about changing the event name to show the real purpose of this
> event, like changing "bw_rx_mrd" to "flux_rx_mrd", and changing
> "lat_rx_mrd" to "delay_rx_mrd"?

eh, I suppose you could, but I am not sure of the value. However I 
assume that the driver will detect and reject invalid or nonsense 
combinations of events if you did want this.

Thanks,
John

  reply	other threads:[~2021-06-28 12:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-24 10:59 [PATCH v7 0/2] drivers/perf: hisi: Add support for PCIe PMU Qi Liu
2021-06-24 10:59 ` [PATCH v7 1/2] docs: perf: Add description for HiSilicon PCIe PMU driver Qi Liu
2021-06-24 10:59 ` [PATCH v7 2/2] drivers/perf: hisi: Add driver for HiSilicon PCIe PMU Qi Liu
2021-06-25 15:53   ` John Garry
2021-06-26  2:13     ` liuqi (BA)
2021-06-26 11:44       ` John Garry
2021-06-28 10:49         ` liuqi (BA)
2021-06-28 12:11           ` John Garry [this message]
2021-06-28 13:17             ` liuqi (BA)
2021-06-28 12:03   ` kajoljain
2021-06-30  8:37     ` liuqi (BA)
2021-07-12 12:54   ` liuqi (BA)

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=f2e0ac61-d46d-1245-46e7-aea9bb83c64d@huawei.com \
    --to=john.garry@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liuqi115@huawei.com \
    --cc=mark.rutland@arm.com \
    --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 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).