From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751249AbdBOIsu (ORCPT ); Wed, 15 Feb 2017 03:48:50 -0500 Received: from mx3-phx2.redhat.com ([209.132.183.24]:43702 "EHLO mx3-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750922AbdBOIss (ORCPT ); Wed, 15 Feb 2017 03:48:48 -0500 Date: Wed, 15 Feb 2017 03:48:19 -0500 (EST) From: Jan Stancek To: Jiri Olsa Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander shishkin , jolsa@kernel.org, mhiramat@kernel.org Message-ID: <956097334.4685469.1487148499443.JavaMail.zimbra@redhat.com> In-Reply-To: <20170214110110.GB18546@krava> References: <8ea4601b5cacc49927235b4ebac424bd6eeccb06.1486999090.git.jstancek@redhat.com> <1e819d91d89ddbd5e526bd216951b167233e74db.1486999090.git.jstancek@redhat.com> <20170214110110.GB18546@krava> Subject: Re: [PATCH v2 2/3] perf: make build_cpu_topology skip offline/absent CPUs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.34.26.57] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF45 (Linux)/8.0.6_GA_5922) Thread-Topic: perf: make build_cpu_topology skip offline/absent CPUs Thread-Index: A3aCtnSpLDROPAPdA1OgfnUtCKhk7Q== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- Original Message ----- > From: "Jiri Olsa" > To: "Jan Stancek" > Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, "alexander shishkin" > , jolsa@kernel.org, mhiramat@kernel.org > Sent: Tuesday, 14 February, 2017 12:01:10 PM > Subject: Re: [PATCH v2 2/3] perf: make build_cpu_topology skip offline/absent CPUs > > On Mon, Feb 13, 2017 at 04:34:35PM +0100, Jan Stancek wrote: > > SNIP > > > This patch makes build_cpu_topology() skip offline/absent CPUs, > > by checking their presence against cpu_map built from online CPUs. > > > > Signed-off-by: Jan Stancek > > --- > > tools/perf/util/header.c | 21 +++++++++++++++++---- > > 1 file changed, 17 insertions(+), 4 deletions(-) > > > > Changes in v2: > > - drop out label, use return NULL where possible > > > > diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c > > index d89c9c7ef4e5..4b0ea4e92e9d 100644 > > --- a/tools/perf/util/header.c > > +++ b/tools/perf/util/header.c > > @@ -503,24 +503,31 @@ static void free_cpu_topo(struct cpu_topo *tp) > > > > static struct cpu_topo *build_cpu_topology(void) > > { > > - struct cpu_topo *tp; > > + struct cpu_topo *tp = NULL; > > void *addr; > > u32 nr, i; > > size_t sz; > > long ncpus; > > - int ret = -1; > > + int ret = 0; > > hum, shoudn't we fail if we dont find any online cpu? > > jirka You're right, there's no reason to change this. I'll send v3.