From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751360AbdK0Gua (ORCPT ); Mon, 27 Nov 2017 01:50:30 -0500 Received: from mail-ot0-f194.google.com ([74.125.82.194]:33977 "EHLO mail-ot0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750838AbdK0Gu2 (ORCPT ); Mon, 27 Nov 2017 01:50:28 -0500 X-Google-Smtp-Source: AGs4zMYsFkva1pDj87NsyP6KcSajyE0bdAJRB87kMxLbOZHI8f868aEGjgA0A7G7sb/HDblvBAsFt2ArFGSiGioU+cw= MIME-Version: 1.0 In-Reply-To: <1511765030-20132-1-git-send-email-chabbi.milind@gmail.com> References: <20171126193132.GA7595@krava> <1511765030-20132-1-git-send-email-chabbi.milind@gmail.com> From: Milind Chabbi Date: Sun, 26 Nov 2017 22:50:27 -0800 X-Google-Sender-Auth: ZA4Jx0-XJOtjpcjkhCuqfNmvYS4 Message-ID: Subject: Re: [PATCH] perf/core: Enable the bp only if the .disable field is 0. To: Milind Chabbi Cc: Jiri Olsa , Peter Zijlstra , Paul Mackerras , Ingo Molnar , Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 26, 2017 at 10:43 PM, Milind Chabbi wrote: > Signed-off-by: Milind Chabbi > --- > kernel/events/core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/kernel/events/core.c b/kernel/events/core.c > index 35747a58ffb4..1b8eae85e9de 100644 > --- a/kernel/events/core.c > +++ b/kernel/events/core.c > @@ -2659,7 +2659,8 @@ static int perf_event_modify_breakpoint(struct perf_event *bp, > return err; > } > > - _perf_event_enable(bp); > + if (!attr->disabled) > + _perf_event_enable(bp); > return 0; > } > > -- > 2.14.1 > Hi Jirka, Thanks for your changes for proper accounting of the bp. This additional change is needed so that we do not enable the bp if the user has not asked to enable it. I did the testing for ioctl and it continues to show the significant speedups that I had originally seen. -Milind