]> git.baikalelectronics.ru Git - kernel.git/commit
perf events: Fix swevent hrtimer sampling by keeping track of remaining time when...
authorSoeren Sandmann <sandmann@daimi.au.dk>
Tue, 15 Sep 2009 12:33:08 +0000 (14:33 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 23 Oct 2009 07:35:02 +0000 (09:35 +0200)
commit533a873e4fbad81fafe19993cb941b9a34c1cf6e
tree51bc7438941db50224489091eed677ba67decf56
parent8584ff272e9df218eaf163c5f1958728f12ed798
perf events: Fix swevent hrtimer sampling by keeping track of remaining time when enabling/disabling swevent hrtimers

Make the hrtimer based events work for sysprof.

Whenever a swevent is scheduled out, the hrtimer is canceled.
When it is scheduled back in, the timer is restarted. This
happens every scheduler tick, which means the timer never
expired because it was getting repeatedly restarted over and
over with the same period.

To fix that, save the remaining time when disabling; when
reenabling, use that saved time as the period instead of the
user-specified sampling period.

Also, move the starting and stopping of the hrtimers to helper
functions instead of duplicating the code.

Signed-off-by: Søren Sandmann Pedersen <sandmann@redhat.com>
LKML-Reference: <ye8vdi7mluz.fsf@camel16.daimi.au.dk>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/perf_event.h
kernel/perf_event.c