Skip to content

Commit

Permalink
xtensa: implement counting and sampling perf events
Browse files Browse the repository at this point in the history
Xtensa Performance Monitor Module has up to 8 32 bit wide performance
counters. Each counter may be enabled independently and can count any
single type of hardware performance events. Event counting may be enabled
and disabled globally (per PMM).
Each counter has status register with bits indicating if the counter has
been overflown and may be programmed to raise profiling IRQ on overflow.
This IRQ is used to rewind counters and allow for counting more than 2^32
samples for counting events and to report samples for sampling events.

For more details see Tensilica Debug User's Guide, chapter 8
"Performance monitor module".

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
  • Loading branch information
Max Filippov committed Aug 17, 2015
1 parent af885de commit 9bd46da
Show file tree
Hide file tree
Showing 3 changed files with 461 additions and 0 deletions.
10 changes: 10 additions & 0 deletions arch/xtensa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ config XTENSA_VARIANT_MMU
Build a Conventional Kernel with full MMU support,
ie: it supports a TLB with auto-loading, page protection.

config XTENSA_VARIANT_HAVE_PERF_EVENTS
bool "Core variant has Performance Monitor Module"
depends on XTENSA_VARIANT_CUSTOM
default n
help
Enable if core variant has Performance Monitor Module with
External Registers Interface.

If unsure, say N.

config XTENSA_UNALIGNED_USER
bool "Unaligned memory access in use space"
help
Expand Down
1 change: 1 addition & 0 deletions arch/xtensa/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ obj-$(CONFIG_PCI) += pci.o
obj-$(CONFIG_MODULES) += xtensa_ksyms.o module.o
obj-$(CONFIG_FUNCTION_TRACER) += mcount.o
obj-$(CONFIG_SMP) += smp.o mxhead.o
obj-$(CONFIG_XTENSA_VARIANT_HAVE_PERF_EVENTS) += perf_event.o

AFLAGS_head.o += -mtext-section-literals

Expand Down
Loading

0 comments on commit 9bd46da

Please sign in to comment.