lkml.org 
[lkml]   [2018]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH V4 12/15] perf hists browser: add parameter to disable lost event warning
Date
> Hi,
>
> On Mon, Jan 15, 2018 at 12:20:48PM -0800, kan.liang@intel.com wrote:
> > From: Kan Liang <kan.liang@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.liang@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);
\
 
 \ /
  Last update: 2018-01-18 00:20    [W:0.068 / U:0.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site