[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-e1ab48ba63ee6b2494a67bb60bf99692ecdaca7c@git.kernel.org>
Date: Sat, 5 Mar 2016 00:16:41 -0800
From: tip-bot for Wang Nan <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: peterz@...radead.org, acme@...hat.com, hekuang@...wei.com,
ast@...nel.org, jolsa@...nel.org, lizefan@...wei.com,
namhyung@...nel.org, tglx@...utronix.de, hpa@...or.com,
masami.hiramatsu.pt@...achi.com, mingo@...nel.org,
linux-kernel@...r.kernel.org, wangnan0@...wei.com
Subject: [tip:perf/core] perf record: Introduce record__finish_output() to
finish a perf.data
Commit-ID: e1ab48ba63ee6b2494a67bb60bf99692ecdaca7c
Gitweb: http://git.kernel.org/tip/e1ab48ba63ee6b2494a67bb60bf99692ecdaca7c
Author: Wang Nan <wangnan0@...wei.com>
AuthorDate: Fri, 26 Feb 2016 09:32:10 +0000
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Thu, 3 Mar 2016 11:10:35 -0300
perf record: Introduce record__finish_output() to finish a perf.data
Move code for finalizing 'perf.data' to record__finish_output(). It will
be used by following commits to split output to multiple files.
Signed-off-by: He Kuang <hekuang@...wei.com>
Cc: Alexei Starovoitov <ast@...nel.org>
Cc: He Kuang <hekuang@...wei.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Li Zefan <lizefan@...wei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Zefan Li <lizefan@...wei.com>
Cc: pi3orama@....com
Link: http://lkml.kernel.org/r/1456479154-136027-23-git-send-email-wangnan0@huawei.com
Signed-off-by: Wang Nan <wangnan0@...wei.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/builtin-record.c | 37 +++++++++++++++++++++++++------------
1 file changed, 25 insertions(+), 12 deletions(-)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index cb583b4..46e2772 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -468,6 +468,29 @@ static void record__init_features(struct record *rec)
perf_header__clear_feat(&session->header, HEADER_STAT);
}
+static void
+record__finish_output(struct record *rec)
+{
+ struct perf_data_file *file = &rec->file;
+ int fd = perf_data_file__fd(file);
+
+ if (file->is_pipe)
+ return;
+
+ rec->session->header.data_size += rec->bytes_written;
+ file->size = lseek(perf_data_file__fd(file), 0, SEEK_CUR);
+
+ if (!rec->no_buildid) {
+ process_buildids(rec);
+
+ if (rec->buildid_all)
+ dsos__hit_all(rec->session);
+ }
+ perf_session__write_header(rec->session, rec->evlist, fd, true);
+
+ return;
+}
+
static volatile int workload_exec_errno;
/*
@@ -785,18 +808,8 @@ out_child:
/* this will be recalculated during process_buildids() */
rec->samples = 0;
- if (!err && !file->is_pipe) {
- rec->session->header.data_size += rec->bytes_written;
- file->size = lseek(perf_data_file__fd(file), 0, SEEK_CUR);
-
- if (!rec->no_buildid) {
- process_buildids(rec);
-
- if (rec->buildid_all)
- dsos__hit_all(rec->session);
- }
- perf_session__write_header(rec->session, rec->evlist, fd, true);
- }
+ if (!err)
+ record__finish_output(rec);
if (!err && !quiet) {
char samples[128];
Powered by blists - more mailing lists