From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752296AbbFZIqK (ORCPT ); Fri, 26 Jun 2015 04:46:10 -0400 Received: from terminus.zytor.com ([198.137.202.10]:52225 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751888AbbFZIqD (ORCPT ); Fri, 26 Jun 2015 04:46:03 -0400 Date: Fri, 26 Jun 2015 01:45:43 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: ak@linux.intel.com, tglx@linutronix.de, hpa@zytor.com, acme@redhat.com, eranian@google.com, namhyung@kernel.org, jolsa@kernel.org, adrian.hunter@intel.com, linux-kernel@vger.kernel.org, mingo@kernel.org, a.p.zijlstra@chello.nl, dsahern@gmail.com Reply-To: ak@linux.intel.com, tglx@linutronix.de, acme@redhat.com, hpa@zytor.com, eranian@google.com, namhyung@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, adrian.hunter@intel.com, mingo@kernel.org, dsahern@gmail.com, a.p.zijlstra@chello.nl In-Reply-To: <1435012588-9007-8-git-send-email-jolsa@kernel.org> References: <1435012588-9007-8-git-send-email-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf tools: Make perf_evsel__(nr_)cpus generic Git-Commit-ID: a22e99cd74a31dee4b5241bd60a256c629c808da X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: a22e99cd74a31dee4b5241bd60a256c629c808da Gitweb: http://git.kernel.org/tip/a22e99cd74a31dee4b5241bd60a256c629c808da Author: Jiri Olsa AuthorDate: Tue, 23 Jun 2015 00:36:08 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 25 Jun 2015 17:15:39 -0300 perf tools: Make perf_evsel__(nr_)cpus generic Because we now propagate all evlist's cpu_maps and thread_map objects through all evsels, the perf_evsel__(nr_)cpus no longer need to be specific to stat object and check evlist and target objects. Signed-off-by: Jiri Olsa Cc: Adrian Hunter Cc: Andi Kleen Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/1435012588-9007-8-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-stat.c | 10 ---------- tools/perf/util/evsel.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index fcf99bd..3e1636c 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -141,16 +141,6 @@ static inline void diff_timespec(struct timespec *r, struct timespec *a, } } -static inline struct cpu_map *perf_evsel__cpus(struct perf_evsel *evsel) -{ - return (evsel->cpus && !target.cpu_list) ? evsel->cpus : evsel_list->cpus; -} - -static inline int perf_evsel__nr_cpus(struct perf_evsel *evsel) -{ - return perf_evsel__cpus(evsel)->nr; -} - static void perf_evsel__reset_stat_priv(struct perf_evsel *evsel) { int i; diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 9e16a5c..4dbf32d 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -8,6 +8,7 @@ #include #include "xyarray.h" #include "symbol.h" +#include "cpumap.h" struct perf_counts_values { union { @@ -114,6 +115,16 @@ struct thread_map; struct perf_evlist; struct record_opts; +static inline struct cpu_map *perf_evsel__cpus(struct perf_evsel *evsel) +{ + return evsel->cpus; +} + +static inline int perf_evsel__nr_cpus(struct perf_evsel *evsel) +{ + return perf_evsel__cpus(evsel)->nr; +} + void perf_counts_values__scale(struct perf_counts_values *count, bool scale, s8 *pscaled);