Skip to content

Commit

Permalink
arm: perf: factor arm_pmu core out to drivers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Rutland authored and wildea01 committed Jul 31, 2015
1 parent bc1e3c4 commit fa8ad78
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 17 deletions.
6 changes: 4 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -799,11 +799,13 @@ F: arch/arm/include/asm/floppy.h
ARM PMU PROFILING AND DEBUGGING
M: Will Deacon <will.deacon@arm.com>
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: arch/arm/include/asm/perf_event.h
F: drivers/perf/arm_pmu.c
F: include/linux/perf/arm_pmu.h

ARM PORT
M: Russell King <linux@arm.linux.org.uk>
Expand Down
8 changes: 2 additions & 6 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1701,12 +1701,8 @@ config HIGHPTE
user-space 2nd level page tables to reside in high memory.

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
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,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
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/kernel/perf_event_v6.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@

#include <asm/cputype.h>
#include <asm/irq_regs.h>
#include <asm/pmu.h>

#include <linux/of.h>
#include <linux/perf/arm_pmu.h>
#include <linux/platform_device.h>

enum armv6_perf_types {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/kernel/perf_event_v7.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
#include <asm/cp15.h>
#include <asm/cputype.h>
#include <asm/irq_regs.h>
#include <asm/pmu.h>
#include <asm/vfp.h>
#include "../vfp/vfpinstr.h"

#include <linux/of.h>
#include <linux/perf/arm_pmu.h>
#include <linux/platform_device.h>

/*
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/kernel/perf_event_xscale.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

#include <asm/cputype.h>
#include <asm/irq_regs.h>
#include <asm/pmu.h>

#include <linux/of.h>
#include <linux/perf/arm_pmu.h>
#include <linux/platform_device.h>

enum xscale_perf_types {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-ux500/cpu-db8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
#include <linux/mfd/dbx500-prcmu.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/perf/arm_pmu.h>
#include <linux/regulator/machine.h>
#include <linux/random.h>

#include <asm/pmu.h>
#include <asm/mach/map.h>

#include "setup.h"
Expand Down
2 changes: 2 additions & 0 deletions drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ source "drivers/powercap/Kconfig"

source "drivers/mcb/Kconfig"

source "drivers/perf/Kconfig"

source "drivers/ras/Kconfig"

source "drivers/thunderbolt/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
15 changes: 15 additions & 0 deletions drivers/perf/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# 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 CPU performance monitors on ARM-based
systems.

endmenu
1 change: 1 addition & 0 deletions drivers/perf/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj-$(CONFIG_ARM_PMU) += arm_pmu.o
2 changes: 1 addition & 1 deletion arch/arm/kernel/perf_event.c → drivers/perf/arm_pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/export.h>
#include <linux/kernel.h>
#include <linux/of_device.h>
#include <linux/perf/arm_pmu.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
Expand All @@ -24,7 +25,6 @@

#include <asm/cputype.h>
#include <asm/irq_regs.h>
#include <asm/pmu.h>

static int
armpmu_map_cache_event(const unsigned (*cache_map)
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/include/asm/pmu.h → include/linux/perf/arm_pmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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__ */

0 comments on commit fa8ad78

Please sign in to comment.