diff options
author | Mark Rutland <mark.rutland@arm.com> | 2015-07-06 07:23:53 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2015-07-31 10:01:14 -0400 |
commit | fa8ad7889d83bcf0a6cdbf6d3622f3ec019cde14 (patch) | |
tree | 424ea935a8d5f40d099359351cf5074f50b8852f | |
parent | bc1e3c4687df62a1f2ba1b6be11efbeb76145366 (diff) |
arm: perf: factor arm_pmu core out to drivers
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. Files added previously without a
corresponsing MAINTAINERS update (perf_regs.c, perf_callchain.c, and
perf_event.h) are also added.
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
[will: augmented Kconfig help slightly]
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | MAINTAINERS | 6 | ||||
-rw-r--r-- | arch/arm/Kconfig | 8 | ||||
-rw-r--r-- | arch/arm/kernel/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/kernel/perf_event_v6.c | 2 | ||||
-rw-r--r-- | arch/arm/kernel/perf_event_v7.c | 2 | ||||
-rw-r--r-- | arch/arm/kernel/perf_event_xscale.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-ux500/cpu-db8500.c | 2 | ||||
-rw-r--r-- | drivers/Kconfig | 2 | ||||
-rw-r--r-- | drivers/Makefile | 1 | ||||
-rw-r--r-- | drivers/perf/Kconfig | 15 | ||||
-rw-r--r-- | drivers/perf/Makefile | 1 | ||||
-rw-r--r-- | drivers/perf/arm_pmu.c (renamed from arch/arm/kernel/perf_event.c) | 2 | ||||
-rw-r--r-- | include/linux/perf/arm_pmu.h (renamed from arch/arm/include/asm/pmu.h) | 4 |
13 files changed, 33 insertions, 17 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index fd6078443083..485c92ced47d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -799,11 +799,13 @@ F: arch/arm/include/asm/floppy.h | |||
799 | ARM PMU PROFILING AND DEBUGGING | 799 | ARM PMU PROFILING AND DEBUGGING |
800 | M: Will Deacon <will.deacon@arm.com> | 800 | M: Will Deacon <will.deacon@arm.com> |
801 | S: Maintained | 801 | S: Maintained |
802 | F: arch/arm/kernel/perf_event* | 802 | F: arch/arm/kernel/perf_* |
803 | F: arch/arm/oprofile/common.c | 803 | F: arch/arm/oprofile/common.c |
804 | F: arch/arm/include/asm/pmu.h | ||
805 | F: arch/arm/kernel/hw_breakpoint.c | 804 | F: arch/arm/kernel/hw_breakpoint.c |
806 | F: arch/arm/include/asm/hw_breakpoint.h | 805 | F: arch/arm/include/asm/hw_breakpoint.h |
806 | F: arch/arm/include/asm/perf_event.h | ||
807 | F: drivers/perf/arm_pmu.c | ||
808 | F: include/linux/perf/arm_pmu.h | ||
807 | 809 | ||
808 | ARM PORT | 810 | ARM PORT |
809 | M: Russell King <linux@arm.linux.org.uk> | 811 | M: Russell King <linux@arm.linux.org.uk> |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 1c5021002fe4..4f7bc3d4b186 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -1701,12 +1701,8 @@ config HIGHPTE | |||
1701 | user-space 2nd level page tables to reside in high memory. | 1701 | user-space 2nd level page tables to reside in high memory. |
1702 | 1702 | ||
1703 | config HW_PERF_EVENTS | 1703 | config HW_PERF_EVENTS |
1704 | bool "Enable hardware performance counter support for perf events" | 1704 | def_bool y |
1705 | depends on PERF_EVENTS | 1705 | depends on ARM_PMU |
1706 | default y | ||
1707 | help | ||
1708 | Enable hardware performance counter support for perf events. If | ||
1709 | disabled, perf events will use software events only. | ||
1710 | 1706 | ||
1711 | config SYS_SUPPORTS_HUGETLBFS | 1707 | config SYS_SUPPORTS_HUGETLBFS |
1712 | def_bool y | 1708 | def_bool y |
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index e69f7a19735d..fcb25c1c5c21 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile | |||
@@ -71,8 +71,7 @@ obj-$(CONFIG_CPU_PJ4) += pj4-cp0.o | |||
71 | obj-$(CONFIG_CPU_PJ4B) += pj4-cp0.o | 71 | obj-$(CONFIG_CPU_PJ4B) += pj4-cp0.o |
72 | obj-$(CONFIG_IWMMXT) += iwmmxt.o | 72 | obj-$(CONFIG_IWMMXT) += iwmmxt.o |
73 | obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o | 73 | obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o |
74 | obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o \ | 74 | obj-$(CONFIG_HW_PERF_EVENTS) += perf_event_xscale.o perf_event_v6.o \ |
75 | perf_event_xscale.o perf_event_v6.o \ | ||
76 | perf_event_v7.o | 75 | perf_event_v7.o |
77 | CFLAGS_pj4-cp0.o := -marm | 76 | CFLAGS_pj4-cp0.o := -marm |
78 | AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt | 77 | 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 09f83e414a72..09413e7b49aa 100644 --- a/arch/arm/kernel/perf_event_v6.c +++ b/arch/arm/kernel/perf_event_v6.c | |||
@@ -34,9 +34,9 @@ | |||
34 | 34 | ||
35 | #include <asm/cputype.h> | 35 | #include <asm/cputype.h> |
36 | #include <asm/irq_regs.h> | 36 | #include <asm/irq_regs.h> |
37 | #include <asm/pmu.h> | ||
38 | 37 | ||
39 | #include <linux/of.h> | 38 | #include <linux/of.h> |
39 | #include <linux/perf/arm_pmu.h> | ||
40 | #include <linux/platform_device.h> | 40 | #include <linux/platform_device.h> |
41 | 41 | ||
42 | enum armv6_perf_types { | 42 | enum armv6_perf_types { |
diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c index f9b37f876e20..126dc679b230 100644 --- a/arch/arm/kernel/perf_event_v7.c +++ b/arch/arm/kernel/perf_event_v7.c | |||
@@ -21,11 +21,11 @@ | |||
21 | #include <asm/cp15.h> | 21 | #include <asm/cp15.h> |
22 | #include <asm/cputype.h> | 22 | #include <asm/cputype.h> |
23 | #include <asm/irq_regs.h> | 23 | #include <asm/irq_regs.h> |
24 | #include <asm/pmu.h> | ||
25 | #include <asm/vfp.h> | 24 | #include <asm/vfp.h> |
26 | #include "../vfp/vfpinstr.h" | 25 | #include "../vfp/vfpinstr.h" |
27 | 26 | ||
28 | #include <linux/of.h> | 27 | #include <linux/of.h> |
28 | #include <linux/perf/arm_pmu.h> | ||
29 | #include <linux/platform_device.h> | 29 | #include <linux/platform_device.h> |
30 | 30 | ||
31 | /* | 31 | /* |
diff --git a/arch/arm/kernel/perf_event_xscale.c b/arch/arm/kernel/perf_event_xscale.c index 304d056d5b25..aa0499e2eef7 100644 --- a/arch/arm/kernel/perf_event_xscale.c +++ b/arch/arm/kernel/perf_event_xscale.c | |||
@@ -16,9 +16,9 @@ | |||
16 | 16 | ||
17 | #include <asm/cputype.h> | 17 | #include <asm/cputype.h> |
18 | #include <asm/irq_regs.h> | 18 | #include <asm/irq_regs.h> |
19 | #include <asm/pmu.h> | ||
20 | 19 | ||
21 | #include <linux/of.h> | 20 | #include <linux/of.h> |
21 | #include <linux/perf/arm_pmu.h> | ||
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | 23 | ||
24 | enum xscale_perf_types { | 24 | enum xscale_perf_types { |
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 16913800bbf9..5578dc1ab52b 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c | |||
@@ -20,10 +20,10 @@ | |||
20 | #include <linux/mfd/dbx500-prcmu.h> | 20 | #include <linux/mfd/dbx500-prcmu.h> |
21 | #include <linux/of.h> | 21 | #include <linux/of.h> |
22 | #include <linux/of_platform.h> | 22 | #include <linux/of_platform.h> |
23 | #include <linux/perf/arm_pmu.h> | ||
23 | #include <linux/regulator/machine.h> | 24 | #include <linux/regulator/machine.h> |
24 | #include <linux/random.h> | 25 | #include <linux/random.h> |
25 | 26 | ||
26 | #include <asm/pmu.h> | ||
27 | #include <asm/mach/map.h> | 27 | #include <asm/mach/map.h> |
28 | 28 | ||
29 | #include "setup.h" | 29 | #include "setup.h" |
diff --git a/drivers/Kconfig b/drivers/Kconfig index 6e973b8e3a3b..3497485f5eab 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig | |||
@@ -176,6 +176,8 @@ source "drivers/powercap/Kconfig" | |||
176 | 176 | ||
177 | source "drivers/mcb/Kconfig" | 177 | source "drivers/mcb/Kconfig" |
178 | 178 | ||
179 | source "drivers/perf/Kconfig" | ||
180 | |||
179 | source "drivers/ras/Kconfig" | 181 | source "drivers/ras/Kconfig" |
180 | 182 | ||
181 | source "drivers/thunderbolt/Kconfig" | 183 | source "drivers/thunderbolt/Kconfig" |
diff --git a/drivers/Makefile b/drivers/Makefile index b64b49f6e01b..f245f2291b8a 100644 --- a/drivers/Makefile +++ b/drivers/Makefile | |||
@@ -161,6 +161,7 @@ obj-$(CONFIG_NTB) += ntb/ | |||
161 | obj-$(CONFIG_FMC) += fmc/ | 161 | obj-$(CONFIG_FMC) += fmc/ |
162 | obj-$(CONFIG_POWERCAP) += powercap/ | 162 | obj-$(CONFIG_POWERCAP) += powercap/ |
163 | obj-$(CONFIG_MCB) += mcb/ | 163 | obj-$(CONFIG_MCB) += mcb/ |
164 | obj-$(CONFIG_PERF_EVENTS) += perf/ | ||
164 | obj-$(CONFIG_RAS) += ras/ | 165 | obj-$(CONFIG_RAS) += ras/ |
165 | obj-$(CONFIG_THUNDERBOLT) += thunderbolt/ | 166 | obj-$(CONFIG_THUNDERBOLT) += thunderbolt/ |
166 | obj-$(CONFIG_CORESIGHT) += hwtracing/coresight/ | 167 | obj-$(CONFIG_CORESIGHT) += hwtracing/coresight/ |
diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig new file mode 100644 index 000000000000..d9de36ee165d --- /dev/null +++ b/drivers/perf/Kconfig | |||
@@ -0,0 +1,15 @@ | |||
1 | # | ||
2 | # Performance Monitor Drivers | ||
3 | # | ||
4 | |||
5 | menu "Performance monitor support" | ||
6 | |||
7 | config ARM_PMU | ||
8 | depends on PERF_EVENTS && ARM | ||
9 | bool "ARM PMU framework" | ||
10 | default y | ||
11 | help | ||
12 | Say y if you want to use CPU performance monitors on ARM-based | ||
13 | systems. | ||
14 | |||
15 | endmenu | ||
diff --git a/drivers/perf/Makefile b/drivers/perf/Makefile new file mode 100644 index 000000000000..acd2397ded94 --- /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 index 1cb40651d783..2365a32a595e 100644 --- a/arch/arm/kernel/perf_event.c +++ b/drivers/perf/arm_pmu.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/export.h> | 16 | #include <linux/export.h> |
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/of_device.h> | 18 | #include <linux/of_device.h> |
19 | #include <linux/perf/arm_pmu.h> | ||
19 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
20 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
21 | #include <linux/spinlock.h> | 22 | #include <linux/spinlock.h> |
@@ -24,7 +25,6 @@ | |||
24 | 25 | ||
25 | #include <asm/cputype.h> | 26 | #include <asm/cputype.h> |
26 | #include <asm/irq_regs.h> | 27 | #include <asm/irq_regs.h> |
27 | #include <asm/pmu.h> | ||
28 | 28 | ||
29 | static int | 29 | static int |
30 | armpmu_map_cache_event(const unsigned (*cache_map) | 30 | armpmu_map_cache_event(const unsigned (*cache_map) |
diff --git a/arch/arm/include/asm/pmu.h b/include/linux/perf/arm_pmu.h index 3fc87dfd77e6..bfa673bb822d 100644 --- a/arch/arm/include/asm/pmu.h +++ b/include/linux/perf/arm_pmu.h | |||
@@ -30,7 +30,7 @@ struct arm_pmu_platdata { | |||
30 | irq_handler_t pmu_handler); | 30 | irq_handler_t pmu_handler); |
31 | }; | 31 | }; |
32 | 32 | ||
33 | #ifdef CONFIG_HW_PERF_EVENTS | 33 | #ifdef CONFIG_ARM_PMU |
34 | 34 | ||
35 | /* | 35 | /* |
36 | * The ARMv7 CPU PMU supports up to 32 event counters. | 36 | * The ARMv7 CPU PMU supports up to 32 event counters. |
@@ -149,6 +149,6 @@ int arm_pmu_device_probe(struct platform_device *pdev, | |||
149 | const struct of_device_id *of_table, | 149 | const struct of_device_id *of_table, |
150 | const struct pmu_probe_info *probe_table); | 150 | const struct pmu_probe_info *probe_table); |
151 | 151 | ||
152 | #endif /* CONFIG_HW_PERF_EVENTS */ | 152 | #endif /* CONFIG_ARM_PMU */ |
153 | 153 | ||
154 | #endif /* __ARM_PMU_H__ */ | 154 | #endif /* __ARM_PMU_H__ */ |