From patchwork Mon Nov 30 02:14:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 57416 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1180298lbb; Sun, 29 Nov 2015 18:19:28 -0800 (PST) X-Received: by 10.67.30.168 with SMTP id kf8mr87213592pad.106.1448849968531; Sun, 29 Nov 2015 18:19:28 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zh9si6008724pac.79.2015.11.29.18.19.28; Sun, 29 Nov 2015 18:19:28 -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 S1753505AbbK3CTX (ORCPT + 28 others); Sun, 29 Nov 2015 21:19:23 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:36091 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751836AbbK3CRw (ORCPT ); Sun, 29 Nov 2015 21:17:52 -0500 Received: by pacdm15 with SMTP id dm15so168081995pac.3 for ; Sun, 29 Nov 2015 18:17: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=5qe9HsCntLfKGajelSIDP+fCrV4aArTjcwbuFddwPxI=; b=aMGchvSZ+3c2rLaLgAv/f9Ku4P5wBTJYEaRabybOZyJ33iFNZV/mwELx5wYFvV0R5V XmNcGHDGYseFccPoxWg1x1kdbnBKDjNKHWLfgOnVy4AY10HUaQey7SQeeQlGJYuVTqet hNebxqr6s88CdtpGguVhiVNsn4oQyafrpm53B8U3vYr2KA/ADvZiU+G+uBKFeozsBVQ+ aqok+FjlywTxYjQvuRSoAqcwf91vWybFtu0D6H3i5fDLtWyDZPL9SDFRmNJLJ/OpuIKt /PqHEEGb2qw2g+gy6Mux/8EhPnHp2P00AV6yrvK9oP3DyWh1/d51G/RjCzc83dsJlSyo JJpQ== 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=lHR1AwJH54ywb4O2bUQ0R71YiAnSAQy98YhNOibLW+NU/awDXvXakBk7vMYFwuvKij /mzhP9CYEhRhi5IWrbKVsp5Aw7qihQ7BPgnUZZqnnxOxeeZvuvA/aXn3sWPeyHK18gaV 17bT10WwrmHFggKiKgvS5vNKD4Tf1a/fxe0gGYlzEdy7SnIajmkd7J1KVxULaso0RFZH VHflQ3G28SOejdXYBA1A8zYaiaof+uR/LCFyRy6nDrcvojPiXKPXkV4CL44778ienN+P VD1WS8b8/Os0lBH4Z8pJyTnMjCsd+ikagdwoJAyMsFhSombzQmW3dwLkzwkT9B7cPDr2 pqtw== X-Gm-Message-State: ALoCoQnr9lRBlJ/sgEQ2PnMcQ8n6a+dEBH/DFHavBo4roElDAci1ByJbfeoq73Sz0zjRI2KfKmNd X-Received: by 10.98.0.73 with SMTP id 70mr66776105pfa.4.1448849871977; Sun, 29 Nov 2015 18:17:51 -0800 (PST) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id n16sm47168818pfa.53.2015.11.29.18.17.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 29 Nov 2015 18:17:51 -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, pawel.moll@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 V5 23/26] perf tools: making function set_max_cpu_num() non static Date: Sun, 29 Nov 2015 19:14:44 -0700 Message-Id: <1448849687-5724-24-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1448849687-5724-1-git-send-email-mathieu.poirier@linaro.org> References: <1448849687-5724-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);