From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753670AbdBNLSS (ORCPT ); Tue, 14 Feb 2017 06:18:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48960 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753361AbdBNLRS (ORCPT ); Tue, 14 Feb 2017 06:17:18 -0500 Date: Tue, 14 Feb 2017 12:17:15 +0100 From: Jiri Olsa To: Jan Stancek Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@kernel.org, mhiramat@kernel.org Subject: Re: [PATCH v2 1/3] perf: add cpu__max_present_cpu() Message-ID: <20170214111715.GC18546@krava> References: <20170202130100.GG2305@krava> <8ea4601b5cacc49927235b4ebac424bd6eeccb06.1486999090.git.jstancek@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8ea4601b5cacc49927235b4ebac424bd6eeccb06.1486999090.git.jstancek@redhat.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 14 Feb 2017 11:17:18 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 13, 2017 at 04:34:34PM +0100, Jan Stancek wrote: > Similar to cpu__max_cpu() (which returns max possible CPU), > returns max present CPU. > > Signed-off-by: Jan Stancek > --- > tools/perf/util/cpumap.c | 22 ++++++++++++++++++++++ > tools/perf/util/cpumap.h | 1 + > 2 files changed, 23 insertions(+) > > diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c > index 2c0b52264a46..8c7504939113 100644 > --- a/tools/perf/util/cpumap.c > +++ b/tools/perf/util/cpumap.c > @@ -9,6 +9,7 @@ > #include "asm/bug.h" > > static int max_cpu_num; > +static int max_present_cpu_num; I think it'd be less confusing for me if we follow the kernel names here static int max_cpu_possible; static int max_cpu_present; also I wonder we should use static int max_cpu_online; instead of: sysconf(_SC_NPROCESSORS_ONLN) but we can do it all later on as follow up jirka