Commit 114f709e authored by David Carrillo-Cisneros's avatar David Carrillo-Cisneros Committed by Arnaldo Carvalho de Melo

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: default avatarDavid Carrillo-Cisneros <davidcc@google.com>
Acked-by: default avatarDavid Ahern <dsahern@gmail.com>
Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Turner <pjt@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Simon Que <sque@chromium.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20170718042549.145161-15-davidcc@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent a4d8c985
...@@ -988,6 +988,10 @@ int cmd_report(int argc, const char **argv) ...@@ -988,6 +988,10 @@ int cmd_report(int argc, const char **argv)
/* Force tty output for header output and per-thread stat. */ /* Force tty output for header output and per-thread stat. */
if (report.header || report.header_only || report.show_threads) if (report.header || report.header_only || report.show_threads)
use_browser = 0; 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) if (strcmp(input_name, "-") != 0)
setup_browser(true); setup_browser(true);
......
...@@ -2972,10 +2972,13 @@ int cmd_script(int argc, const char **argv) ...@@ -2972,10 +2972,13 @@ int cmd_script(int argc, const char **argv)
return -1; return -1;
if (header || header_only) { if (header || header_only) {
script.tool.show_feat_hdr = SHOW_FEAT_HEADER;
perf_session__fprintf_info(session, stdout, show_full_info); perf_session__fprintf_info(session, stdout, show_full_info);
if (header_only) if (header_only)
goto out_delete; goto out_delete;
} }
if (show_full_info)
script.tool.show_feat_hdr = SHOW_FEAT_HEADER_FULL_INFO;
if (symbol__init(&session->header.env) < 0) if (symbol__init(&session->header.env) < 0)
goto out_delete; goto out_delete;
......
...@@ -34,6 +34,12 @@ typedef int (*event_oe)(struct perf_tool *tool, union perf_event *event, ...@@ -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, typedef s64 (*event_op3)(struct perf_tool *tool, union perf_event *event,
struct perf_session *session); struct perf_session *session);
enum show_feature_header {
SHOW_FEAT_NO_HEADER = 0,
SHOW_FEAT_HEADER,
SHOW_FEAT_HEADER_FULL_INFO,
};
struct perf_tool { struct perf_tool {
event_sample sample, event_sample sample,
read; read;
...@@ -68,6 +74,7 @@ struct perf_tool { ...@@ -68,6 +74,7 @@ struct perf_tool {
bool ordered_events; bool ordered_events;
bool ordering_requires_timestamps; bool ordering_requires_timestamps;
bool namespace_events; bool namespace_events;
enum show_feature_header show_feat_hdr;
}; };
#endif /* __PERF_TOOL_H */ #endif /* __PERF_TOOL_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment