diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-07-05 12:59:06 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-07-09 09:13:26 -0400 |
commit | 245aec7f7f4ca95b924f005d604bab9d838b5eb1 (patch) | |
tree | 3a1e7b1144592cbe5ee7033cbbc412a29404dabb | |
parent | 215a0d305c5651928eb67c96bcedd0a6c297dfce (diff) |
perf namespaces: Move the conditional setns() prototype to namespaces.h
Out of util.h, to reduce its scope, and since we have a namespaces.h
header, much better to have it there, where it is related to.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-zlu81bbtccuzygh7m8nmgybc@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/util/namespaces.h | 4 | ||||
-rw-r--r-- | tools/perf/util/setns.c | 4 | ||||
-rw-r--r-- | tools/perf/util/util.h | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/tools/perf/util/namespaces.h b/tools/perf/util/namespaces.h index 15a5a276c478..004430c0de93 100644 --- a/tools/perf/util/namespaces.h +++ b/tools/perf/util/namespaces.h | |||
@@ -13,6 +13,10 @@ | |||
13 | #include <linux/refcount.h> | 13 | #include <linux/refcount.h> |
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | 15 | ||
16 | #ifndef HAVE_SETNS_SUPPORT | ||
17 | int setns(int fd, int nstype); | ||
18 | #endif | ||
19 | |||
16 | struct namespaces_event; | 20 | struct namespaces_event; |
17 | 21 | ||
18 | struct namespaces { | 22 | struct namespaces { |
diff --git a/tools/perf/util/setns.c b/tools/perf/util/setns.c index ce8fc290fce8..48f9c0af63b2 100644 --- a/tools/perf/util/setns.c +++ b/tools/perf/util/setns.c | |||
@@ -1,4 +1,6 @@ | |||
1 | #include "util.h" | 1 | // SPDX-License-Identifier: LGPL-2.1 |
2 | |||
3 | #include "namespaces.h" | ||
2 | #include <unistd.h> | 4 | #include <unistd.h> |
3 | #include <sys/syscall.h> | 5 | #include <sys/syscall.h> |
4 | 6 | ||
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 125e215dd3d8..59fe33708090 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h | |||
@@ -67,10 +67,6 @@ char *get_current_dir_name(void); | |||
67 | int sched_getcpu(void); | 67 | int sched_getcpu(void); |
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | #ifndef HAVE_SETNS_SUPPORT | ||
71 | int setns(int fd, int nstype); | ||
72 | #endif | ||
73 | |||
74 | extern bool perf_singlethreaded; | 70 | extern bool perf_singlethreaded; |
75 | 71 | ||
76 | void perf_set_singlethreaded(void); | 72 | void perf_set_singlethreaded(void); |