> Hi,
> 
> On Mon, Jan 15, 2018 at 12:20:48PM -0800, kan.li...@intel.com wrote:
> > From: Kan Liang <kan.li...@intel.com>
> >
> > 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 <kan.li...@intel.com>
> > ---
> 
> [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"?
> 

OK. I will change it in V5.

Thanks,
Kan

> 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);

Reply via email to