From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964870AbdGTJHs (ORCPT ); Thu, 20 Jul 2017 05:07:48 -0400 Received: from terminus.zytor.com ([65.50.211.136]:50327 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964794AbdGTJHZ (ORCPT ); Thu, 20 Jul 2017 05:07:25 -0400 Date: Thu, 20 Jul 2017 02:02:50 -0700 From: tip-bot for David Carrillo-Cisneros Message-ID: Cc: namhyung@kernel.org, linux-kernel@vger.kernel.org, pjt@google.com, hpa@zytor.com, ak@linux.intel.com, sque@chromium.org, eranian@google.com, dsahern@gmail.com, davidcc@google.com, jolsa@kernel.org, mingo@kernel.org, tglx@linutronix.de, mhiramat@kernel.org, acme@redhat.com, wangnan0@huawei.com, peterz@infradead.org, hekuang@huawei.com, alexander.shishkin@linux.intel.com Reply-To: linux-kernel@vger.kernel.org, namhyung@kernel.org, ak@linux.intel.com, pjt@google.com, hpa@zytor.com, sque@chromium.org, davidcc@google.com, dsahern@gmail.com, eranian@google.com, jolsa@kernel.org, acme@redhat.com, mhiramat@kernel.org, tglx@linutronix.de, mingo@kernel.org, wangnan0@huawei.com, hekuang@huawei.com, alexander.shishkin@linux.intel.com, peterz@infradead.org In-Reply-To: <20170718042549.145161-15-davidcc@google.com> References: <20170718042549.145161-15-davidcc@google.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tool: Add show_feature_header to perf_tool Git-Commit-ID: 114f709e01e62760a6d03de1358188293dfefdda 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: 114f709e01e62760a6d03de1358188293dfefdda Gitweb: http://git.kernel.org/tip/114f709e01e62760a6d03de1358188293dfefdda Author: David Carrillo-Cisneros AuthorDate: Mon, 17 Jul 2017 21:25:47 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:36 -0300 perf tool: Add show_feature_header to perf_tool Add show_feat_hdr to control level of printed information of feature headers. Signed-off-by: David Carrillo-Cisneros Acked-by: David Ahern Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: He Kuang Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Paul Turner Cc: Peter Zijlstra Cc: Simon Que Cc: Stephane Eranian Cc: Wang Nan Link: http://lkml.kernel.org/r/20170718042549.145161-15-davidcc@google.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-report.c | 4 ++++ tools/perf/builtin-script.c | 3 +++ tools/perf/util/tool.h | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 79a33eb..40c3a92 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -988,6 +988,10 @@ repeat: /* Force tty output for header output and per-thread stat. */ if (report.header || report.header_only || report.show_threads) use_browser = 0; + if (report.header || report.header_only) + report.tool.show_feat_hdr = SHOW_FEAT_HEADER; + if (report.show_full_info) + report.tool.show_feat_hdr = SHOW_FEAT_HEADER_FULL_INFO; if (strcmp(input_name, "-") != 0) setup_browser(true); diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 83cdc0a..6e44552 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -2972,10 +2972,13 @@ int cmd_script(int argc, const char **argv) return -1; if (header || header_only) { + script.tool.show_feat_hdr = SHOW_FEAT_HEADER; perf_session__fprintf_info(session, stdout, show_full_info); if (header_only) goto out_delete; } + if (show_full_info) + script.tool.show_feat_hdr = SHOW_FEAT_HEADER_FULL_INFO; if (symbol__init(&session->header.env) < 0) goto out_delete; diff --git a/tools/perf/util/tool.h b/tools/perf/util/tool.h index 829471a..baeca80 100644 --- a/tools/perf/util/tool.h +++ b/tools/perf/util/tool.h @@ -34,6 +34,12 @@ typedef int (*event_oe)(struct perf_tool *tool, union perf_event *event, typedef s64 (*event_op3)(struct perf_tool *tool, union perf_event *event, struct perf_session *session); +enum show_feature_header { + SHOW_FEAT_NO_HEADER = 0, + SHOW_FEAT_HEADER, + SHOW_FEAT_HEADER_FULL_INFO, +}; + struct perf_tool { event_sample sample, read; @@ -68,6 +74,7 @@ struct perf_tool { bool ordered_events; bool ordering_requires_timestamps; bool namespace_events; + enum show_feature_header show_feat_hdr; }; #endif /* __PERF_TOOL_H */