From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758262AbcIWF1D (ORCPT ); Fri, 23 Sep 2016 01:27:03 -0400 Received: from terminus.zytor.com ([198.137.202.10]:48848 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757892AbcIWF04 (ORCPT ); Fri, 23 Sep 2016 01:26:56 -0400 Date: Thu, 22 Sep 2016 22:26:24 -0700 From: tip-bot for Mathieu Poirier Message-ID: Cc: alexander.shishkin@linux.intel.com, peterz@infradead.org, hpa@zytor.com, tglx@linutronix.de, acme@redhat.com, adrian.hunter@intel.com, mathieu.poirier@linaro.org, linux-kernel@vger.kernel.org, mingo@kernel.org, jolsa@kernel.org Reply-To: alexander.shishkin@linux.intel.com, peterz@infradead.org, hpa@zytor.com, tglx@linutronix.de, acme@redhat.com, adrian.hunter@intel.com, mathieu.poirier@linaro.org, linux-kernel@vger.kernel.org, mingo@kernel.org, jolsa@kernel.org In-Reply-To: <1474041004-13956-3-git-send-email-mathieu.poirier@linaro.org> References: <1474041004-13956-3-git-send-email-mathieu.poirier@linaro.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tools: Make coresight PMU listable Git-Commit-ID: 7e21b0d579a481e2e7064c6383d5873d841777a8 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: 7e21b0d579a481e2e7064c6383d5873d841777a8 Gitweb: http://git.kernel.org/tip/7e21b0d579a481e2e7064c6383d5873d841777a8 Author: Mathieu Poirier AuthorDate: Fri, 16 Sep 2016 09:49:59 -0600 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 22 Sep 2016 12:19:35 -0300 perf tools: Make coresight PMU listable Adding the required mechanic allowing 'perf list pmu' to discover coresight ETM/PTM tracers. Signed-off-by: Mathieu Poirier Acked-by: Adrian Hunter Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Peter Zijlstra Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1474041004-13956-3-git-send-email-mathieu.poirier@linaro.org Signed-off-by: Arnaldo Carvalho de Melo --- MAINTAINERS | 1 + tools/perf/arch/arm/util/Build | 2 ++ .../perf/arch/arm/util/pmu.c | 26 ++++++++++++---------- tools/perf/arch/arm64/util/Build | 2 ++ 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index db814a8..7407fe7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1123,6 +1123,7 @@ F: drivers/hwtracing/coresight/* F: Documentation/trace/coresight.txt F: Documentation/devicetree/bindings/arm/coresight.txt F: Documentation/ABI/testing/sysfs-bus-coresight-devices-* +F: tools/perf/arch/arm/util/pmu.c ARM/CORGI MACHINE SUPPORT M: Richard Purdie diff --git a/tools/perf/arch/arm/util/Build b/tools/perf/arch/arm/util/Build index f98da17..4093fd1 100644 --- a/tools/perf/arch/arm/util/Build +++ b/tools/perf/arch/arm/util/Build @@ -2,3 +2,5 @@ libperf-$(CONFIG_DWARF) += dwarf-regs.o libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o + +libperf-$(CONFIG_AUXTRACE) += pmu.o diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.h b/tools/perf/arch/arm/util/pmu.c similarity index 66% copy from drivers/hwtracing/coresight/coresight-etm-perf.h copy to tools/perf/arch/arm/util/pmu.c index 87f5a13..af9fb66 100644 --- a/drivers/hwtracing/coresight/coresight-etm-perf.h +++ b/tools/perf/arch/arm/util/pmu.c @@ -15,18 +15,20 @@ * this program. If not, see . */ -#ifndef _CORESIGHT_ETM_PERF_H -#define _CORESIGHT_ETM_PERF_H +#include +#include +#include -struct coresight_device; - -#ifdef CONFIG_CORESIGHT -int etm_perf_symlink(struct coresight_device *csdev, bool link); - -#else -static inline int etm_perf_symlink(struct coresight_device *csdev, bool link) -{ return -EINVAL; } - -#endif /* CONFIG_CORESIGHT */ +#include "../../util/pmu.h" +struct perf_event_attr +*perf_pmu__get_default_config(struct perf_pmu *pmu __maybe_unused) +{ +#ifdef HAVE_AUXTRACE_SUPPORT + if (!strcmp(pmu->name, CORESIGHT_ETM_PMU_NAME)) { + /* add ETM default config here */ + pmu->selectable = true; + } #endif + return NULL; +} diff --git a/tools/perf/arch/arm64/util/Build b/tools/perf/arch/arm64/util/Build index 02f41db..3876dd0 100644 --- a/tools/perf/arch/arm64/util/Build +++ b/tools/perf/arch/arm64/util/Build @@ -1,2 +1,4 @@ libperf-$(CONFIG_DWARF) += dwarf-regs.o libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o + +libperf-$(CONFIG_AUXTRACE) += ../../arm/util/pmu.o