diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-09-11 09:50:26 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-09-13 08:49:16 -0400 |
commit | c23c2a0f236601c635d9a9d18d7993641e72aa8c (patch) | |
tree | 914f529f989ac6ae336ef6bf62ef6216a6d8dab8 | |
parent | 55421b4fb7054f85274b1b6a321e204dac696133 (diff) |
perf tools: Make copyfile_offset() static
There are no usage outside util.c and this is the only remaining reason
for fcntl.h to be included in util.h, to get the loff_t definition in
Alpine Linux, so make it static.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-2dzlsao7k6ihozs5karw6kpx@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/tests/builtin-test.c | 1 | ||||
-rw-r--r-- | tools/perf/util/data.c | 1 | ||||
-rw-r--r-- | tools/perf/util/dso.c | 1 | ||||
-rw-r--r-- | tools/perf/util/event.c | 1 | ||||
-rw-r--r-- | tools/perf/util/evlist.h | 1 | ||||
-rw-r--r-- | tools/perf/util/namespaces.c | 1 | ||||
-rw-r--r-- | tools/perf/util/pmu.c | 1 | ||||
-rw-r--r-- | tools/perf/util/probe-file.c | 1 | ||||
-rw-r--r-- | tools/perf/util/util.c | 3 | ||||
-rw-r--r-- | tools/perf/util/util.h | 2 | ||||
-rw-r--r-- | tools/perf/util/zlib.c | 1 |
11 files changed, 11 insertions, 3 deletions
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c index 377bea009163..d0fee35db0e7 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c | |||
@@ -3,6 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Builtin regression testing command: ever growing number of sanity tests | 4 | * Builtin regression testing command: ever growing number of sanity tests |
5 | */ | 5 | */ |
6 | #include <fcntl.h> | ||
6 | #include <errno.h> | 7 | #include <errno.h> |
7 | #include <unistd.h> | 8 | #include <unistd.h> |
8 | #include <string.h> | 9 | #include <string.h> |
diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c index 263f5a906ba5..1123b30e3033 100644 --- a/tools/perf/util/data.c +++ b/tools/perf/util/data.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <sys/types.h> | 3 | #include <sys/types.h> |
4 | #include <sys/stat.h> | 4 | #include <sys/stat.h> |
5 | #include <errno.h> | 5 | #include <errno.h> |
6 | #include <fcntl.h> | ||
6 | #include <unistd.h> | 7 | #include <unistd.h> |
7 | #include <string.h> | 8 | #include <string.h> |
8 | 9 | ||
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index b9e087fb8247..ffd723179a4b 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <sys/stat.h> | 6 | #include <sys/stat.h> |
7 | #include <unistd.h> | 7 | #include <unistd.h> |
8 | #include <errno.h> | 8 | #include <errno.h> |
9 | #include <fcntl.h> | ||
9 | #include "compress.h" | 10 | #include "compress.h" |
10 | #include "path.h" | 11 | #include "path.h" |
11 | #include "symbol.h" | 12 | #include "symbol.h" |
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 17c21ea68a72..10366b87d0b5 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <dirent.h> | 1 | #include <dirent.h> |
2 | #include <errno.h> | 2 | #include <errno.h> |
3 | #include <fcntl.h> | ||
3 | #include <inttypes.h> | 4 | #include <inttypes.h> |
4 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
5 | #include <linux/types.h> | 6 | #include <linux/types.h> |
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index bf2c4936e35f..b1c14f1fdc27 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/refcount.h> | 6 | #include <linux/refcount.h> |
7 | #include <linux/list.h> | 7 | #include <linux/list.h> |
8 | #include <api/fd/array.h> | 8 | #include <api/fd/array.h> |
9 | #include <fcntl.h> | ||
9 | #include <stdio.h> | 10 | #include <stdio.h> |
10 | #include "../perf.h" | 11 | #include "../perf.h" |
11 | #include "event.h" | 12 | #include "event.h" |
diff --git a/tools/perf/util/namespaces.c b/tools/perf/util/namespaces.c index a58e91197729..5be021701f34 100644 --- a/tools/perf/util/namespaces.c +++ b/tools/perf/util/namespaces.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include "event.h" | 11 | #include "event.h" |
12 | #include <sys/types.h> | 12 | #include <sys/types.h> |
13 | #include <sys/stat.h> | 13 | #include <sys/stat.h> |
14 | #include <fcntl.h> | ||
14 | #include <limits.h> | 15 | #include <limits.h> |
15 | #include <sched.h> | 16 | #include <sched.h> |
16 | #include <stdlib.h> | 17 | #include <stdlib.h> |
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index 7070638ab600..0b11dfc0af44 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
3 | #include <sys/types.h> | 3 | #include <sys/types.h> |
4 | #include <errno.h> | 4 | #include <errno.h> |
5 | #include <fcntl.h> | ||
5 | #include <sys/stat.h> | 6 | #include <sys/stat.h> |
6 | #include <unistd.h> | 7 | #include <unistd.h> |
7 | #include <stdio.h> | 8 | #include <stdio.h> |
diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c index cdf8d83a484c..4ae1123c6794 100644 --- a/tools/perf/util/probe-file.c +++ b/tools/perf/util/probe-file.c | |||
@@ -15,6 +15,7 @@ | |||
15 | * | 15 | * |
16 | */ | 16 | */ |
17 | #include <errno.h> | 17 | #include <errno.h> |
18 | #include <fcntl.h> | ||
18 | #include <sys/stat.h> | 19 | #include <sys/stat.h> |
19 | #include <sys/types.h> | 20 | #include <sys/types.h> |
20 | #include <sys/uio.h> | 21 | #include <sys/uio.h> |
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index 4c360daa4e24..3c9c39711343 100644 --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <sys/stat.h> | 6 | #include <sys/stat.h> |
7 | #include <sys/utsname.h> | 7 | #include <sys/utsname.h> |
8 | #include <dirent.h> | 8 | #include <dirent.h> |
9 | #include <fcntl.h> | ||
9 | #include <inttypes.h> | 10 | #include <inttypes.h> |
10 | #include <signal.h> | 11 | #include <signal.h> |
11 | #include <stdio.h> | 12 | #include <stdio.h> |
@@ -174,7 +175,7 @@ out: | |||
174 | return err; | 175 | return err; |
175 | } | 176 | } |
176 | 177 | ||
177 | int copyfile_offset(int ifd, loff_t off_in, int ofd, loff_t off_out, u64 size) | 178 | static int copyfile_offset(int ifd, loff_t off_in, int ofd, loff_t off_out, u64 size) |
178 | { | 179 | { |
179 | void *ptr; | 180 | void *ptr; |
180 | loff_t pgoff; | 181 | loff_t pgoff; |
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index b136c271125f..03946d5e4741 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h | |||
@@ -5,7 +5,6 @@ | |||
5 | /* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */ | 5 | /* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */ |
6 | #define _DEFAULT_SOURCE 1 | 6 | #define _DEFAULT_SOURCE 1 |
7 | 7 | ||
8 | #include <fcntl.h> | ||
9 | #include <stdbool.h> | 8 | #include <stdbool.h> |
10 | #include <stddef.h> | 9 | #include <stddef.h> |
11 | #include <stdlib.h> | 10 | #include <stdlib.h> |
@@ -35,7 +34,6 @@ bool lsdir_no_dot_filter(const char *name, struct dirent *d); | |||
35 | int copyfile(const char *from, const char *to); | 34 | int copyfile(const char *from, const char *to); |
36 | int copyfile_mode(const char *from, const char *to, mode_t mode); | 35 | int copyfile_mode(const char *from, const char *to, mode_t mode); |
37 | int copyfile_ns(const char *from, const char *to, struct nsinfo *nsi); | 36 | int copyfile_ns(const char *from, const char *to, struct nsinfo *nsi); |
38 | int copyfile_offset(int fromfd, loff_t from_ofs, int tofd, loff_t to_ofs, u64 size); | ||
39 | 37 | ||
40 | ssize_t readn(int fd, void *buf, size_t n); | 38 | ssize_t readn(int fd, void *buf, size_t n); |
41 | ssize_t writen(int fd, const void *buf, size_t n); | 39 | ssize_t writen(int fd, const void *buf, size_t n); |
diff --git a/tools/perf/util/zlib.c b/tools/perf/util/zlib.c index 1329d843eb7b..7c1175310a12 100644 --- a/tools/perf/util/zlib.c +++ b/tools/perf/util/zlib.c | |||
@@ -1,3 +1,4 @@ | |||
1 | #include <fcntl.h> | ||
1 | #include <stdio.h> | 2 | #include <stdio.h> |
2 | #include <unistd.h> | 3 | #include <unistd.h> |
3 | #include <sys/stat.h> | 4 | #include <sys/stat.h> |