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

Adrian Hunter
2014-07-23T06:26:36Z

On 07/22/2014 10:22 PM, Jiri Olsa wrote:
> 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?

Yes, I will look at doing that instead.