mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Garry <john.garry@huawei.com>
To: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>,
	<lorenzo.pieralisi@arm.com>, <robin.murphy@arm.com>,
	<will.deacon@arm.com>, <mark.rutland@arm.com>
Cc: <guohanjun@huawei.com>, <pabba@codeaurora.org>,
	<vkilari@codeaurora.org>, <rruigrok@codeaurora.org>,
	<linux-acpi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <linuxarm@huawei.com>,
	<neil.m.leeder@gmail.com>
Subject: Re: [PATCH v3 2/3] perf: add arm64 smmuv3 pmu driver
Date: Wed, 3 Oct 2018 12:06:41 +0100	[thread overview]
Message-ID: <e3546ab9-269c-c39c-344f-ff2eb9a5336b@huawei.com> (raw)
In-Reply-To: <20180921150803.25444-3-shameerali.kolothum.thodi@huawei.com>

On 21/09/2018 16:08, Shameer Kolothum wrote:
> +
> +ssize_t smmu_pmu_event_show(struct device *dev,
> +			    struct device_attribute *attr, char *page)
> +{
> +	struct perf_pmu_events_attr *pmu_attr;
> +
> +	pmu_attr = container_of(attr, struct perf_pmu_events_attr, attr);
> +
> +	return sprintf(page, "event=0x%02llx\n", pmu_attr->id);
> +}

Is there some reason PMU drivers have their own edition of this 
function? I see a few similar ones here:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/kernel/perf_event.c#n309

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/perf/core-book3s.c#n1986

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/s390/kernel/perf_event.c#n239

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/perf/qcom_l2_pmu.c#n731

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/perf/qcom_l3_pmu.c#n655

That is apart from the event id width format.

But the leading zeroes seem to be cropped anyway in the perf tool, 
according to this:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/util/pmu.c#n335 
(this was added in 0c24d6fb7db, in June 18)

John

> +
> +#define SMMU_EVENT_ATTR(_name, _id)					  \
> +	(&((struct perf_pmu_events_attr[]) {				  \
> +		{ .attr = __ATTR(_name, 0444, smmu_pmu_event_show, NULL), \
> +		  .id = _id, }						  \
> +	})[0].attr.attr)
> +
> +static struct attribute *smmu_pmu_events[] = {
> +	SMMU_EVENT_ATTR(cycles, 0),
> +	SMMU_EVENT_ATTR(transaction, 1),
> +	SMMU_EVENT_ATTR(tlb_miss, 2),
> +	SMMU_EVENT_ATTR(config_cache_miss, 3),
> +	SMMU_EVENT_ATTR(trans_table_walk, 4),
> +	SMMU_EVENT_ATTR(config_struct_access, 5),
> +	SMMU_EVENT_ATTR(pcie_ats_trans_rq, 6),
> +	SMMU_EVENT_ATTR(pcie_ats_trans_passed, 7),
> +	NULL
> +};



  parent reply	other threads:[~2018-10-03 11:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-21 15:08 [PATCH v3 0/3] arm64 SMMUv3 PMU driver with IORT support Shameer Kolothum
2018-09-21 15:08 ` [PATCH v3 1/3] acpi: arm64: add iort support for PMCG Shameer Kolothum
2018-10-04 16:43   ` Lorenzo Pieralisi
2018-10-04 17:35     ` Robin Murphy
2018-10-05 11:06       ` Shameerali Kolothum Thodi
2018-09-21 15:08 ` [PATCH v3 2/3] perf: add arm64 smmuv3 pmu driver Shameer Kolothum
2018-10-02 14:11   ` Jean-Philippe Brucker
2018-10-02 16:19     ` Jean-Philippe Brucker
2018-10-02 16:35       ` Robin Murphy
2018-10-03  8:52         ` Shameerali Kolothum Thodi
2018-10-03  8:46     ` Shameerali Kolothum Thodi
2018-10-03  9:46       ` Jean-Philippe Brucker
2018-10-03 10:21         ` Robin Murphy
2018-10-03 10:37   ` Robin Murphy
2018-10-03 11:28     ` Shameerali Kolothum Thodi
2018-10-03 11:06   ` John Garry [this message]
2018-10-11 11:25   ` Robin Murphy
2018-10-11 11:49     ` Shameerali Kolothum Thodi
2018-09-21 15:08 ` [PATCH v3 3/3] perf/smmuv3: Add MSI irq support Shameer Kolothum

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=e3546ab9-269c-c39c-344f-ff2eb9a5336b@huawei.com \
    --to=john.garry@huawei.com \
    --cc=guohanjun@huawei.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=neil.m.leeder@gmail.com \
    --cc=pabba@codeaurora.org \
    --cc=robin.murphy@arm.com \
    --cc=rruigrok@codeaurora.org \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=vkilari@codeaurora.org \
    --cc=will.deacon@arm.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

all inboxes | Powered by JetHome®