linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Namhyung Kim <namhyung@gmail.com>
Cc: Liang Kan <kan.liang@linux.intel.com>,
	<linux-cxl@vger.kernel.org>, <peterz@infradead.org>,
	<mark.rutland@arm.com>, <will@kernel.org>, <mingo@redhat.com>,
	<acme@kernel.org>, <dan.j.williams@intel.com>,
	<linuxarm@huawei.com>, <linux-perf-users@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Davidlohr Bueso <dave@stgolabs.net>,
	"Dave Jiang" <dave.jiang@intel.com>,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH v6 4/5] perf: CXL Performance Monitoring Unit driver
Date: Fri, 26 May 2023 10:27:05 +0100	[thread overview]
Message-ID: <20230526102705.00003345@Huawei.com> (raw)
In-Reply-To: <CAM9d7ciPW67QRRwRsY3-ouEM6wM0YdX+qnkkqYmTXRLwJcgqkA@mail.gmail.com>


Hi Namhyung,

> > +static int cxl_pmu_event_init(struct perf_event *event)
> > +{
> > +       struct cxl_pmu_info *info = pmu_to_cxl_pmu_info(event->pmu);
> > +
> > +       event->cpu = info->on_cpu;  
> 
> Why not change the event->cpu after validation is done?

Sure. Whilst I think it's harmless,
it logically makes more sense to do it a few lines later
so I'll move it to the end of this function.


> 
> Thanks,
> Namhyung
> 
> 
> > +       /* Top level type sanity check - is this a Hardware Event being requested */
> > +       if (event->attr.type != event->pmu->type)
> > +               return -ENOENT;
> > +
> > +       if (is_sampling_event(event) || event->attach_state & PERF_ATTACH_TASK)
> > +               return -EOPNOTSUPP;
> > +       /* TODO: Validation of any filter */
> > +
> > +       /*
> > +        * Verify that it is possible to count what was requested. Either must
> > +        * be a fixed counter that is a precise match or a configurable counter
> > +        * where this is a subset.
> > +        */
> > +       return cxl_pmu_get_event_idx(event, NULL, NULL);
> > +}

  parent reply	other threads:[~2023-05-26  9:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13 14:26 [PATCH v6 0/5] perf: CXL 3.0 Performance Monitoring Unit support Jonathan Cameron
2023-04-13 14:26 ` [PATCH v6 1/5] perf: Allow a PMU to have a parent Jonathan Cameron
2023-04-14  8:20   ` Peter Zijlstra
2023-04-13 14:26 ` [PATCH v6 2/5] cxl: Add functions to get an instance of / count regblocks of a given type Jonathan Cameron
2023-04-13 14:26 ` [PATCH v6 3/5] cxl/pci: Find and register CXL PMU devices Jonathan Cameron
2023-04-13 14:26 ` [PATCH v6 4/5] perf: CXL Performance Monitoring Unit driver Jonathan Cameron
2023-04-22 22:31   ` Dan Williams
2023-04-23 13:48     ` Jonathan Cameron
2023-05-19 11:53       ` Will Deacon
2023-05-26  1:06   ` Namhyung Kim
2023-05-26  1:18     ` Stephane Eranian
2023-05-26  9:24       ` Jonathan Cameron
2023-05-27  5:45         ` Namhyung Kim
2023-05-26  9:27     ` Jonathan Cameron [this message]
2023-04-13 14:26 ` [PATCH v6 5/5] docs: perf: Minimal introduction the the CXL PMU device and driver Jonathan Cameron

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=20230526102705.00003345@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=acme@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=eranian@google.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@gmail.com \
    --cc=peterz@infradead.org \
    --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;
as well as URLs for NNTP newsgroup(s).