]> 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>
Wed, 17 Oct 2012 10:58:13 +0000 (11:58 +0100)
commit75de777bcca6036097dba1dc094e2677a805ea83
tree915392542390893e8d76780d686e4568992efc18
parentddffeb8c4d0331609ef2581d84de4d763607bd37
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