]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ARM: perf: fix updated event period in response to PERF_EVENT_IOC_PERIOD
authorWill Deacon <will.deacon@arm.com>
Wed, 15 Aug 2012 14:39:32 +0000 (15:39 +0100)
committerWill Deacon <will.deacon@arm.com>
Tue, 23 Oct 2012 12:23:33 +0000 (13:23 +0100)
commite10d60418adcb51f6f86b31fe71d6d256c7a22d1
treed966b02a43619c278a58b7636cdbceab3dafcf2b
parent6f0c0580b70c89094b3422ba81118c7b959c7556
ARM: perf: fix updated event period in response to PERF_EVENT_IOC_PERIOD

The PERF_EVENT_IOC_PERIOD ioctl command can be used to change the
sample period of a running perf_event. Consequently, when calculating
the next event period, the new period will only be considered after the
previous one has overflowed.

This patch changes the calculation of the remaining event ticks so that
they are offset if the period has changed.

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Reported-by: Andreas Sandberg <andreas.sandberg@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm/kernel/perf_event.c