Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1664409
| From | David Carrillo-Cisneros <davidcc@google.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v4 14/16] perf tool: add show_feature_header to perf_tool |
| Date | 2017-06-13 06:40 +0200 |
| Message-ID | <tRLMv-3kB-45@gated-at.bofh.it> (permalink) |
| References | <tRLMt-3kB-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Add show_feat_hdr to control level of printed information
of feature headers.
Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
---
tools/perf/builtin-report.c | 11 ++++++++---
tools/perf/builtin-script.c | 3 +++
tools/perf/util/tool.h | 7 +++++++
3 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 22478ff2b706..7620d708c78b 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -985,9 +985,14 @@ int cmd_report(int argc, const char **argv)
perf_hpp_list.need_collapse = true;
}
- /* 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;
+ /* Force tty output for header output and per-thread stat. */
+ if (report.show_threads)
+ use_browser = 0;
+ }
+ 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 afa84debc5c4..46f929391391 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -2717,10 +2717,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 829471a1c6d7..baeca808dfda 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 */
--
2.13.1.508.gb3defc5cc-goog
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v4 00/16] perf tool: add meta-data header support for pipe-mode David Carrillo-Cisneros <davidcc@google.com> - 2017-06-13 06:40 +0200
[PATCH v4 16/16] perf header: add event desc to pipe-mode header David Carrillo-Cisneros <davidcc@google.com> - 2017-06-13 06:40 +0200
[PATCH v4 03/16] perf header: fail on write_padded error David Carrillo-Cisneros <davidcc@google.com> - 2017-06-13 06:40 +0200
[PATCH v4 13/16] perf header: change FEAT_OP* macros David Carrillo-Cisneros <davidcc@google.com> - 2017-06-13 06:40 +0200
[PATCH v4 02/16] perf header: add PROCESS_STR_FUN macro David Carrillo-Cisneros <davidcc@google.com> - 2017-06-13 06:40 +0200
[PATCH v4 10/16] perf header: use struct feat_fd in read header records David Carrillo-Cisneros <davidcc@google.com> - 2017-06-13 06:40 +0200
[PATCH v4 07/16] perf header: use struct feat_fd for print David Carrillo-Cisneros <davidcc@google.com> - 2017-06-13 06:40 +0200
[PATCH v4 01/16] perf header: encapsulate read and swap David Carrillo-Cisneros <davidcc@google.com> - 2017-06-13 06:40 +0200
[PATCH v4 04/16] perf util: add const modifier to buf in "writen" function David Carrillo-Cisneros <davidcc@google.com> - 2017-06-13 06:40 +0200
[PATCH v4 11/16] perf header: make write_pmu_mappings pipe-mode friendly David Carrillo-Cisneros <davidcc@google.com> - 2017-06-13 06:40 +0200
[PATCH v4 09/16] perf header: don't pass struct perf_file_section to process_##_feat David Carrillo-Cisneros <davidcc@google.com> - 2017-06-13 06:40 +0200
Re: [PATCH v4 09/16] perf header: don't pass struct perf_file_section to process_##_feat Jiri Olsa <jolsa@redhat.com> - 2017-06-13 21:00 +0200
Re: [PATCH v4 09/16] perf header: don't pass struct perf_file_section to process_##_feat David Carrillo-Cisneros <davidcc@google.com> - 2017-06-14 04:00 +0200
[PATCH v4 12/16] perf header: add a buffer to struct feat_fd David Carrillo-Cisneros <davidcc@google.com> - 2017-06-13 06:40 +0200
Re: [PATCH v4 12/16] perf header: add a buffer to struct feat_fd Jiri Olsa <jolsa@redhat.com> - 2017-06-13 21:00 +0200
Re: [PATCH v4 12/16] perf header: add a buffer to struct feat_fd David Carrillo-Cisneros <davidcc@google.com> - 2017-06-14 04:00 +0200
[PATCH v4 14/16] perf tool: add show_feature_header to perf_tool David Carrillo-Cisneros <davidcc@google.com> - 2017-06-13 06:40 +0200
Re: [PATCH v4 14/16] perf tool: add show_feature_header to perf_tool Jiri Olsa <jolsa@redhat.com> - 2017-06-13 21:00 +0200
[PATCH v4 06/16] perf header: add struct feat_fd for write David Carrillo-Cisneros <davidcc@google.com> - 2017-06-13 06:40 +0200
[PATCH v4 08/16] perf header: use struct feat_fd to process header records David Carrillo-Cisneros <davidcc@google.com> - 2017-06-13 06:40 +0200
Re: [PATCH v4 00/16] perf tool: add meta-data header support for pipe-mode Jiri Olsa <jolsa@redhat.com> - 2017-06-13 21:00 +0200
Re: [PATCH v4 00/16] perf tool: add meta-data header support for pipe-mode David Carrillo-Cisneros <davidcc@google.com> - 2017-06-14 08:50 +0200
Re: [PATCH v4 00/16] perf tool: add meta-data header support for pipe-mode Jiri Olsa <jolsa@redhat.com> - 2017-06-13 21:00 +0200
Re: [PATCH v4 00/16] perf tool: add meta-data header support for pipe-mode David Carrillo-Cisneros <davidcc@google.com> - 2017-06-14 09:00 +0200
Re: [PATCH v4 00/16] perf tool: add meta-data header support for pipe-mode Jiri Olsa <jolsa@redhat.com> - 2017-06-14 09:30 +0200
Re: [PATCH v4 00/16] perf tool: add meta-data header support for pipe-mode David Carrillo-Cisneros <davidcc@google.com> - 2017-06-14 20:40 +0200
csiph-web