From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752030AbcFVNlW (ORCPT ); Wed, 22 Jun 2016 09:41:22 -0400 Received: from mail.kernel.org ([198.145.29.136]:33772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751355AbcFVNlU (ORCPT ); Wed, 22 Jun 2016 09:41:20 -0400 Date: Wed, 22 Jun 2016 10:40:51 -0300 From: Arnaldo Carvalho de Melo To: Wang Nan Cc: Nilay Vaish , Linux Kernel list , pi3orama@163.com, He Kuang , Jiri Olsa , Masami Hiramatsu , Namhyung Kim , Zefan Li Subject: Re: [PATCH v9 1/8] perf evlist: Introduce aux evlist Message-ID: <20160622134051.GI4213@kernel.org> References: <1466586531-89751-1-git-send-email-wangnan0@huawei.com> <1466586531-89751-2-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Jun 22, 2016 at 08:17:02AM -0500, Nilay Vaish escreveu: > On 22 June 2016 at 04:08, Wang Nan wrote: > > +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. I felt like that, thought I was missing something, which is always a bad feeling when processing a patch... So, Wang, does that have some value we are not seeing? I thought about the possibility of adding an aux2 to an aux1 evlist and that making aux2 have the same parent as aux1, but that is checked on that pr_err() test... - Arnaldo