Messages in this thread | | | Date | Mon, 30 Sep 2019 15:36:24 +0200 | From | Peter Zijlstra <> | Subject | Re: [PATCH V4 07/14] perf/x86/intel: Support hardware TopDown metrics |
| |
On Mon, Sep 16, 2019 at 06:41:21AM -0700, kan.liang@linux.intel.com wrote: > +static int add_nr_metric_event(struct cpu_hw_events *cpuc, > + struct perf_event *event, > + int *max_count) > +{ > + /* There are 4 TopDown metrics events. */ > + if (is_metric_event(event) && (++cpuc->n_metric_event > 4)) > + return -EINVAL; > + > + *max_count += cpuc->n_metric_event;
That's busted; it would increment with 1,2,3,4 for a total of 10.
> + > + return 0; > +}
| |