aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-script.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r--tools/perf/builtin-script.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 7a571fb7eb8a..f8ab125aac48 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1494,6 +1494,8 @@ static int have_cmd(int argc, const char **argv)
1494int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused) 1494int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
1495{ 1495{
1496 bool show_full_info = false; 1496 bool show_full_info = false;
1497 bool header = false;
1498 bool header_only = false;
1497 char *rec_script_path = NULL; 1499 char *rec_script_path = NULL;
1498 char *rep_script_path = NULL; 1500 char *rep_script_path = NULL;
1499 struct perf_session *session; 1501 struct perf_session *session;
@@ -1532,6 +1534,8 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
1532 OPT_STRING('i', "input", &input_name, "file", "input file name"), 1534 OPT_STRING('i', "input", &input_name, "file", "input file name"),
1533 OPT_BOOLEAN('d', "debug-mode", &debug_mode, 1535 OPT_BOOLEAN('d', "debug-mode", &debug_mode,
1534 "do various checks like samples ordering and lost events"), 1536 "do various checks like samples ordering and lost events"),
1537 OPT_BOOLEAN(0, "header", &header, "Show data header."),
1538 OPT_BOOLEAN(0, "header-only", &header_only, "Show only data header."),
1535 OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name, 1539 OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
1536 "file", "vmlinux pathname"), 1540 "file", "vmlinux pathname"),
1537 OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name, 1541 OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name,
@@ -1748,6 +1752,12 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
1748 if (session == NULL) 1752 if (session == NULL)
1749 return -ENOMEM; 1753 return -ENOMEM;
1750 1754
1755 if (header || header_only) {
1756 perf_session__fprintf_info(session, stdout, show_full_info);
1757 if (header_only)
1758 return 0;
1759 }
1760
1751 script.session = session; 1761 script.session = session;
1752 1762
1753 if (cpu_list) { 1763 if (cpu_list) {
@@ -1755,9 +1765,6 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
1755 return -1; 1765 return -1;
1756 } 1766 }
1757 1767
1758 if (!script_name && !generate_script_lang)
1759 perf_session__fprintf_info(session, stdout, show_full_info);
1760
1761 if (!no_callchain) 1768 if (!no_callchain)
1762 symbol_conf.use_callchain = true; 1769 symbol_conf.use_callchain = true;
1763 else 1770 else