Re: [PATCH 17/52] perf evlist: Add perf_evlist__set_tracking_event()

Jiri Olsa
2014-07-22T19:22:50Z

On Tue, Jul 22, 2014 at 04:17:26PM +0300, Adrian Hunter wrote:

SNIP

> }
> +
> +int perf_evlist__set_tracking_event(struct perf_evlist *evlist,
> + struct perf_evsel *tracking_evsel)
> +{
> + struct perf_evsel *evsel;
> +
> + if (tracking_evsel->idx == 0)
> + return 0;
> +
> + if (tracking_evsel->leader->nr_members > 1)
> + return -EINVAL;
> +
> + list_for_each_entry(evsel, &evlist->entries, node) {
> + if (evsel->idx < tracking_evsel->idx)
> + evsel->idx += 1;
> + }
> + tracking_evsel->idx = 0;
> +
> + return 0;
> +}

wouldnt it be better to add evsel->is_tracking bool for this?

jirka