On Mon, Sep 16, 2019 at 06:41:21AM -0700, [email protected] 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;
> +}

Reply via email to