From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] perf: qcom_l2_pmu: add event names
Date: Mon, 25 Sep 2017 16:08:30 +0100 [thread overview]
Message-ID: <20170925150829.GA30917@arm.com> (raw)
In-Reply-To: <1505417413-30757-1-git-send-email-nleeder@codeaurora.org>
On Thu, Sep 14, 2017 at 03:30:13PM -0400, Neil Leeder wrote:
> Add event names so that common events can be
> specified symbolically, for example:
>
> l2cache_0/total-reads/,l2cache_0/cycles/
>
> Event names are displayed in 'perf list'.
>
> Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
> ---
> drivers/perf/qcom_l2_pmu.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 54 insertions(+)
>
> diff --git a/drivers/perf/qcom_l2_pmu.c b/drivers/perf/qcom_l2_pmu.c
> index b242cce..4fdc848 100644
> --- a/drivers/perf/qcom_l2_pmu.c
> +++ b/drivers/perf/qcom_l2_pmu.c
> @@ -92,6 +92,21 @@
>
> #define reg_idx(reg, i) (((i) * IA_L2_REG_OFFSET) + reg##_BASE)
>
> +/*
> + * Events
> + */
> +#define L2_EVENT_CYCLES 0xfe
> +#define L2_EVENT_DCACHE_OPS 0x400
> +#define L2_EVENT_ICACHE_OPS 0x401
> +#define L2_EVENT_TLBI 0x402
> +#define L2_EVENT_BARRIERS 0x403
> +#define L2_EVENT_TOTAL_READS 0x405
> +#define L2_EVENT_TOTAL_WRITES 0x406
> +#define L2_EVENT_TOTAL_REQUESTS 0x407
> +#define L2_EVENT_LDREX 0x420
> +#define L2_EVENT_STREX 0x421
> +#define L2_EVENT_CLREX 0x422
> +
> static DEFINE_RAW_SPINLOCK(l2_access_lock);
>
> /**
> @@ -700,9 +715,12 @@ static ssize_t l2_cache_pmu_cpumask_show(struct device *dev,
> /* CCG format for perf RAW codes. */
> PMU_FORMAT_ATTR(l2_code, "config:4-11");
> PMU_FORMAT_ATTR(l2_group, "config:0-3");
> +PMU_FORMAT_ATTR(event, "config:0-11");
> +
> static struct attribute *l2_cache_pmu_formats[] = {
> &format_attr_l2_code.attr,
> &format_attr_l2_group.attr,
> + &format_attr_event.attr,
> NULL,
> };
>
> @@ -711,9 +729,45 @@ static ssize_t l2_cache_pmu_cpumask_show(struct device *dev,
> .attrs = l2_cache_pmu_formats,
> };
>
> +static ssize_t l2cache_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);
Nit: do you want a 0x%03llx here?
(I'm happy to take the patch either way, so just let me know)
Will
WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will.deacon@arm.com>
To: Neil Leeder <nleeder@codeaurora.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Mark Langsdorf <mlangsdo@redhat.com>,
Mark Salter <msalter@redhat.com>, Jon Masters <jcm@redhat.com>,
Timur Tabi <timur@codeaurora.org>,
Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH] perf: qcom_l2_pmu: add event names
Date: Mon, 25 Sep 2017 16:08:30 +0100 [thread overview]
Message-ID: <20170925150829.GA30917@arm.com> (raw)
In-Reply-To: <1505417413-30757-1-git-send-email-nleeder@codeaurora.org>
On Thu, Sep 14, 2017 at 03:30:13PM -0400, Neil Leeder wrote:
> Add event names so that common events can be
> specified symbolically, for example:
>
> l2cache_0/total-reads/,l2cache_0/cycles/
>
> Event names are displayed in 'perf list'.
>
> Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
> ---
> drivers/perf/qcom_l2_pmu.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 54 insertions(+)
>
> diff --git a/drivers/perf/qcom_l2_pmu.c b/drivers/perf/qcom_l2_pmu.c
> index b242cce..4fdc848 100644
> --- a/drivers/perf/qcom_l2_pmu.c
> +++ b/drivers/perf/qcom_l2_pmu.c
> @@ -92,6 +92,21 @@
>
> #define reg_idx(reg, i) (((i) * IA_L2_REG_OFFSET) + reg##_BASE)
>
> +/*
> + * Events
> + */
> +#define L2_EVENT_CYCLES 0xfe
> +#define L2_EVENT_DCACHE_OPS 0x400
> +#define L2_EVENT_ICACHE_OPS 0x401
> +#define L2_EVENT_TLBI 0x402
> +#define L2_EVENT_BARRIERS 0x403
> +#define L2_EVENT_TOTAL_READS 0x405
> +#define L2_EVENT_TOTAL_WRITES 0x406
> +#define L2_EVENT_TOTAL_REQUESTS 0x407
> +#define L2_EVENT_LDREX 0x420
> +#define L2_EVENT_STREX 0x421
> +#define L2_EVENT_CLREX 0x422
> +
> static DEFINE_RAW_SPINLOCK(l2_access_lock);
>
> /**
> @@ -700,9 +715,12 @@ static ssize_t l2_cache_pmu_cpumask_show(struct device *dev,
> /* CCG format for perf RAW codes. */
> PMU_FORMAT_ATTR(l2_code, "config:4-11");
> PMU_FORMAT_ATTR(l2_group, "config:0-3");
> +PMU_FORMAT_ATTR(event, "config:0-11");
> +
> static struct attribute *l2_cache_pmu_formats[] = {
> &format_attr_l2_code.attr,
> &format_attr_l2_group.attr,
> + &format_attr_event.attr,
> NULL,
> };
>
> @@ -711,9 +729,45 @@ static ssize_t l2_cache_pmu_cpumask_show(struct device *dev,
> .attrs = l2_cache_pmu_formats,
> };
>
> +static ssize_t l2cache_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);
Nit: do you want a 0x%03llx here?
(I'm happy to take the patch either way, so just let me know)
Will
next prev parent reply other threads:[~2017-09-25 15:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-14 19:30 [PATCH] perf: qcom_l2_pmu: add event names Neil Leeder
2017-09-14 19:30 ` Neil Leeder
2017-09-25 15:08 ` Will Deacon [this message]
2017-09-25 15:08 ` Will Deacon
2017-09-27 15:10 ` Leeder, Neil
2017-09-27 15:10 ` Leeder, Neil
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=20170925150829.GA30917@arm.com \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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.