Messages in this thread | | | Date | Fri, 26 May 2023 10:27:05 +0100 | From | Jonathan Cameron <> | Subject | Re: [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); > > +}
| |