mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Ian Rogers <irogers@google.com>
Cc: Namhyung Kim <namhyung@kernel.org>,
	"Liang, Kan" <kan.liang@linux.intel.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	maz@kernel.org, marcan@marcan.st, linux-kernel@vger.kernel.org,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf top: Use evsel's cpus to replace user_requested_cpus
Date: Tue, 12 Dec 2023 18:31:05 +0000	[thread overview]
Message-ID: <ZXim6U5251q0_bB2@FVFF77S0Q05N.cambridge.arm.com> (raw)
In-Reply-To: <CAP-5=fVd-0aSovYVsOmTo2dfKb5_PHz1KV7ePipi35_JbfJ6qQ@mail.gmail.com>

On Tue, Dec 12, 2023 at 10:00:16AM -0800, Ian Rogers wrote:
> On Tue, Dec 12, 2023 at 9:23 AM Namhyung Kim <namhyung@kernel.org> wrote:
> >
> > On Tue, Dec 12, 2023 at 7:56 AM Liang, Kan <kan.liang@linux.intel.com> wrote:
> > >
> > >
> > >
> > > On 2023-12-11 4:13 p.m., Arnaldo Carvalho de Melo wrote:
> > > > Em Fri, Dec 08, 2023 at 01:08:55PM -0800, kan.liang@linux.intel.com escreveu:
> > > >> From: Kan Liang <kan.liang@linux.intel.com>
> > > >>
> > > >> perf top errors out on a hybrid machine
> > > >>  $perf top
> > > >>
> > > >>  Error:
> > > >>  The cycles:P event is not supported.
> > > >>
> > > >> The user_requested_cpus may contain CPUs that are invalid for a hybrid
> > > >> PMU. It causes perf_event_open to fail.
> > > >
> > > > ?
> > > >
> > > > All perf top expects is that the "cycles", the most basic one, be
> > > > collected, on all CPUs in the system.
> > > >
> > >
> > > Yes, but for hybrid there is no single "cycles" event which can cover
> > > all CPUs.
> >
> > Does that mean the kernel would reject the legacy "cycles" event
> > on hybrid CPUs?
> 
> I believe not. When the extended type isn't set on legacy cycles we
> often have the CPU and from that can determine the PMU. The issue is
> with the -1 any CPU perf_event_open option. As I was told, the PMU the
> event is opened on in this case is the first one registered in the
> kernel, on Intel hybrid this could be cpu_core or cpu_atom.. but IIRC
> it'll probably be cpu_core. On ARM ¯\_(ツ)_/¯.

On ARM it'll be essentially the same as on x86: if you open an event with
type==PERF_EVENT_TYPE_HARDWARE (without the extended HW type pointing to a
specific PMU), and with cpu==-1, it'll go to an arbitrary CPU PMU, whichever
happens to be found by perf_init_event() when iterating over the 'pmus' list.

If you open an event with type==PERF_EVENT_TYPE_HARDWARE and cpu!=-1, the event
will opened on the appropriate CPU PMU, by virtue of being rejected by others
when perf_init_event() iterates over the 'pmus' list.

Mark.

  reply	other threads:[~2023-12-12 18:31 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08 21:08 kan.liang
2023-12-11 21:13 ` Arnaldo Carvalho de Melo
2023-12-12 15:56   ` Liang, Kan
2023-12-12 16:58     ` Arnaldo Carvalho de Melo
2023-12-12 17:23     ` Namhyung Kim
2023-12-12 18:00       ` Ian Rogers
2023-12-12 18:31         ` Mark Rutland [this message]
2023-12-12 18:49           ` Namhyung Kim
2023-12-12 19:22             ` Liang, Kan
2023-12-13 12:05               ` Mark Rutland
2023-12-12 19:26             ` Ian Rogers
2023-12-15 15:36           ` Arnaldo Carvalho de Melo
2023-12-15 16:51             ` Mark Rutland
2023-12-15 17:49               ` Arnaldo Carvalho de Melo
2024-01-05 12:31                 ` Mark Rutland
2023-12-15 17:59             ` Liang, Kan
2023-12-15 18:26               ` Arnaldo Carvalho de Melo
2023-12-15 18:53                 ` Liang, Kan
2023-12-18 20:23                   ` Arnaldo Carvalho de Melo
2023-12-18 21:07                     ` Liang, Kan
2023-12-12  0:02 ` Ian Rogers

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=ZXim6U5251q0_bB2@FVFF77S0Q05N.cambridge.arm.com \
    --to=mark.rutland@arm.com \
    --cc=acme@kernel.org \
    --cc=irogers@google.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=maz@kernel.org \
    --cc=namhyung@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

all inboxes | Powered by JetHome®