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

From: Jiri Olsa
Date: Tue Jul 22 2014 - 15:22:54 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/