[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171013083736.15037-6-jolsa@kernel.org>
Date: Fri, 13 Oct 2017 10:37:32 +0200
From: Jiri Olsa <jolsa@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: lkml <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
David Ahern <dsahern@...il.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Andi Kleen <andi@...stfloor.org>,
"Jin, Yao" <yao.jin@...ux.intel.com>,
"Wangnan (F)" <wangnan0@...wei.com>,
"Du, Changbin" <changbin.du@...el.com>
Subject: [PATCH 5/9] perf tools: Add perf_data_file__write function
Adding perf_data_file__write function to provide
single file write operation.
Link: http://lkml.kernel.org/n/tip-c3f9p4xzykr845ktqcek6p4t@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
---
tools/perf/util/data.c | 8 +++++++-
tools/perf/util/data.h | 2 ++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c
index 07ef56a4123c..f80a23d031d6 100644
--- a/tools/perf/util/data.c
+++ b/tools/perf/util/data.c
@@ -144,10 +144,16 @@ void perf_data__close(struct perf_data *data)
close(data->file.fd);
}
+ssize_t perf_data_file__write(struct perf_data_file *file,
+ void *buf, size_t size)
+{
+ return writen(file->fd, buf, size);
+}
+
ssize_t perf_data__write(struct perf_data *data,
void *buf, size_t size)
{
- return writen(data->file.fd, buf, size);
+ return perf_data_file__write(&data->file, buf, size);
}
int perf_data__switch(struct perf_data *data,
diff --git a/tools/perf/util/data.h b/tools/perf/util/data.h
index 1797bed3aa4b..000c43bbb7ac 100644
--- a/tools/perf/util/data.h
+++ b/tools/perf/util/data.h
@@ -50,6 +50,8 @@ int perf_data__open(struct perf_data *data);
void perf_data__close(struct perf_data *data);
ssize_t perf_data__write(struct perf_data *data,
void *buf, size_t size);
+ssize_t perf_data_file__write(struct perf_data_file *file,
+ void *buf, size_t size);
/*
* If at_exit is set, only rename current perf.data to
* perf.data.<postfix>, continue write on original data.
--
2.13.6
Powered by blists - more mailing lists