diff options
author | Ingo Molnar <mingo@kernel.org> | 2019-06-17 12:29:16 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-06-17 12:29:16 +0200 |
commit | bddb3636737f658886a0a02b64db5366bba3428e (patch) | |
tree | 8f7ffcb42803fa0bb3378ef969545e4a5e57262c /arch/sparc/kernel/perf_event.c | |
parent | 3384c78631dd722c2cdc5c57fbdd39fc1b5a9f2d (diff) | |
parent | cbb99c0f588737ec98c333558922ce47e9a95827 (diff) | |
download | linux-stable-bddb3636737f658886a0a02b64db5366bba3428e.tar.gz linux-stable-bddb3636737f658886a0a02b64db5366bba3428e.tar.bz2 linux-stable-bddb3636737f658886a0a02b64db5366bba3428e.zip |
Merge branch 'x86/cpu' into perf/core, to pick up dependent changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/sparc/kernel/perf_event.c')
-rw-r--r-- | arch/sparc/kernel/perf_event.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c index 6de7c684c29f..a58ae9c42803 100644 --- a/arch/sparc/kernel/perf_event.c +++ b/arch/sparc/kernel/perf_event.c @@ -891,6 +891,10 @@ static int sparc_perf_event_set_period(struct perf_event *event, s64 period = hwc->sample_period; 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)) { left = period; local64_set(&hwc->period_left, left); |