All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Mark Rutland <mark.rutland@arm.com>
Cc: linux-kernel@vger.kernel.org, Hector Martin <marcan@marcan.st>,
	Ian Rogers <irogers@google.com>,
	acme@redhat.com, james.clark@arm.com, john.g.garry@oracle.com,
	leo.yan@linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-perf-users@vger.kernel.org, mike.leach@linaro.org,
	namhyung@kernel.org, suzuki.poulose@arm.com,
	tmricht@linux.ibm.com, will@kernel.org
Subject: Re: [PATCH] perf print-events: make is_event_supported() more robust
Date: Wed, 17 Jan 2024 09:05:25 +0000	[thread overview]
Message-ID: <8734uwxrca.wl-maz@kernel.org> (raw)
In-Reply-To: <20240116170348.463479-1-mark.rutland@arm.com>

Hi Mark,

On Tue, 16 Jan 2024 17:03:48 +0000,
Mark Rutland <mark.rutland@arm.com> wrote:
> 
> Currently the perf tool doesn't deteect support for extneded event types
> on Apple M1/M2 systems, and will not auto-expand plain PERF_EVENT_TYPE
> hardware events into per-PMU events. This is due to the detection of
> extended event types not handling mandatory filters required by the
> M1/M2 PMU driver.

Thanks for looking into this.

I've given your patch a go on my M1 box, and it indeed makes things
substantially better:

$ sudo ./perf stat -e cycles ~/hackbench 100 process 1000
Running with 100*40 (== 4000) tasks.
Time: 3.419

 Performance counter stats for '/home/maz/hackbench 100 process 1000':

   174,783,472,090      apple_firestorm_pmu/cycles/                                             (93.10%)
    39,134,744,813      apple_icestorm_pmu/cycles/                                              (71.86%)

       3.568145595 seconds time elapsed

      12.203084000 seconds user
      55.135271000 seconds sys

However, I'm seeing some slightly odd behaviours:

$ sudo ./perf stat -e cycles:k ~/hackbench 100 process 1000
Running with 100*40 (== 4000) tasks.
Time: 3.313

 Performance counter stats for '/home/maz/hackbench 100 process 1000':

   <not supported>      apple_firestorm_pmu/cycles:k/                                         
   <not supported>      apple_icestorm_pmu/cycles:k/                                          

       3.467568841 seconds time elapsed

      13.080111000 seconds user
      53.162099000 seconds sys

I would have expected it to count, but it didn't. For that to work, I
have to add the 'H' modifier:

$ sudo ./perf stat -e cycles:Hk ~/hackbench 100 process 1000
Running with 100*40 (== 4000) tasks.
Time: 3.335

 Performance counter stats for '/home/maz/hackbench 100 process 1000':

   183,756,134,397      apple_firestorm_pmu/cycles:Hk/                                          (85.56%)
    37,302,841,991      apple_icestorm_pmu/cycles:Hk/                                           (72.10%)

       3.490138958 seconds time elapsed

      13.376772000 seconds user
      53.326289000 seconds sys

But my perf-foo is as basic as it gets, so it is likely that I'm
missing something.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Mark Rutland <mark.rutland@arm.com>
Cc: linux-kernel@vger.kernel.org, Hector Martin <marcan@marcan.st>,
	Ian Rogers <irogers@google.com>,
	acme@redhat.com, james.clark@arm.com, john.g.garry@oracle.com,
	leo.yan@linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-perf-users@vger.kernel.org, mike.leach@linaro.org,
	namhyung@kernel.org, suzuki.poulose@arm.com,
	tmricht@linux.ibm.com, will@kernel.org
Subject: Re: [PATCH] perf print-events: make is_event_supported() more robust
Date: Wed, 17 Jan 2024 09:05:25 +0000	[thread overview]
Message-ID: <8734uwxrca.wl-maz@kernel.org> (raw)
In-Reply-To: <20240116170348.463479-1-mark.rutland@arm.com>

Hi Mark,

