aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/builtin-report.c4
-rw-r--r--tools/perf/builtin-script.c3
-rw-r--r--tools/perf/util/tool.h7
3 files changed, 14 insertions, 0 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 79a33eb1a10d..40c3a92c8006 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -988,6 +988,10 @@ repeat:
988 /* Force tty output for header output and per-thread stat. */ 988 /* Force tty output for header output and per-thread stat. */
989 if (report.header || report.header_only || report.show_threads) 989 if (report.header || report.header_only || report.show_threads)
990 use_browser = 0; 990 use_browser = 0;
991 if (report.header || report.header_only)
992 report.tool.show_feat_hdr = SHOW_FEAT_HEADER;
993 if (report.show_full_info)
994 report.tool.show_feat_hdr = SHOW_FEAT_HEADER_FULL_INFO;
991 995
992 if (strcmp(input_name, "-") != 0) 996 if (strcmp(input_name, "-") != 0)
993 setup_browser(true); 997 setup_browser(true);
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 83cdc0a61fd6..6e44552a0551 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)
2972 return -1; 2972 return -1;
2973 2973
2974 if (header || header_only) { 2974 if (header || header_only) {
2975 script.tool.show_feat_hdr = SHOW_FEAT_HEADER;
2975 perf_session__fprintf_info(session, stdout, show_full_info); 2976 perf_session__fprintf_info(session, stdout, show_full_info);
2976 if (header_only) 2977 if (header_only)
2977 goto out_delete; 2978 goto out_delete;
2978 } 2979 }
2980 if (show_full_info)
2981 script.tool.show_feat_hdr = SHOW_FEAT_HEADER_FULL_INFO;
2979 2982
2980 if (symbol__init(&session->header.env) < 0) 2983 if (symbol__init(&session->header.env) < 0)
2981 goto out_delete; 2984 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,
34typedef s64 (*event_op3)(struct perf_tool *tool, union perf_event *event, 34typedef s64 (*event_op3)(struct perf_tool *tool, union perf_event *event,
35 struct perf_session *session); 35 struct perf_session *session);
36 36
37enum show_feature_header {
38 SHOW_FEAT_NO_HEADER = 0,
39 SHOW_FEAT_HEADER,
40 SHOW_FEAT_HEADER_FULL_INFO,
41};
42
37struct perf_tool { 43struct perf_tool {
38 event_sample sample, 44 event_sample sample,
39 read; 45 read;
@@ -68,6 +74,7 @@ struct perf_tool {
68 bool ordered_events; 74 bool ordered_events;
69 bool ordering_requires_timestamps; 75 bool ordering_requires_timestamps;
70 bool namespace_events; 76 bool namespace_events;
77 enum show_feature_header show_feat_hdr;
71}; 78};
72 79
73#endif /* __PERF_TOOL_H */ 80#endif /* __PERF_TOOL_H */