From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Clark Williams <williams@redhat.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
Jiri Olsa <jolsa@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Alexey Budankov <alexey.budankov@linux.intel.com>,
Andi Kleen <andi@firstfloor.org>,
Namhyung Kim <namhyung@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 11/13] perf util: Make copyfile_offset() global
Date: Wed, 19 Sep 2018 11:25:35 -0300 [thread overview]
Message-ID: <20180919142537.29985-12-acme@kernel.org> (raw)
In-Reply-To: <20180919142537.29985-1-acme@kernel.org>
From: Jiri Olsa <jolsa@kernel.org>
It will be used outside of util object in following patches.
Committer note:
We need to have the header with the definition for loff_t in util.h
since we now use it in the copyfile_offset() signature.
Also move that prototype closer to the other copyfile_ prefixed
functions.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180913125450.21342-10-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/util.c | 2 +-
tools/perf/util/util.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index eac5b858a371..093352e93d50 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -221,7 +221,7 @@ static int slow_copyfile(const char *from, const char *to, struct nsinfo *nsi)
return err;
}
-static int copyfile_offset(int ifd, loff_t off_in, int ofd, loff_t off_out, u64 size)
+int copyfile_offset(int ifd, loff_t off_in, int ofd, loff_t off_out, u64 size)
{
void *ptr;
loff_t pgoff;
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index dc58254a2b69..14508ee7707a 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -6,6 +6,7 @@
/* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */
#define _DEFAULT_SOURCE 1
+#include <fcntl.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
@@ -35,6 +36,7 @@ bool lsdir_no_dot_filter(const char *name, struct dirent *d);
int copyfile(const char *from, const char *to);
int copyfile_mode(const char *from, const char *to, mode_t mode);
int copyfile_ns(const char *from, const char *to, struct nsinfo *nsi);
+int copyfile_offset(int ifd, loff_t off_in, int ofd, loff_t off_out, u64 size);
ssize_t readn(int fd, void *buf, size_t n);
ssize_t writen(int fd, const void *buf, size_t n);
--
2.14.4
next prev parent reply other threads:[~2018-09-19 14:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-19 14:25 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
2018-09-19 14:25 ` [PATCH 01/13] perf: Suppress AUX/OVERWRITE records Arnaldo Carvalho de Melo
2018-09-19 14:25 ` [PATCH 02/13] perf test: Add watchpoint test Arnaldo Carvalho de Melo
2018-09-19 14:25 ` [PATCH 03/13] perf ordered_events: Add 'struct ordered_events_buffer' layer Arnaldo Carvalho de Melo
2018-09-19 14:25 ` [PATCH 04/13] perf ordered_events: Prevent crossing max_alloc_size Arnaldo Carvalho de Melo
2018-09-19 14:25 ` [PATCH 05/13] tools include: Adopt PTR_ERR_OR_ZERO from the kernel err.h header Arnaldo Carvalho de Melo
2018-09-19 14:25 ` [PATCH 06/13] perf bpf-loader: use PTR_ERR_OR_ZERO inetead of return code Arnaldo Carvalho de Melo
2018-09-19 14:25 ` [PATCH 07/13] perf tools: Remove perf_tool from event_op2 Arnaldo Carvalho de Melo
2018-09-19 14:25 ` [PATCH 08/13] perf tools: Remove perf_tool from event_op3 Arnaldo Carvalho de Melo
2018-09-19 14:25 ` [PATCH 09/13] perf auxtrace: Pass struct perf_mmap into mmap__read* functions Arnaldo Carvalho de Melo
2018-09-19 14:25 ` [PATCH 10/13] perf tools: Add 'struct perf_mmap' arg to record__write() Arnaldo Carvalho de Melo
2018-09-19 14:25 ` Arnaldo Carvalho de Melo [this message]
2018-09-19 14:25 ` [PATCH 12/13] perf tools: Initialize perf_data_file fd field Arnaldo Carvalho de Melo
2018-09-19 14:25 ` [PATCH 13/13] perf python: Use -Wno-redundant-decls to build with PYTHON=python3 Arnaldo Carvalho de Melo
2018-09-25 9:21 ` [GIT PULL 00/13] perf/core improvements and fixes Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180919142537.29985-12-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=alexey.budankov@linux.intel.com \
--cc=andi@firstfloor.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).