From patchwork Thu Dec 3 21:05:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 57677 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp166783lbb; Thu, 3 Dec 2015 13:06:57 -0800 (PST) X-Received: by 10.98.9.4 with SMTP id e4mr16171862pfd.18.1449176817252; Thu, 03 Dec 2015 13:06:57 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y17si14168013pfi.165.2015.12.03.13.06.56; Thu, 03 Dec 2015 13:06:57 -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 S1754587AbbLCVGt (ORCPT + 28 others); Thu, 3 Dec 2015 16:06:49 -0500 Received: from mail-io0-f170.google.com ([209.85.223.170]:36829 "EHLO mail-io0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754517AbbLCVGH (ORCPT ); Thu, 3 Dec 2015 16:06:07 -0500 Received: by iofh3 with SMTP id h3so95286860iof.3 for ; Thu, 03 Dec 2015 13:06:07 -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=Ir5ixKkQ1ShE6i8eLLG5vodHHaB7SC90+bubhwAIyP0=; b=jGnmMyYH9cuvFzIWtm7TRC/PfiNf3fQe0to6vBU+g3exD3oRXdTS4/1dV49hIAmw8Q h+6mttrl4lPesg3u6dS8hVmYGOOIsRS4HPemdl+MfpOJDl7VG3mORvnAuDaSbEEjdP69 TPPgF3S81EXvzW+beWL9+UffzEnwn27MLzGn5TUVhp6nXqoI6LiSTWQHyDHpdx6zf07y p0GKnKIv8AjkFfwuD4OxspxUOqSIVxtmYvdBeXxrH7QlR69QIfSv5WtFOQJBW6pdjyVf OEeByctWVmwU+SgHi99Y8ZL2XyhwHfsqLNt1Gf0ffeE0kEG2okHK9opdhSd6Zalxs4nJ iKwQ== 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=Ir5ixKkQ1ShE6i8eLLG5vodHHaB7SC90+bubhwAIyP0=; b=XRnIInDsGYHNV2+BVeDzvZlWx7KIdiDDArNvKr4VlFm/8II+pjeo9649iUHUGJZnZY fqJaQHOa8uchZU446Mv0mWrJtNUuPULOTXy/3BnBfjK9ItP6oJCPx8AMhNwnh8Zf7M7l I1SKBft0mcv8MxeXUo9tcB7TpvYBUGGkE6omA9MJHwFpWJyyyIau+fIopIk6h1cLi4gE P5/iK9QGqTmalA2L9X5pRwXjLz7A8dSfWT1ZcgOouaexMJKgB2KTs3XVqIRDCQapK/Qt RnZZwI8a4Pwj9QdcdnAo/JiRdC/Ow1VDZJBdBWVrh4XCK/q86xneD6XkJvwqqkl8HpZ6 GqjA== X-Gm-Message-State: ALoCoQk665z4oUEawfmK3Zabxw7STSA1Mmcj5P5z7qv3BQh9qK8tbNIHd8SPeHMHSIVGB555t4gG X-Received: by 10.107.134.231 with SMTP id q100mr11904211ioi.88.1449176766837; Thu, 03 Dec 2015 13:06:06 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [184.64.168.246]) by smtp.gmail.com with ESMTPSA id d81sm3615433ioj.12.2015.12.03.13.06.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Dec 2015 13:06:06 -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, 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 V6 25/26] perf tools: making coresight PMU listable Date: Thu, 3 Dec 2015 14:05:01 -0700 Message-Id: <1449176702-13213-26-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1449176702-13213-1-git-send-email-mathieu.poirier@linaro.org> References: <1449176702-13213-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. Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo 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 -- 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/MAINTAINERS b/MAINTAINERS index e9caa4b28828..571a1dbe6bd1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1007,6 +1007,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 de89ec574361..905faabff8b1 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile @@ -647,12 +647,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