From patchwork Thu Jun 11 16:44:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 6589831 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 49E63C0020 for ; Thu, 11 Jun 2015 16:48:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0F31520396 for ; Thu, 11 Jun 2015 16:48:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE30320394 for ; Thu, 11 Jun 2015 16:48:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z35bv-0002CF-4T; Thu, 11 Jun 2015 16:45:47 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z35bp-00022G-02 for linux-arm-kernel@lists.infradead.org; Thu, 11 Jun 2015 16:45:42 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 442FD2A; Thu, 11 Jun 2015 09:45:30 -0700 (PDT) Received: from leverpostej.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C0E413F23A; Thu, 11 Jun 2015 09:45:16 -0700 (PDT) From: Mark Rutland To: linux-arm-kernel@lists.infradead.org, will.deacon@arm.com, Russell King Subject: [PATCHv2 1/7] arm: perf: factor arm_pmu core out to drivers Date: Thu, 11 Jun 2015 17:44:14 +0100 Message-Id: <1434041060-16378-2-git-send-email-mark.rutland@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434041060-16378-1-git-send-email-mark.rutland@arm.com> References: <1434041060-16378-1-git-send-email-mark.rutland@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150611_094541_268077_7A7C772C X-CRM114-Status: GOOD ( 15.28 ) X-Spam-Score: -5.0 (-----) Cc: Mark Rutland , Peter Zijlstra , Greg Kroah-Hartman , Linus Walleij , Arnaldo Carvalho de Melo , Ingo Molnar , Paul Mackerras , drew.richardson@arm.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To enable sharing of the arm_pmu code with arm64, this patch factors it out to drivers/perf/. A new drivers/perf directory is added for performance monitor drivers to live under. MAINTAINERS is updated accordingly, with myself added as a reviewer as suggested by Will Deacon. The wildcard for arch/arm is updated to cover perf_regs.c and perf_callchain.c, which were added previously without a corresponding MAINTAINERS update. Signed-off-by: Mark Rutland Cc: Arnaldo Carvalho de Melo Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: Linus Walleij Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Russell King Cc: Will Deacon --- MAINTAINERS | 6 ++++-- arch/arm/Kconfig | 8 ++------ arch/arm/kernel/Makefile | 3 +-- arch/arm/kernel/perf_event_v6.c | 2 +- arch/arm/kernel/perf_event_v7.c | 2 +- arch/arm/kernel/perf_event_xscale.c | 2 +- arch/arm/mach-ux500/cpu-db8500.c | 2 +- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/perf/Kconfig | 14 ++++++++++++++ drivers/perf/Makefile | 1 + arch/arm/kernel/perf_event.c => drivers/perf/arm_pmu.c | 2 +- arch/arm/include/asm/pmu.h => include/linux/perf/arm_pmu.h | 4 ++-- 13 files changed, 32 insertions(+), 17 deletions(-) create mode 100644 drivers/perf/Kconfig create mode 100644 drivers/perf/Makefile rename arch/arm/kernel/perf_event.c => drivers/perf/arm_pmu.c (99%) rename arch/arm/include/asm/pmu.h => include/linux/perf/arm_pmu.h (98%) diff --git a/MAINTAINERS b/MAINTAINERS index 2e5bbc0..d6dca2c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -798,12 +798,14 @@ F: arch/arm/include/asm/floppy.h ARM PMU PROFILING AND DEBUGGING M: Will Deacon +R: Mark Rutland S: Maintained -F: arch/arm/kernel/perf_event* +F: arch/arm/kernel/perf_* F: arch/arm/oprofile/common.c -F: arch/arm/include/asm/pmu.h F: arch/arm/kernel/hw_breakpoint.c F: arch/arm/include/asm/hw_breakpoint.h +F: drivers/perf/arm_pmu.c +F: include/linux/perf/arm_pmu.h ARM PORT M: Russell King diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 45df48b..74864d9 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1663,12 +1663,8 @@ config HIGHPTE depends on HIGHMEM config HW_PERF_EVENTS - bool "Enable hardware performance counter support for perf events" - depends on PERF_EVENTS - default y - help - Enable hardware performance counter support for perf events. If - disabled, perf events will use software events only. + def_bool y + depends on ARM_PMU config SYS_SUPPORTS_HUGETLBFS def_bool y diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index d274a1f..f4db513 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -70,8 +70,7 @@ obj-$(CONFIG_CPU_PJ4) += pj4-cp0.o obj-$(CONFIG_CPU_PJ4B) += pj4-cp0.o obj-$(CONFIG_IWMMXT) += iwmmxt.o obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o -obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o \ - perf_event_xscale.o perf_event_v6.o \ +obj-$(CONFIG_HW_PERF_EVENTS) += perf_event_xscale.o perf_event_v6.o \ perf_event_v7.o CFLAGS_pj4-cp0.o := -marm AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt diff --git a/arch/arm/kernel/perf_event_v6.c b/arch/arm/kernel/perf_event_v6.c index 09f83e4..09413e7 100644 --- a/arch/arm/kernel/perf_event_v6.c +++ b/arch/arm/kernel/perf_event_v6.c @@ -34,9 +34,9 @@ #include #include -#include #include +#include #include enum armv6_perf_types { diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c index f9b37f8..126dc67 100644 --- a/arch/arm/kernel/perf_event_v7.c +++ b/arch/arm/kernel/perf_event_v7.c @@ -21,11 +21,11 @@ #include #include #include -#include #include #include "../vfp/vfpinstr.h" #include +#include #include /* diff --git a/arch/arm/kernel/perf_event_xscale.c b/arch/arm/kernel/perf_event_xscale.c index 304d056..aa0499e 100644 --- a/arch/arm/kernel/perf_event_xscale.c +++ b/arch/arm/kernel/perf_event_xscale.c @@ -16,9 +16,9 @@ #include #include -#include #include +#include #include enum xscale_perf_types { diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 6f63954..281d4cd 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -20,10 +20,10 @@ #include #include #include +#include #include #include -#include #include #include "setup.h" diff --git a/drivers/Kconfig b/drivers/Kconfig index c0cc96b..feffb33 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -176,6 +176,8 @@ source "drivers/powercap/Kconfig" source "drivers/mcb/Kconfig" +source "drivers/perf/Kconfig" + source "drivers/ras/Kconfig" source "drivers/thunderbolt/Kconfig" diff --git a/drivers/Makefile b/drivers/Makefile index 46d2554..fbdfe07 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -161,6 +161,7 @@ obj-$(CONFIG_NTB) += ntb/ obj-$(CONFIG_FMC) += fmc/ obj-$(CONFIG_POWERCAP) += powercap/ obj-$(CONFIG_MCB) += mcb/ +obj-$(CONFIG_PERF_EVENTS) += perf/ obj-$(CONFIG_RAS) += ras/ obj-$(CONFIG_THUNDERBOLT) += thunderbolt/ obj-$(CONFIG_CORESIGHT) += hwtracing/coresight/ diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig new file mode 100644 index 0000000..f556b92ae --- /dev/null +++ b/drivers/perf/Kconfig @@ -0,0 +1,14 @@ +# +# Performance Monitor Drivers +# + +menu "Performance monitor support" + +config ARM_PMU + depends on PERF_EVENTS && ARM + bool "ARM PMU framework" + default y + help + Say y if you want to use performance monitors on ARM systems. + +endmenu diff --git a/drivers/perf/Makefile b/drivers/perf/Makefile new file mode 100644 index 0000000..acd2397 --- /dev/null +++ b/drivers/perf/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_ARM_PMU) += arm_pmu.o diff --git a/arch/arm/kernel/perf_event.c b/drivers/perf/arm_pmu.c similarity index 99% rename from arch/arm/kernel/perf_event.c rename to drivers/perf/arm_pmu.c index 357f57e..daf0a0d 100644 --- a/arch/arm/kernel/perf_event.c +++ b/drivers/perf/arm_pmu.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -24,7 +25,6 @@ #include #include -#include static int armpmu_map_cache_event(const unsigned (*cache_map) diff --git a/arch/arm/include/asm/pmu.h b/include/linux/perf/arm_pmu.h similarity index 98% rename from arch/arm/include/asm/pmu.h rename to include/linux/perf/arm_pmu.h index 3fc87df..bfa673b 100644 --- a/arch/arm/include/asm/pmu.h +++ b/include/linux/perf/arm_pmu.h @@ -30,7 +30,7 @@ struct arm_pmu_platdata { irq_handler_t pmu_handler); }; -#ifdef CONFIG_HW_PERF_EVENTS +#ifdef CONFIG_ARM_PMU /* * The ARMv7 CPU PMU supports up to 32 event counters. @@ -149,6 +149,6 @@ int arm_pmu_device_probe(struct platform_device *pdev, const struct of_device_id *of_table, const struct pmu_probe_info *probe_table); -#endif /* CONFIG_HW_PERF_EVENTS */ +#endif /* CONFIG_ARM_PMU */ #endif /* __ARM_PMU_H__ */