From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760083AbcBYHrE (ORCPT ); Thu, 25 Feb 2016 02:47:04 -0500 Received: from torg.zytor.com ([198.137.202.12]:57886 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759644AbcBYHrB (ORCPT ); Thu, 25 Feb 2016 02:47:01 -0500 Date: Wed, 24 Feb 2016 23:46:21 -0800 From: tip-bot for Namhyung Kim Message-ID: Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, eranian@google.com, dsahern@gmail.com, andi@firstfloor.org, jolsa@kernel.org, acme@redhat.com, mingo@kernel.org, hpa@zytor.com, wangnan0@huawei.com, penberg@kernel.org, namhyung@kernel.org, peterz@infradead.org Reply-To: penberg@kernel.org, peterz@infradead.org, namhyung@kernel.org, wangnan0@huawei.com, jolsa@kernel.org, acme@redhat.com, mingo@kernel.org, hpa@zytor.com, dsahern@gmail.com, andi@firstfloor.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, eranian@google.com In-Reply-To: <1456326830-30456-19-git-send-email-namhyung@kernel.org> References: <1456326830-30456-19-git-send-email-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf top: Add --hierarchy option Git-Commit-ID: c92fcfde3486fb4b9e476ee5ad5995a62e401cce 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: c92fcfde3486fb4b9e476ee5ad5995a62e401cce Gitweb: http://git.kernel.org/tip/c92fcfde3486fb4b9e476ee5ad5995a62e401cce Author: Namhyung Kim AuthorDate: Thu, 25 Feb 2016 00:13:50 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 24 Feb 2016 20:21:15 -0300 perf top: Add --hierarchy option Support hierarchy output for perf-top using --hierarchy option. Signed-off-by: Namhyung Kim Acked-by: Pekka Enberg Cc: Andi Kleen Cc: David Ahern Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Wang Nan Link: http://lkml.kernel.org/r/1456326830-30456-19-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/Documentation/perf-top.txt | 3 +++ tools/perf/builtin-top.c | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/tools/perf/Documentation/perf-top.txt b/tools/perf/Documentation/perf-top.txt index b0e60e1..19f046f 100644 --- a/tools/perf/Documentation/perf-top.txt +++ b/tools/perf/Documentation/perf-top.txt @@ -233,6 +233,9 @@ Default is to monitor all CPUS. --raw-trace:: When displaying traceevent output, do not use print fmt or plugins. +--hierarchy:: + Enable hierarchy output. + INTERACTIVE PROMPTING KEYS -------------------------- diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index a75de39..b86b623 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -1214,6 +1214,8 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) parse_branch_stack), OPT_BOOLEAN(0, "raw-trace", &symbol_conf.raw_trace, "Show raw trace event output (do not use print fmt or plugins)"), + OPT_BOOLEAN(0, "hierarchy", &symbol_conf.report_hierarchy, + "Show entries in a hierarchy"), OPT_END() }; const char * const top_usage[] = { @@ -1241,6 +1243,19 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) goto out_delete_evlist; } + if (symbol_conf.report_hierarchy) { + /* disable incompatible options */ + symbol_conf.event_group = false; + symbol_conf.cumulate_callchain = false; + + if (field_order) { + pr_err("Error: --hierarchy and --fields options cannot be used together\n"); + parse_options_usage(top_usage, options, "fields", 0); + parse_options_usage(NULL, options, "hierarchy", 0); + goto out_delete_evlist; + } + } + sort__mode = SORT_MODE__TOP; /* display thread wants entries to be collapsed in a different tree */ sort__need_collapse = 1;