* [tip:perf/core] perf report: Move captured info to generic header info
@ 2016-10-24 18:54 tip-bot for Jiri Olsa
0 siblings, 0 replies; only message in thread
From: tip-bot for Jiri Olsa @ 2016-10-24 18:54 UTC (permalink / raw)
To: linux-tip-commits
Cc: dsahern, namhyung, wangnan0, mingo, jolsa, tglx, hpa,
linux-kernel, acme, adrian.hunter
Commit-ID: f45f56151ac64aef687546d99b33df294faaa19c
Gitweb: http://git.kernel.org/tip/f45f56151ac64aef687546d99b33df294faaa19c
Author: Jiri Olsa <jolsa@kernel.org>
AuthorDate: Mon, 10 Oct 2016 09:03:07 +0200
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
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 <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-5fk88kejqgi50ye7xdkhiloz@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
| 9 +++++++++
tools/perf/util/session.c | 10 ----------
2 files changed, 9 insertions(+), 10 deletions(-)
--git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 2f3eded..05f5627 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -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;
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 5d61242..f268201 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -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");
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-10-24 18:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-24 18:54 [tip:perf/core] perf report: Move captured info to generic header info tip-bot for Jiri Olsa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome