Skip to content

Commit fa8ad78

Browse files
mrutland-armwildea01
authored andcommitted
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>
1 parent bc1e3c4 commit fa8ad78

13 files changed

Lines changed: 33 additions & 17 deletions

File tree

‎MAINTAINERS‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -799,11 +799,13 @@ F: arch/arm/include/asm/floppy.h
799799
ARM PMU PROFILING AND DEBUGGING
800800
M: Will Deacon <will.deacon@arm.com>
801801
S: Maintained
802-
F: arch/arm/kernel/perf_event*
802+
F: arch/arm/kernel/perf_*
803803
F: arch/arm/oprofile/common.c
804-
F: arch/arm/include/asm/pmu.h
805804
F: arch/arm/kernel/hw_breakpoint.c
806805
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
807809

808810
ARM PORT
809811
M: Russell King <linux@arm.linux.org.uk>

‎arch/arm/Kconfig‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,12 +1701,8 @@ config HIGHPTE
17011701
user-space 2nd level page tables to reside in high memory.
17021702

17031703
config HW_PERF_EVENTS
1704-
bool "Enable hardware performance counter support for perf events"
1705-
depends on PERF_EVENTS
1706-
default y
1707-
help
1708-
Enable hardware performance counter support for perf events. If
1709-
disabled, perf events will use software events only.
1704+
def_bool y
1705+
depends on ARM_PMU
17101706

17111707
config SYS_SUPPORTS_HUGETLBFS
17121708
def_bool y

‎arch/arm/kernel/Makefile‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ obj-$(CONFIG_CPU_PJ4) += pj4-cp0.o
7171
obj-$(CONFIG_CPU_PJ4B) += pj4-cp0.o
7272
obj-$(CONFIG_IWMMXT) += iwmmxt.o
7373
obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o
74-
obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o \
75-
perf_event_xscale.o perf_event_v6.o \
74+
obj-$(CONFIG_HW_PERF_EVENTS) += perf_event_xscale.o perf_event_v6.o \
7675
perf_event_v7.o
7776
CFLAGS_pj4-cp0.o := -marm
7877
AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt

‎arch/arm/kernel/perf_event_v6.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434

3535
#include <asm/cputype.h>
3636
#include <asm/irq_regs.h>
37-
#include <asm/pmu.h>
3837

3938
#include <linux/of.h>
39+
#include <linux/perf/arm_pmu.h>
4040
#include <linux/platform_device.h>
4141

4242
enum armv6_perf_types {

‎arch/arm/kernel/perf_event_v7.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
#include <asm/cp15.h>
2222
#include <asm/cputype.h>
2323
#include <asm/irq_regs.h>
24-
#include <asm/pmu.h>
2524
#include <asm/vfp.h>
2625
#include "../vfp/vfpinstr.h"
2726

2827
#include <linux/of.h>
28+
#include <linux/perf/arm_pmu.h>
2929
#include <linux/platform_device.h>
3030

3131
/*

‎arch/arm/kernel/perf_event_xscale.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
#include <asm/cputype.h>
1818
#include <asm/irq_regs.h>
19-
#include <asm/pmu.h>
2019

2120
#include <linux/of.h>
21+
#include <linux/perf/arm_pmu.h>
2222
#include <linux/platform_device.h>
2323

2424
enum xscale_perf_types {

‎arch/arm/mach-ux500/cpu-db8500.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
#include <linux/mfd/dbx500-prcmu.h>
2121
#include <linux/of.h>
2222
#include <linux/of_platform.h>
23+
#include <linux/perf/arm_pmu.h>
2324
#include <linux/regulator/machine.h>
2425
#include <linux/random.h>
2526

26-
#include <asm/pmu.h>
2727
#include <asm/mach/map.h>
2828

2929
#include "setup.h"

‎drivers/Kconfig‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ source "drivers/powercap/Kconfig"
176176

177177
source "drivers/mcb/Kconfig"
178178

179+
source "drivers/perf/Kconfig"
180+
179181
source "drivers/ras/Kconfig"
180182

181183
source "drivers/thunderbolt/Kconfig"

‎drivers/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ obj-$(CONFIG_NTB) += ntb/
161161
obj-$(CONFIG_FMC) += fmc/
162162
obj-$(CONFIG_POWERCAP) += powercap/
163163
obj-$(CONFIG_MCB) += mcb/
164+
obj-$(CONFIG_PERF_EVENTS) += perf/
164165
obj-$(CONFIG_RAS) += ras/
165166
obj-$(CONFIG_THUNDERBOLT) += thunderbolt/
166167
obj-$(CONFIG_CORESIGHT) += hwtracing/coresight/

‎drivers/perf/Kconfig‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

0 commit comments

Comments
 (0)