|
@@ -96,6 +96,10 @@ armpmu_event_set_period(struct perf_event *event,
|
|
s64 period = hwc->sample_period;
|
|
s64 period = hwc->sample_period;
|
|
int ret = 0;
|
|
int ret = 0;
|
|
|
|
|
|
|
|
+ /* The period may have been changed by PERF_EVENT_IOC_PERIOD */
|
|
|
|
+ if (unlikely(period != hwc->last_period))
|
|
|
|
+ left = period - (hwc->last_period - left);
|
|
|
|
+
|
|
if (unlikely(left <= -period)) {
|
|
if (unlikely(left <= -period)) {
|
|
left = period;
|
|
left = period;
|
|
local64_set(&hwc->period_left, left);
|
|
local64_set(&hwc->period_left, left);
|