On Tue, 16 Jan 2024 17:03:48 +0000,
Mark Rutland <mark.rutland@arm.com> wrote:
> 
> Currently the perf tool doesn't deteect support for extneded event types
> on Apple M1/M2 systems, and will not auto-expand plain PERF_EVENT_TYPE
> hardware events into per-PMU events. This is due to the detection of
> extended event types not handling mandatory filters required by the
> M1/M2 PMU driver.

Thanks for looking into this.

I've given your patch a go on my M1 box, and it indeed makes things
substantially better:

$ sudo ./perf stat -e cycles ~/hackbench 100 process 1000
Running with 100*40 (== 4000) tasks.
Time: 3.419

 Performance counter stats for '/home/maz/hackbench 100 process 1000':

   174,783,472,090      apple_firestorm_pmu/cycles/                                             (93.10%)
    39,134,744,813      apple_icestorm_pmu/cycles/                                              (71.86%)

       3.568145595 seconds time elapsed

      12.203084000 seconds user
      55.135271000 seconds sys

However, I'm seeing some slightly odd behaviours:

$ sudo ./perf stat -e cycles:k ~/hackbench 100 process 1000
Running with 100*40 (== 4000) tasks.
Time: 3.313

 Performance counter stats for '/home/maz/hackbench 100 process 1000':

   <not supported>      apple_firestorm_pmu/cycles:k/                                         
   <not supported>      apple_icestorm_pmu/cycles:k/                                          

       3.467568841 seconds time elapsed

      13.080111000 seconds user
      53.162099000 seconds sys

I would have expected it to count, but it didn't. For that to work, I
have to add the 'H' modifier:

$ sudo ./perf stat -e cycles:Hk ~/hackbench 100 process 1000
Running with 100*40 (== 4000) tasks.
Time: 3.335

 Performance counter stats for '/home/maz/hackbench 100 process 1000':

   183,756,134,397      apple_firestorm_pmu/cycles:Hk/                                          (85.56%)
    37,302,841,991      apple_icestorm_pmu/cycles:Hk/                                           (72.10%)

       3.490138958 seconds time elapsed

      13.376772000 seconds user
      53.326289000 seconds sys

But my perf-foo is as basic as it gets, so it is likely that I'm
missing something.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-01-17  9:05 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16 17:03 [PATCH] perf print-events: make is_event_supported() more robust Mark Rutland
2024-01-16 17:03 ` Mark Rutland
2024-01-17  9:05 ` Marc Zyngier [this message]
2024-01-17  9:05   ` Marc Zyngier
2024-01-17 12:12   ` Mark Rutland
2024-01-17 12:12     ` Mark Rutland
2024-01-19  5:57     ` Namhyung Kim
2024-01-19  5:57       ` Namhyung Kim
2024-01-24 16:05       ` Mark Rutland
2024-01-24 16:05         ` Mark Rutland
2024-01-26 14:36     ` Mark Rutland
2024-01-26 14:36       ` Mark Rutland
2024-01-19 15:00   ` James Clark
2024-01-19 15:00     ` James Clark
2024-01-20 18:27 ` Ian Rogers
2024-01-20 18:27   ` Ian Rogers
2024-01-20 18:29   ` Ian Rogers
2024-01-20 18:29     ` Ian Rogers
2024-01-24 15:51     ` Mark Rutland
2024-01-24 15:51       ` Mark Rutland
2024-01-24 15:48   ` Mark Rutland
2024-01-24 15:48     ` Mark Rutland
2024-01-22 10:43 ` James Clark
2024-01-22 10:43   ` James Clark
2024-01-24 15:53   ` Mark Rutland
2024-01-24 15:53     ` Mark Rutland
2024-01-24 16:19     ` James Clark
2024-01-24 16:19       ` James Clark

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=8734uwxrca.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=acme@redhat.com \
    --cc=irogers@google.com \
    --cc=james.clark@arm.com \
    --cc=john.g.garry@oracle.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=mark.rutland@arm.com \
    --cc=mike.leach@linaro.org \
    --cc=namhyung@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=tmricht@linux.ibm.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 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.