From: Franck Bui-Huu Date: Tue, 23 Nov 2010 15:21:44 +0000 (+0100) Subject: perf: Limit event refresh to sampling event X-Git-Tag: Ubuntu-5.13.0-19.19~29332^2~77 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=2e939d1da9b5628642314c1e68b4319e61263c94;p=mirror_ubuntu-jammy-kernel.git perf: Limit event refresh to sampling event Signed-off-by: Franck Bui-Huu Signed-off-by: Peter Zijlstra LKML-Reference: <1290525705-6265-2-git-send-email-fbuihuu@gmail.com> Signed-off-by: Ingo Molnar --- diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 880698488c91..027c4d33b4d3 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c @@ -1073,7 +1073,7 @@ static int perf_event_refresh(struct perf_event *event, int refresh) /* * not supported on inherited events */ - if (event->attr.inherit) + if (event->attr.inherit || !is_sampling_event(event)) return -EINVAL; atomic_add(refresh, &event->event_limit);