From patchwork Fri Nov 13 18:45:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 7613941 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 49B679F2F7 for ; Fri, 13 Nov 2015 18:57:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6A46620648 for ; Fri, 13 Nov 2015 18:57:58 +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 8C8FD20544 for ; Fri, 13 Nov 2015 18:57:57 +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 1ZxJVp-0008Vc-51; Fri, 13 Nov 2015 18:55:53 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZxJNV-0006hU-46 for linux-arm-kernel@bombadil.infradead.org; Fri, 13 Nov 2015 18:47:17 +0000 Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZxJNS-0005Vr-Qh for linux-arm-kernel@lists.infradead.org; Fri, 13 Nov 2015 18:47:15 +0000 Received: by pabfh17 with SMTP id fh17so107897218pab.0 for ; Fri, 13 Nov 2015 10:46:52 -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=NGonuTmP2J8ciOTa5udK/K8cFJu568hPEslr18CwvH8=; b=TAKMQ7BNI3mZBefMOSSuX5pFq4HZlFH9taH7/JghNKbQ5jbDz7WlT+6Ee0ImEJe9Qb FInJC0xjPLlP7gtaHKr+IRhqzWZ4pey9YY0/1+QxfN6Rode9/81DPZf08os7pY5pvH7D EdQCDAoUoXIRRfC6bi9K3FE49PxUoUrjNfPn4kVpcHJZyYVwT9nytgAodULzDg+p8vKw 7N7XBAkGEHr8n5NQqRO6YIwPsQIHQyp1ocQXtdbtxyqe3+hG5Zz+XnxtBTrJeVr2fmtG Bb6dyVm+BJXhjVVVT5h4rufszEabBFTA+VKDqw9zR1VLANJ2wOyEda3Uqx4hstcvOQIU RHFQ== 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=NGonuTmP2J8ciOTa5udK/K8cFJu568hPEslr18CwvH8=; b=MuGfSQ+/PuXcw+CVMKdD6dbspH8PqaSUnjTPCWiVc770//IlKnTwMlYlzq16ew4cg5 4hppYrzn8TyElexVM2zyEOcIT8rQrmtd3k6zsj60EfklO4MFcPId73/1ySkDdeKXfRHV obkW+8uKTbAG7aGnirKelTv7UTqQHIZE9lFGqdFdyxODGUs5/nnTWkSFt+hVsJJWS2BF VvoS/BLZHmAlwFEQ5wm3GoTx9LzmsvUqYmA2y7WLgm7T/Ejo/HrIleio2mH3LBUIr/Do ZK83kZWFjKf7okyH4x2YlYvq9WbXMrApNFQ9ReIhGNCcJ9OOkMzx452/tEHYz43+Dl3j slSg== X-Gm-Message-State: ALoCoQn76PQ57SIhzd1kW5Lu/Eh3LmErwY7IiXetPz5zFqzseUdVPXcaVW+TAoSWULb+9upyVwKb X-Received: by 10.66.252.129 with SMTP id zs1mr14345494pac.59.1447440412800; Fri, 13 Nov 2015 10:46:52 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [184.64.168.246]) by smtp.gmail.com with ESMTPSA id xi7sm21737967pbc.56.2015.11.13.10.46.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Nov 2015 10:46:52 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org, a.p.zijlstra@chello.nl, alexander.shishkin@linux.intel.com, acme@kernel.org, mingo@redhat.com, corbet@lwn.net, nicolas.pitre@linaro.org Subject: [PATCH V4 23/26] perf tools: making function set_max_cpu_num() non static Date: Fri, 13 Nov 2015 11:45:14 -0700 Message-Id: <1447440317-1977-24-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447440317-1977-1-git-send-email-mathieu.poirier@linaro.org> References: <1447440317-1977-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151113_184715_038112_367EF6A1 X-CRM114-Status: GOOD ( 14.37 ) 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, mathieu.poirier@linaro.org, pawel.moll@arm.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, fainelli@broadcom.com, adrian.hunter@intel.com, tor@ti.com, 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.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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(). 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 3667e2123e5b..97ef46e4a0f6 100644 --- a/tools/perf/util/cpumap.c +++ b/tools/perf/util/cpumap.c @@ -373,7 +373,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 0af9cecb4c51..6f7dce7dcca6 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__dummy_new(void); struct cpu_map *cpu_map__read(FILE *file);