mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: Robin Murphy <robin.murphy@arm.com>, will@kernel.org
Cc: mark.rutland@arm.com, bwicaksono@nvidia.com,
	ilkka@os.amperecomputing.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] perf/arm_cspmu: Fix event attribute type
Date: Fri, 2 Jun 2023 11:25:42 +0100	[thread overview]
Message-ID: <81f0fbed-e4f4-f3a0-c269-3834a2fa6cd5@arm.com> (raw)
In-Reply-To: <83b65c432db89df0427c2d55e09c643264299f08.1685619571.git.robin.murphy@arm.com>

On 01/06/2023 12:59, Robin Murphy wrote:
> ARM_CSPMU_EVENT_ATTR() defines a struct perf_pmu_events_attr, so
> arm_cspmu_sysfs_event_show() should not be interpreting it as struct
> dev_ext_attribute.
> 
> Fixes: e37dfd65731d ("perf: arm_cspmu: Add support for ARM CoreSight PMU driver")
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> ---
>   drivers/perf/arm_cspmu/arm_cspmu.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/arm_cspmu.c
> index a3f1c410b417..72dc7a9e1ca8 100644
> --- a/drivers/perf/arm_cspmu/arm_cspmu.c
> +++ b/drivers/perf/arm_cspmu/arm_cspmu.c
> @@ -189,10 +189,10 @@ static inline bool use_64b_counter_reg(const struct arm_cspmu *cspmu)
>   ssize_t arm_cspmu_sysfs_event_show(struct device *dev,
>   				struct device_attribute *attr, char *buf)
>   {
> -	struct dev_ext_attribute *eattr =
> -		container_of(attr, struct dev_ext_attribute, attr);
> -	return sysfs_emit(buf, "event=0x%llx\n",
> -			  (unsigned long long)eattr->var);
> +	struct perf_pmu_events_attr *pmu_attr;
> +
> +	pmu_attr = container_of(attr, typeof(*pmu_attr), attr);
> +	return sysfs_emit(buf, "event=0x%llx\n", pmu_attr->id);
>   }

Thanks for catching this !  The other option would be to, which was
the original intention.

diff --git a/drivers/perf/arm_cspmu/arm_cspmu.h 
b/drivers/perf/arm_cspmu/arm_cspmu.h
index 51323b175a4a..b5e454be95b3 100644
--- a/drivers/perf/arm_cspmu/arm_cspmu.h
+++ b/drivers/perf/arm_cspmu/arm_cspmu.h
@@ -32,7 +32,7 @@
         ARM_CSPMU_EXT_ATTR(_name, arm_cspmu_sysfs_format_show, (char 
*)_config)

  #define ARM_CSPMU_EVENT_ATTR(_name, _config)			                   \
-       PMU_EVENT_ATTR_ID(_name, arm_cspmu_sysfs_event_show, _config)
+       ARM_CSPMU_EXT_ATTR(_name, arm_cspmu_sysfs_event_show, 
(void*)(unsigned long)_config)


  /* Default event id mask */

Either way,

Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>


  reply	other threads:[~2023-06-02 10:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01 11:59 [PATCH 0/4] perf/arm_cspmu: Fixes and cleanups Robin Murphy
2023-06-01 11:59 ` [PATCH 1/4] perf/arm_cspmu: Fix event attribute type Robin Murphy
2023-06-02 10:25   ` Suzuki K Poulose [this message]
2023-06-05  7:29   ` Ilkka Koskinen
2023-06-01 11:59 ` [PATCH 2/4] ACPI/APMT: Don't register invalid resource Robin Murphy
2023-06-02 10:27   ` Suzuki K Poulose
2023-06-03  7:42   ` Hanjun Guo
2023-06-05  7:31   ` Ilkka Koskinen
2023-06-01 11:59 ` [PATCH 3/4] perf/arm_cspmu: Clean up ACPI dependency Robin Murphy
2023-06-02 16:02   ` Suzuki K Poulose
2023-06-05  7:33   ` Ilkka Koskinen
2023-06-01 11:59 ` [PATCH 4/4] perf/arm_cspmu: Decouple APMT dependency Robin Murphy
2023-06-02 10:55   ` Suzuki K Poulose
2023-06-05  7:12   ` Ilkka Koskinen
2023-06-05 10:49     ` Robin Murphy

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=81f0fbed-e4f4-f3a0-c269-3834a2fa6cd5@arm.com \
    --to=suzuki.poulose@arm.com \
    --cc=bwicaksono@nvidia.com \
    --cc=ilkka@os.amperecomputing.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome