From: Jiri Olsa Date: Wed, 7 Mar 2018 15:50:03 +0000 (+0100) Subject: perf report: Display perf.data header info X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=e971a5a8399a5e84164239a5c2d59b8a51314241;p=openwrt%2Fstaging%2Fblogic.git perf report: Display perf.data header info Display more header info from perf.data file, following values: $ perf report -i perf.data --header-only ... # header version : 1 # data offset : 424 # data size : 3364280 # feat offset : 3364704 It's handy for debuging. Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180307155020.32613-3-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index a326e0d8b5b6..e0c3cad0fd8d 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -2318,7 +2318,12 @@ int perf_header__fprintf_info(struct perf_session *session, FILE *fp, bool full) if (ret == -1) return -1; - fprintf(fp, "# captured on: %s", ctime(&st.st_ctime)); + fprintf(fp, "# captured on : %s", ctime(&st.st_ctime)); + + fprintf(fp, "# header version : %u\n", header->version); + fprintf(fp, "# data offset : %" PRIu64 "\n", header->data_offset); + fprintf(fp, "# data size : %" PRIu64 "\n", header->data_size); + fprintf(fp, "# feat offset : %" PRIu64 "\n", header->feat_offset); perf_header__process_sections(header, fd, &hd, perf_file_section__fprintf_info);