Re: [PATCH 5/5] perf/hw_breakpoint: Simplify breakpoint enable in perf_event_modify_breakpoint

From: Oleg Nesterov
Date: Tue Aug 14 2018 - 09:27:50 EST


On 08/10, Jiri Olsa wrote:
>
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -2867,16 +2867,11 @@ static int perf_event_modify_breakpoint(struct perf_event *bp,
> _perf_event_disable(bp);
>
> err = modify_user_hw_breakpoint_check(bp, attr, true);
> - if (err) {
> - if (!bp->attr.disabled)
> - _perf_event_enable(bp);
>
> - return err;
> - }
> -
> - if (!attr->disabled)
> + if (!bp->attr.disabled)
> _perf_event_enable(bp);
> - return 0;
> +
> + return err;
> }

Acked-by: Oleg Nesterov <oleg@xxxxxxxxxx>