From patchwork Thu Dec 3 21:04:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 57680 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp167250lbb; Thu, 3 Dec 2015 13:07:50 -0800 (PST) X-Received: by 10.98.67.207 with SMTP id l76mr16352942pfi.59.1449176870241; Thu, 03 Dec 2015 13:07:50 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fc7si11575033pab.144.2015.12.03.13.07.49; Thu, 03 Dec 2015 13:07:50 -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=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754619AbbLCVHs (ORCPT + 28 others); Thu, 3 Dec 2015 16:07:48 -0500 Received: from mail-io0-f179.google.com ([209.85.223.179]:35178 "EHLO mail-io0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753849AbbLCVGD (ORCPT ); Thu, 3 Dec 2015 16:06:03 -0500 Received: by ioc74 with SMTP id 74so94848081ioc.2 for ; Thu, 03 Dec 2015 13:06:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5qe9HsCntLfKGajelSIDP+fCrV4aArTjcwbuFddwPxI=; b=BElMgaLdcOikWsIZ33Fhpf8GE0+1T25MH+s7zX91BVv2H2P1wMGp1LS/G30dJ/0cdp PHbY2/OpY1Miwsh5gmv3SahyvI5+CBcsrjkNoaf95WFQ+cZ/BrEOv8ukIN2SMV9Y2Drb TObKjKcbFGZIAH/bll+kK5Pynf4Ee1fkHPOp7NGaVgakw+bhb+9wVuEUTkLbZ8GGX/mG ZCNUH9b6jK6fhFyajiL6z2A5ep86WQgryfPUuQgO9W4Bq1UvQVbYhPZZK/DgtM3LAwh5 A627c/3WinO75OY6VZrVfecHoB+TighOwtsP5oz2xVBLvaFZKvokN5KhK+wEPiCC+b9X T+FA== 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=5qe9HsCntLfKGajelSIDP+fCrV4aArTjcwbuFddwPxI=; b=MiIxg5G43KmMwBeUqmNdEPz85E6yx7b4+HvUp4YpgyxMqBnbASYM6kd/QkhN8ui1WT bqCk+aG9NxMPT2dK/VwfLrSHj0Dngy3/9coyubA3APO4lFsl3+TuQ951bgFaEGDlIhD1 hSAC/JHhjUu/BmbfWmcuoh7hqeNPUfTvhkR5T6z4H7ACmdAJfGcXMtLIidL7/pbJ2N0Y hPIhDhenjoW3JBiUic9m0PTCoDlrR/lubazm6k9LdlfjPAAA+y/vRMG6UUvVXoL2Q4bM ix1BJcxouy1hikwEQnwcu4nrGkZjqG83tcZb/KF2QQ43Jnsf3/iXjvEZiHKsbosZHRlA wFhA== X-Gm-Message-State: ALoCoQnowBCa2zcC8PqchzOf6dhVi5jt3tN2jcZmbc4jEkwYkSwT/TRLYBcbkVDWjr8nw5svd0OJ X-Received: by 10.107.9.152 with SMTP id 24mr10364682ioj.112.1449176762674; Thu, 03 Dec 2015 13:06:02 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [184.64.168.246]) by smtp.gmail.com with ESMTPSA id d81sm3615433ioj.12.2015.12.03.13.06.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Dec 2015 13:06:02 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org, alexander.shishkin@linux.intel.com Cc: zhang.chunyan@linaro.org, mike.leach@arm.com, tor@ti.com, al.grant@arm.com, fainelli@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Mathieu Poirier , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo Subject: [PATCH V6 23/26] perf tools: making function set_max_cpu_num() non static Date: Thu, 3 Dec 2015 14:04:59 -0700 Message-Id: <1449176702-13213-24-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1449176702-13213-1-git-send-email-mathieu.poirier@linaro.org> References: <1449176702-13213-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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ 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);