[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180117035007.GA6901@danjae.aot.lge.com>
Date: Wed, 17 Jan 2018 12:50:07 +0900
From: Namhyung Kim <namhyung@...nel.org>
To: kan.liang@...el.com
Cc: acme@...nel.org, peterz@...radead.org, mingo@...hat.com,
linux-kernel@...r.kernel.org, wangnan0@...wei.com,
jolsa@...nel.org, ak@...ux.intel.com, yao.jin@...ux.intel.com,
kernel-team@....com
Subject: Re: [PATCH V4 12/15] perf hists browser: add parameter to disable
lost event warning
Hi,
On Mon, Jan 15, 2018 at 12:20:48PM -0800, kan.liang@...el.com wrote:
> From: Kan Liang <kan.liang@...el.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@...el.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"?
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);
Powered by blists - more mailing lists