]> asedeno.scripts.mit.edu Git - linux.git/commit
powerpc/8xx: Only perform perf counting when perf is in use.
authorChristophe Leroy <christophe.leroy@c-s.fr>
Fri, 12 Jan 2018 12:45:23 +0000 (13:45 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 16 Jan 2018 12:47:12 +0000 (23:47 +1100)
commitcd99ddbea250ee79027df6c469f51ad9e5452738
treebdf7792780f06be984ec2cc200eb725dd10b7a4a
parentbb9b5a8332533ac7935ca6edfc7ebf15a5366f11
powerpc/8xx: Only perform perf counting when perf is in use.

In TLB miss handlers, updating the perf counter is only useful
when performing a perf analysis. As it has a noticeable overhead,
let's only do it when needed.

In order to do so, the exit of the miss handlers will be patched
when starting/stopping 'perf': the first register restore
instruction of each exit point will be replaced by a jump to
the counting code.

Once this is done, CONFIG_PPC_8xx_PERF_EVENT becomes useless as
this feature doesn't add any overhead.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/ppc-opcode.h
arch/powerpc/kernel/entry_32.S
arch/powerpc/kernel/head_8xx.S
arch/powerpc/perf/8xx-pmu.c
arch/powerpc/perf/Makefile
arch/powerpc/platforms/Kconfig.cputype