From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754554AbcA0NNy (ORCPT ); Wed, 27 Jan 2016 08:13:54 -0500 Received: from mail-pa0-f65.google.com ([209.85.220.65]:34338 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751298AbcA0NNw (ORCPT ); Wed, 27 Jan 2016 08:13:52 -0500 Date: Wed, 27 Jan 2016 22:12:47 +0900 From: Namhyung Kim To: Arnaldo Carvalho de Melo Cc: Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern Subject: Re: [PATCH 4/4] perf hists browser: Check script context menu Message-ID: <20160127131247.GA14190@danjae.kornet> References: <1453555902-18401-1-git-send-email-namhyung@kernel.org> <1453555902-18401-4-git-send-email-namhyung@kernel.org> <20160126183543.GH4361@kernel.org> <20160126183653.GI4361@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160126183653.GI4361@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnaldo, On Tue, Jan 26, 2016 at 03:36:53PM -0300, Arnaldo Carvalho de Melo wrote: > Em Tue, Jan 26, 2016 at 03:35:43PM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Sat, Jan 23, 2016 at 10:31:42PM +0900, Namhyung Kim escreveu: > > > The script and data-switch context menu are only meaningful when it > > > deals with a data file. So add a check so that it cannot be shown when > > > perf-top is run. > > > > > > Signed-off-by: Namhyung Kim > > > --- > > > tools/perf/ui/browsers/hists.c | 12 +++++++----- > > > 1 file changed, 7 insertions(+), 5 deletions(-) > > > > > > diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c > > > index 05e94feba3cb..0affffeed89c 100644 > > > --- a/tools/perf/ui/browsers/hists.c > > > +++ b/tools/perf/ui/browsers/hists.c > > > @@ -2309,7 +2309,7 @@ skip_annotation: > > > socked_id); > > > } > > > /* perf script support */ > > > > I instead used: > > > > if (is_report_browser(hbt) > > Oops, that should be: > > if (!is_report_browser(hbt) > > > goto skip_scripting; Oh, it looks better! :) > > > > > - if (browser->he_selection) { > > > > > > > + if (is_report_browser(hbt) && browser->he_selection) { > > > if (sort__has_thread) { > > > nr_options += add_script_opt(browser, > > > &actions[nr_options], > > > @@ -2332,10 +2332,12 @@ skip_annotation: > > > NULL, browser->selection->sym); > > > } > > > } > > > - nr_options += add_script_opt(browser, &actions[nr_options], > > > - &options[nr_options], NULL, NULL); > > > - nr_options += add_switch_opt(browser, &actions[nr_options], > > > - &options[nr_options]); > > > + if (is_report_browser(hbt)) { > > > + nr_options += add_script_opt(browser, &actions[nr_options], > > > + &options[nr_options], NULL, NULL); > > > + nr_options += add_switch_opt(browser, &actions[nr_options], > > > + &options[nr_options]); > > > + } > > > > skip_scripting: > > > > > nr_options += add_exit_opt(browser, &actions[nr_options], > > > &options[nr_options]); > > > > > > > Also the other patches in this series were already done in my tree, > > carved out from your initial patch but instead checking things at > > add_foo_opt() in most cases, Looks good! Thanks for your work, Namhyung