From patchwork Thu Jan 14 21:46:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 59782 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp153426lbb; Thu, 14 Jan 2016 13:48:49 -0800 (PST) X-Received: by 10.66.161.70 with SMTP id xq6mr9540655pab.73.1452808129128; Thu, 14 Jan 2016 13:48:49 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gl10si11614779pac.164.2016.01.14.13.48.48; Thu, 14 Jan 2016 13:48:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756046AbcANVsr (ORCPT + 29 others); Thu, 14 Jan 2016 16:48:47 -0500 Received: from mail-pf0-f178.google.com ([209.85.192.178]:34126 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755130AbcANVre (ORCPT ); Thu, 14 Jan 2016 16:47:34 -0500 Received: by mail-pf0-f178.google.com with SMTP id q63so109252055pfb.1 for ; Thu, 14 Jan 2016 13:47:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=a+ITlJ8YEPHkeN73idA0PEaBZfHgXKx1umgaHJKkOA4=; b=DBUrGiWvsyZ9m/yIaGovoClrWusm8XERoZ3QlgF3ODnwY7Ji2qpyFhZX4CpAfFllqy rSmvsy8qb6ZQUfNic2rRFKX9DQZOrJEs1Tp7mJ+xksIubhPRuH8CMSUyaOjXHAhKBp+q Kqqwkvg5ORcnIO3cQHUJQR2HKwKaGl8plf3aI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=a+ITlJ8YEPHkeN73idA0PEaBZfHgXKx1umgaHJKkOA4=; b=D2a0ppNKLl1OhCcDG5I/uNvP74dQHl1fTF3RfzO2dPOHAUOUezg6qJr5Cu3/MWk7Km a2czqzd0NVQJ6pd6DNPmTAgBWf3BrUbdkzBzTwFStZ8xascqyOoIz9llDcFs0cuMI9i4 5a1ioh4peejvvGFDEXJpNfb/WWWlCZuZKypNvK9+QEqXtfAZOg71aou6C1lcdnBHiizq sa9k/upnXa7ILY7dYrZWHRSGKc2wvdOo9P56ThqH9D5zUZD0AAts6DzL0SHPfr2ZC0lO REFJNKKfxBMEvNzg+sINOPpdJcj2Ll7ltBKR2JEUb+4/4zPWjiHq5Qff0xe2A29+N1El QPlg== X-Gm-Message-State: ALoCoQkZFefkKpV4PoLvRaq4PPLaGmPlXegB/3TU1fN9tKVcpER5n2zXDj4e1mzrYnSUr11DlCrhsNbxzVzYusKUsL5BzS0+Ew== X-Received: by 10.98.89.139 with SMTP id k11mr9748701pfj.82.1452808053607; Thu, 14 Jan 2016 13:47:33 -0800 (PST) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id c87sm11383309pfj.41.2016.01.14.13.47.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jan 2016 13:47:33 -0800 (PST) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: linux-doc@vger.kernel.org, zhang.chunyan@linaro.org, mike.leach@arm.com, tor@ti.com, al.grant@arm.com, rabin@rab.in, Mathieu Poirier , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo Subject: [PATCH V8 20/23] perf tools: making function set_max_cpu_num() non static Date: Thu, 14 Jan 2016 14:46:14 -0700 Message-Id: <1452807977-8069-21-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452807977-8069-1-git-send-email-mathieu.poirier@linaro.org> References: <1452807977-8069-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For memory allocation purposes, code located in other places then util/cpumap.c may want to know how many CPUs the system has. This patch is making function set_max_cpu_num() available to other parts of the perf tool so that global variable 'max_cpu_num' gets the right value when referenced by cpu__max_cpu(). Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Signed-off-by: Mathieu Poirier --- tools/perf/util/cpumap.c | 2 +- tools/perf/util/cpumap.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) -- 2.1.4 diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c index 10af1e7524fb..ae179320c0c0 100644 --- a/tools/perf/util/cpumap.c +++ b/tools/perf/util/cpumap.c @@ -380,7 +380,7 @@ out: } /* Determine highest possible cpu in the system for sparse allocation */ -static void set_max_cpu_num(void) +void set_max_cpu_num(void) { const char *mnt; char path[PATH_MAX]; diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h index 85f7772457fa..45fa963345eb 100644 --- a/tools/perf/util/cpumap.h +++ b/tools/perf/util/cpumap.h @@ -14,6 +14,7 @@ struct cpu_map { int map[]; }; +void set_max_cpu_num(void); struct cpu_map *cpu_map__new(const char *cpu_list); struct cpu_map *cpu_map__empty_new(int nr); struct cpu_map *cpu_map__dummy_new(void);