From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755432AbcBCKL6 (ORCPT ); Wed, 3 Feb 2016 05:11:58 -0500 Received: from terminus.zytor.com ([198.137.202.10]:54445 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754672AbcBCKLy (ORCPT ); Wed, 3 Feb 2016 05:11:54 -0500 Date: Wed, 3 Feb 2016 02:11:14 -0800 From: tip-bot for Namhyung Kim Message-ID: Cc: wangnan0@huawei.com, hpa@zytor.com, namhyung@kernel.org, andi@firstfloor.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, acme@redhat.com, peterz@infradead.org, mingo@kernel.org, eranian@google.com, dsahern@gmail.com Reply-To: peterz@infradead.org, linux-kernel@vger.kernel.org, acme@redhat.com, tglx@linutronix.de, andi@firstfloor.org, namhyung@kernel.org, hpa@zytor.com, wangnan0@huawei.com, dsahern@gmail.com, eranian@google.com, mingo@kernel.org In-Reply-To: <1452960197-5323-9-git-send-email-namhyung@kernel.org> References: <1452960197-5323-9-git-send-email-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf hists browser: Only 'Zoom into thread' only when sort order has 'pid' Git-Commit-ID: 2eafd410e669c744208f8110940e42caa7d79447 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: 2eafd410e669c744208f8110940e42caa7d79447 Gitweb: http://git.kernel.org/tip/2eafd410e669c744208f8110940e42caa7d79447 Author: Namhyung Kim AuthorDate: Thu, 21 Jan 2016 19:13:24 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 26 Jan 2016 11:52:49 -0300 perf hists browser: Only 'Zoom into thread' only when sort order has 'pid' We can't offer a zoom into thread when a bucket (struct hist_entry) may have samples for more than one thread, i.e. when 'pid' is not part of the sort order, fix it. 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/1452960197-5323-9-git-send-email-namhyung@kernel.org [ Carved out from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo --- 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 08c09ad..e66b3a3 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c @@ -1782,7 +1782,7 @@ static int add_thread_opt(struct hist_browser *browser, struct popup_action *act, char **optstr, struct thread *thread) { - if (thread == NULL) + if (!sort__has_thread || thread == NULL) return 0; if (asprintf(optstr, "Zoom %s %s(%d) thread", @@ -2307,10 +2307,12 @@ skip_annotation: socked_id); /* perf script support */ if (browser->he_selection) { - nr_options += add_script_opt(browser, - &actions[nr_options], - &options[nr_options], - thread, NULL); + if (sort__has_thread && thread) { + nr_options += add_script_opt(browser, + &actions[nr_options], + &options[nr_options], + thread, NULL); + } /* * Note that browser->selection != NULL * when browser->he_selection is not NULL,