lkml.org 
[lkml]   [2023]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 4/5] perf: CXL Performance Monitoring Unit driver

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);
> > +}

\
 
 \ /
  Last update: 2023-05-26 11:28    [W:0.103 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site