Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752191AbeAQDxL (ORCPT + 1 other); Tue, 16 Jan 2018 22:53:11 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:44251 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752105AbeAQDxJ (ORCPT ); Tue, 16 Jan 2018 22:53:09 -0500 X-Google-Smtp-Source: ACJfBouR5pFJfBOpC4u8tI+3cgCbAKtVsEu4YapFyqpeW+MgNOjQEE4dPLr0pRzfc74ltEt6yy/CjA== Date: Wed, 17 Jan 2018 12:50:07 +0900 From: Namhyung Kim To: kan.liang@intel.com Cc: acme@kernel.org, peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org, wangnan0@huawei.com, jolsa@kernel.org, ak@linux.intel.com, yao.jin@linux.intel.com, kernel-team@lge.com Subject: Re: [PATCH V4 12/15] perf hists browser: add parameter to disable lost event warning Message-ID: <20180117035007.GA6901@danjae.aot.lge.com> References: <1516047651-164336-1-git-send-email-kan.liang@intel.com> <1516047651-164336-13-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1516047651-164336-13-git-send-email-kan.liang@intel.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Hi, On Mon, Jan 15, 2018 at 12:20:48PM -0800, kan.liang@intel.com wrote: > From: Kan Liang > > For overwrite mode, the ringbuffer will be paused. The event lost is > expected. It needs a way to notify the browser not print the warning. > > It will be used later for perf top to disable lost event warning in > overwrite mode. There is no behavior change for now. > > Signed-off-by: Kan Liang > --- [SNIP] > diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c > index 68146f4..e458920 100644 > --- a/tools/perf/ui/browsers/hists.c > +++ b/tools/perf/ui/browsers/hists.c > @@ -608,7 +608,8 @@ static int hist_browser__title(struct hist_browser *browser, char *bf, size_t si > return browser->title ? browser->title(browser, bf, size) : 0; > } > > -int hist_browser__run(struct hist_browser *browser, const char *help) > +int hist_browser__run(struct hist_browser *browser, const char *help, > + bool no_lost_event_warning) > { > int key; > char title[160]; > @@ -638,8 +639,9 @@ int hist_browser__run(struct hist_browser *browser, const char *help) > nr_entries = hist_browser__nr_entries(browser); > ui_browser__update_nr_entries(&browser->b, nr_entries); > > - if (browser->hists->stats.nr_lost_warned != > - browser->hists->stats.nr_events[PERF_RECORD_LOST]) { > + if (!no_lost_event_warning && Double negation is always confusing (at least for me), why not making it "warn_lost_event"? Thanks, Namhyung > + (browser->hists->stats.nr_lost_warned != > + browser->hists->stats.nr_events[PERF_RECORD_LOST])) { > browser->hists->stats.nr_lost_warned = > browser->hists->stats.nr_events[PERF_RECORD_LOST]; > ui_browser__warn_lost_events(&browser->b);