From patchwork Wed Nov 11 22:18:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 56400 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp75349lbb; Wed, 11 Nov 2015 14:20:53 -0800 (PST) X-Received: by 10.66.118.134 with SMTP id km6mr18348675pab.16.1447280452924; Wed, 11 Nov 2015 14:20:52 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay9si15273155pbd.18.2015.11.11.14.20.46; Wed, 11 Nov 2015 14:20:52 -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 S1753281AbbKKWUp (ORCPT + 28 others); Wed, 11 Nov 2015 17:20:45 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:34217 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753176AbbKKWUA (ORCPT ); Wed, 11 Nov 2015 17:20:00 -0500 Received: by padhx2 with SMTP id hx2so42991974pad.1 for ; Wed, 11 Nov 2015 14:20:00 -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=8sDqeJ0z7q0mx0PfBbU0l7mf1EGw3xk2FWBA5bSHAL8=; b=QDh+hSrb/GU3h7THU0Xt4BdXUgCa+qNYQN2cVswqOQnL+rnsxJCEBY4xIdjJChvUmo NrEbg1eWwhsgTG4VIB4BsGjU9VNv00qsTyW+PntEj7tZPKSW6wwGsMguhCBbp7ehthW+ u/fLDUOqud7Pt2wpgmU213MLaZYT+iRpY6py04oukTGL8YyZ/5ND3ViV7E6jegLmXG05 1OOhIYC4BD4YgehKBa0oxLSrsd6AZnxXAU5QmCJXO5EwktB918TiWBtiWBM5jX//52aN 3KmgUa+VNBUcOZyBQN11iDRh5j2kRpeZDDDxxKOug2G1csWzvQ1Bv1wOuBz7L76tyAXv Vi2A== 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=8sDqeJ0z7q0mx0PfBbU0l7mf1EGw3xk2FWBA5bSHAL8=; b=DKfj5WgxMxAMxJEXYjIMgB0SB4OoTQR762E9XHp9c7Q1O6I2vSs7y7y3L9Cl3YhdB5 C6srgDpxA9OsgNlyykSOLCKLqTbKqnpP/lrOfTxxB8bPt2Y8IUlCnYVnK2APl8/FKIMB QY42Bu27XFyFgQsSU7nsd/69kP3ESXchUuSj1Y/8O5Vj484Iu+CfUVXy+PKDfDAZhXmr xOYW0MEsPuPO7iXBpXnOjiS3ASRlgQtyO9VRfNGzc8UV4mwtFwclbjAU/1r6sfz8/r9c fPn0LPTn7I82sT3ENYGtgKpSvfhznvkF5+x5FyZUpwNWI8pS1qS+pAHFWapXScdcesmY tP4A== X-Gm-Message-State: ALoCoQlLEHkJIzggXxjEgp+InhYp7rVpKyx4o5WJjGLb6RJpLdy70/lyECONz1R/0ziZhEhWCHR5 X-Received: by 10.66.251.193 with SMTP id zm1mr18415362pac.154.1447280400291; Wed, 11 Nov 2015 14:20:00 -0800 (PST) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id h10sm11156697pat.7.2015.11.11.14.19.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Nov 2015 14:19:59 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org, a.p.zijlstra@chello.nl, alexander.shishkin@linux.intel.com, acme@kernel.org, mingo@redhat.com, corbet@lwn.net, nicolas.pitre@linaro.org Cc: adrian.hunter@intel.com, 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@linaro.org Subject: [PATCH V3 25/26] perf tools: making coresight PMU listable Date: Wed, 11 Nov 2015 15:18:15 -0700 Message-Id: <1447280296-19147-26-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447280296-19147-1-git-send-email-mathieu.poirier@linaro.org> References: <1447280296-19147-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 Adding the required mechanic allowing 'perf list pmu' to discover coresight ETM/PTM tracers. Signed-off-by: Mathieu Poirier --- MAINTAINERS | 1 + tools/perf/arch/arm/util/Build | 2 ++ tools/perf/arch/arm/util/pmu.c | 34 ++++++++++++++++++++++++++++++++++ tools/perf/config/Makefile | 17 ++++++++++++----- 4 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 tools/perf/arch/arm/util/pmu.c -- 1.9.1 -- 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/MAINTAINERS b/MAINTAINERS index 747c65316167..c31e68c998d2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1000,6 +1000,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 d22e3d07de3d..66ab0b05549c 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_LIBUNWIND) += unwind-libunwind.o libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o + +libperf-$(CONFIG_AUXTRACE) += pmu.o diff --git a/tools/perf/arch/arm/util/pmu.c b/tools/perf/arch/arm/util/pmu.c new file mode 100644 index 000000000000..af9fb666b44f --- /dev/null +++ b/tools/perf/arch/arm/util/pmu.c @@ -0,0 +1,34 @@ +/* + * Copyright(C) 2015 Linaro Limited. All rights reserved. + * Author: Mathieu Poirier + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#include +#include +#include + +#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/config/Makefile b/tools/perf/config/Makefile index 38a08539f4bf..64bdb82b3337 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile @@ -626,12 +626,19 @@ ifdef LIBBABELTRACE endif ifndef NO_AUXTRACE - ifeq ($(feature-get_cpuid), 0) - msg := $(warning Your gcc lacks the __get_cpuid() builtin, disables support for auxtrace/Intel PT, please install a newer gcc); - NO_AUXTRACE := 1 + ifeq ($(ARCH),x86) + ifeq ($(feature-get_cpuid), 0) + msg := $(warning Your gcc lacks the __get_cpuid() builtin, disables support for auxtrace/Intel PT, please install a newer gcc); + NO_AUXTRACE := 1 + else + $(call detected,CONFIG_AUXTRACE) + CFLAGS += -DHAVE_AUXTRACE_SUPPORT + endif else - $(call detected,CONFIG_AUXTRACE) - CFLAGS += -DHAVE_AUXTRACE_SUPPORT + ifeq ($(ARCH),$(filter $(ARCH), arm arm64)) + $(call detected,CONFIG_AUXTRACE) + CFLAGS += -DHAVE_AUXTRACE_SUPPORT + endif endif endif