Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1315596

[PATCH 4/4] perf hists browser: Check script context menu

From Namhyung Kim <namhyung@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 4/4] perf hists browser: Check script context menu
Date 2016-01-23 14:40 +0100
Message-ID <qU6A3-3jF-11@gated-at.bofh.it> (permalink)
References <qU6A1-3jF-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <namhyung@kernel.org>
---
 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 */
-		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]);
+		}
 		nr_options += add_exit_opt(browser, &actions[nr_options],
 					   &options[nr_options]);
 
-- 
2.6.4

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/4] perf hists browser: Check DSO related context menu Namhyung Kim <namhyung@kernel.org> - 2016-01-23 14:40 +0100
  [PATCH 4/4] perf hists browser: Check script context menu Namhyung Kim <namhyung@kernel.org> - 2016-01-23 14:40 +0100
    Re: [PATCH 4/4] perf hists browser: Check script context menu Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-01-26 19:40 +0100
      Re: [PATCH 4/4] perf hists browser: Check script context menu Namhyung Kim <namhyung@kernel.org> - 2016-01-27 14:20 +0100
    Re: [PATCH 4/4] perf hists browser: Check script context menu Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-01-26 19:40 +0100
  [PATCH 3/4] perf hists browser: Relax context menu check for symbol sort key Namhyung Kim <namhyung@kernel.org> - 2016-01-23 14:40 +0100
  [PATCH 2/4] perf hists browser: Check socket context menu Namhyung Kim <namhyung@kernel.org> - 2016-01-23 14:40 +0100

csiph-web