perf report: Move captured info to generic header info
tip-bot for Jiri Olsa
merge botCommit-ID: f45f56151ac64aef687546d99b33df294faaa19c Gitweb: http://git.kernel.org/tip/f45f56151ac64aef687546d99b33df294faaa19c Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 10 Oct 2016 09:03:07 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 24 Oct 2016 11:07:33 -0300
perf report: Move captured info to generic header info
It's not displayed in TUI now, putting it into generic part.
Signed-off-by Jiri Olsa <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc David Ahern <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Wang Nan <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/util/header.c | 9 +++++++++ tools/perf/util/session.c | 10 ---------- 2 files changed, 9 insertions(+), 10 deletions(-)
tools/perf/util/header.c +9 -0
@@ -2250,9 +2250,18 @@ int perf_header__fprintf_info(struct perf_session *session, FILE *fp, bool full)struct header_print_data hd;struct perf_header *header = &session->header;int fd =perf_data_file__fd (session->file); +struct stat st; +int ret; + hd.fp = fp; hd.full = full; + ret =fstat (fd, &st); +if (ret ==-1 ) +return -1 ; + +fprintf (fp,"# captured on: %s" ,ctime (&st.st_ctime)); +perf_header__process_sections (header, fd, &hd, perf_file_section__fprintf_info);return 0 ;
tools/perf/util/session.c +0 -10
@@ -2025,20 +2025,10 @@ out_delete_map:void perf_session__fprintf_info (struct perf_session *session,FILE *fp,bool full) { -struct stat st; -int fd, ret; -if (session ==NULL || fp ==NULL )return ; - fd =perf_data_file__fd (session->file); - - ret =fstat (fd, &st); -if (ret ==-1 ) -return ; -fprintf (fp,"# ========\n" ); -fprintf (fp,"# captured on: %s" ,ctime (&st.st_ctime));perf_header__fprintf_info (session, fp, full);fprintf (fp,"# ========\n#\n" ); }