From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755800AbcBCKQK (ORCPT ); Wed, 3 Feb 2016 05:16:10 -0500 Received: from terminus.zytor.com ([198.137.202.10]:54627 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753047AbcBCKQB (ORCPT ); Wed, 3 Feb 2016 05:16:01 -0500 Date: Wed, 3 Feb 2016 02:15:08 -0800 From: tip-bot for Namhyung Kim Message-ID: Cc: acme@redhat.com, dsahern@gmail.com, mingo@kernel.org, namhyung@kernel.org, andi@firstfloor.org, linux-kernel@vger.kernel.org, wangnan0@huawei.com, eranian@google.com, hpa@zytor.com, peterz@infradead.org, tglx@linutronix.de Reply-To: andi@firstfloor.org, namhyung@kernel.org, mingo@kernel.org, dsahern@gmail.com, acme@redhat.com, peterz@infradead.org, eranian@google.com, hpa@zytor.com, wangnan0@huawei.com, linux-kernel@vger.kernel.org, tglx@linutronix.de In-Reply-To: <1453555902-18401-4-git-send-email-namhyung@kernel.org> References: <1453555902-18401-4-git-send-email-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf hists browser: Skip scripting when perf.data file not available Git-Commit-ID: b1baae89197e21cd115e9493d5a17f18fca81e6a X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: b1baae89197e21cd115e9493d5a17f18fca81e6a Gitweb: http://git.kernel.org/tip/b1baae89197e21cd115e9493d5a17f18fca81e6a Author: Namhyung Kim AuthorDate: Tue, 26 Jan 2016 15:37:30 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 26 Jan 2016 16:08:12 -0300 perf hists browser: Skip scripting when perf.data file not available 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 Tested-by: Arnaldo Carvalho de Melo Cc: Andi Kleen Cc: David Ahern Cc: Jiri Olsa , Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Wang Nan Link: http://lkml.kernel.org/r/1453555902-18401-4-git-send-email-namhyung@kernel.org [ Use goto skip_scripting instead of two is_report_browser() tests ] Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/ui/browsers/hists.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index d07e6be..1da30f8 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c @@ -2303,6 +2303,9 @@ skip_annotation: &options[nr_options], socked_id); /* perf script support */ + if (!is_report_browser(hbt)) + goto skip_scripting; + if (browser->he_selection) { if (sort__has_thread && thread) { nr_options += add_script_opt(browser, @@ -2330,6 +2333,7 @@ skip_annotation: &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]);