From patchwork Fri Dec 18 20:59:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 7888361 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 69595BEEE5 for ; Fri, 18 Dec 2015 21:12:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 89FFF2051A for ; Fri, 18 Dec 2015 21:12:54 +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 9EC5F20380 for ; Fri, 18 Dec 2015 21:12:53 +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 1aA2J6-0000Ci-MN; Fri, 18 Dec 2015 21:11:20 +0000 Received: from mail-ig0-x22d.google.com ([2607:f8b0:4001:c05::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aA28h-0004mc-NL for linux-arm-kernel@lists.infradead.org; Fri, 18 Dec 2015 21:00:41 +0000 Received: by mail-ig0-x22d.google.com with SMTP id ph11so286261igc.1 for ; Fri, 18 Dec 2015 13:00:15 -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=Gol2oDT9wHkJ3kvVXb8kfs3b82ANkbunjU2fE7RqBYd9+fyMqXooRcL2aocml0L2A6 iERNf3Ib2/PhVPjaK6993ZlZM0g2w9gVvoUi8NYMNonReDjvaBZJxpX0dLrpWL6MwrD0 4QnEV4o9c/8fjeDpBCkKE0pW+wZI3Fy/jlLpA= 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=cGgc/VcSJSfnHOsvAeSBLvwn4da5vWXKCAuBOmJQQuAQKxUUqgLqOhyzf6a3/7z3gV FhNXW/maq1nfg6S7o+UjUfWKVot4ZEhntyPz7A+paW7M7ppAI8oGiXuI+F9VCham4fBc 1hgzbMW/A7hNIGC0tYYEajfKRw6SByugLU4we0hgOtu9T9swew0r12XP3jGAjLMtAAMM fNOTufp9X+OIbh18srmkwcRNKsUzE8RIe0y4csqETYwnUHjjUo8OFWKpaGhSWk5URE08 W9eGsA24mb8FZPAgtVf8mjMFp91ZCVc5CQRwSnbx3oKx7jhkT/VWKAwZ8JSDnSrQRJI+ Fn2Q== X-Gm-Message-State: ALoCoQlFEfDRoLSxi2Q8nbVPYeH693Ng7mUQb4kT5zbgQbUpaNqYBmAKWqTV9HvUmWYSwMZdTBBQS1nFBooqvmVuO0O7o4zn7g== X-Received: by 10.50.138.4 with SMTP id qm4mr5242525igb.45.1450472415252; Fri, 18 Dec 2015 13:00:15 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [184.64.168.246]) by smtp.gmail.com with ESMTPSA id l10sm843701igx.18.2015.12.18.13.00.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Dec 2015 13:00:14 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org, alexander.shishkin@linux.intel.com Subject: [PATCH V7 21/24] perf tools: making function set_max_cpu_num() non static Date: Fri, 18 Dec 2015 13:59:17 -0700 Message-Id: <1450472361-426-22-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1450472361-426-1-git-send-email-mathieu.poirier@linaro.org> References: <1450472361-426-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151218_130036_006063_4904630E X-CRM114-Status: GOOD ( 13.45 ) X-Spam-Score: -2.7 (--) 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);