From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753810AbbE0Qwi (ORCPT ); Wed, 27 May 2015 12:52:38 -0400 Received: from terminus.zytor.com ([198.137.202.10]:39139 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753796AbbE0Qwe (ORCPT ); Wed, 27 May 2015 12:52:34 -0400 Date: Wed, 27 May 2015 09:52:22 -0700 From: tip-bot for Adrian Hunter Message-ID: Cc: jolsa@redhat.com, mingo@kernel.org, tglx@linutronix.de, acme@redhat.com, linux-kernel@vger.kernel.org, adrian.hunter@intel.com, hpa@zytor.com Reply-To: mingo@kernel.org, tglx@linutronix.de, jolsa@redhat.com, acme@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com, adrian.hunter@intel.com In-Reply-To: <1432295653-13989-2-git-send-email-adrian.hunter@intel.com> References: <1432295653-13989-2-git-send-email-adrian.hunter@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tools: Disallow PMU events intel_pt and intel_bts until there is support Git-Commit-ID: 9b5d1c29556989aa9dc1240566e78806ddefd160 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: 9b5d1c29556989aa9dc1240566e78806ddefd160 Gitweb: http://git.kernel.org/tip/9b5d1c29556989aa9dc1240566e78806ddefd160 Author: Adrian Hunter AuthorDate: Fri, 22 May 2015 14:53:58 +0300 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 27 May 2015 12:21:45 -0300 perf tools: Disallow PMU events intel_pt and intel_bts until there is support Disallow PMU events intel_pt and intel_bts until the tools support them. By default any PMU is selectable as an event but until the tools have intel_pt and intel_bts support using them would result in no data being recorded without any indication as to why. Before the change: $ perf record -e intel_bts// sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.008 MB perf.data ] $ perf report --stdio Error: The perf.data file has no samples! After the change: $ perf record -e intel_bts// sleep 1 invalid or unsupported event: 'intel_bts//' Run 'perf list' for a list of valid events Reported-by: Arnaldo Carvalho de Melo Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: http://lkml.kernel.org/r/1432295653-13989-2-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/pmu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index 244c66f..5d3ab7c 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -442,6 +442,10 @@ static struct perf_pmu *pmu_lookup(const char *name) LIST_HEAD(aliases); __u32 type; + /* No support for intel_bts or intel_pt so disallow them */ + if (!strcmp(name, "intel_bts") || !strcmp(name, "intel_pt")) + return NULL; + /* * The pmu data we store & need consists of the pmu * type value and format definitions. Load both right