aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/perf_event.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel/perf_event.c')
-rw-r--r--arch/arm/kernel/perf_event.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 93971b1a4f0b..53c0304b734a 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -96,6 +96,10 @@ armpmu_event_set_period(struct perf_event *event,
96 s64 period = hwc->sample_period; 96 s64 period = hwc->sample_period;
97 int ret = 0; 97 int ret = 0;
98 98
99 /* The period may have been changed by PERF_EVENT_IOC_PERIOD */
100 if (unlikely(period != hwc->last_period))
101 left = period - (hwc->last_period - left);
102
99 if (unlikely(left <= -period)) { 103 if (unlikely(left <= -period)) {
100 left = period; 104 left = period;
101 local64_set(&hwc->period_left, left); 105 local64_set(&hwc->period_left, left);