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: 7763651 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5F2C09F1C2 for ; Thu, 3 Dec 2015 21:18:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 819FD20503 for ; Thu, 3 Dec 2015 21:18:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD34120502 for ; Thu, 3 Dec 2015 21:18:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a4bF8-0000DL-Jy; Thu, 03 Dec 2015 21:16:46 +0000 Received: from mail-io0-x231.google.com ([2607:f8b0:4001:c06::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a4b53-0004bH-9O for linux-arm-kernel@lists.infradead.org; Thu, 03 Dec 2015 21:06:23 +0000 Received: by iouu10 with SMTP id u10so97016370iou.0 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=YYy5UwUfa/7xdLDR1wCMhQ6YoeqGPhzV66VIEvRPnhGNzfrm9yXTQHu872x6dihO+0 P7ZTiE1t31ACRHFUIE4RBjhHxbamjjmrEz8XOCGQHsKLYESOJyzYI5BBKd718Z7VvT6U BXlXc334LtlYTcr2mHeKnEVcu//VKRdJeKcj6GH+V/7xe/qjHzCsh66wp2cQHy5pGZPx dFItoZHL+UXbb/4Rc3R7rFvuVAITg51U658qqs5qkEE70r0OzofaJ+IhCy64DoWPfRjc NBwe6/AWOch8KsqZd91D9kQpY4v2cnixCvOozyOsFKAxTx8XzIr5uq4/O5dhOz7FT6FF ZxWA== X-Gm-Message-State: ALoCoQkpy41SukEKqXvrBadX46AWUP7cLLnUQQUoI4E6mVnrSYAgxrgeszndkWQRardUwh22dq5a 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151203_130621_658369_A1E76E8A X-CRM114-Status: GOOD ( 13.80 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: al.grant@arm.com, Peter Zijlstra , Mathieu Poirier , linux-doc@vger.kernel.org, fainelli@broadcom.com, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , tor@ti.com, Ingo Molnar , mike.leach@arm.com, zhang.chunyan@linaro.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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);