Re: [PATCH v9 1/8] perf evlist: Introduce aux evlist

From: Nilay Vaish
Date: Wed Jun 22 2016 - 09:17:51 EST


On 22 June 2016 at 04:08, Wang Nan <wangnan0@xxxxxxxxxx> wrote:

> @@ -1916,3 +1922,24 @@ perf_evlist__find_evsel_by_str(struct perf_evlist *evlist,
>
> return NULL;
> }
> +
> +struct perf_evlist *perf_evlist__new_aux(struct perf_evlist *parent)
> +{
> + struct perf_evlist *evlist;
> +
> + if (perf_evlist__is_aux(parent)) {
> + pr_err("Internal error: create aux evlist from another aux evlist\n");
> + return NULL;
> + }
> +
> + evlist = zalloc(sizeof(*evlist));
> + if (!evlist)
> + return NULL;
> +
> + perf_evlist__init(evlist, parent->cpus, parent->threads);
> + evlist->parent = parent->parent;

A very minor suggestion. I think evlist->parent should be set to
'parent' and not 'parent->parent'. I agree the two values are equal,
but setting to parent->parent just does not seem right.

--
Nilay