lkml.org 
[lkml]   [2019]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 11/25] perf namespaces: Move the conditional setns() prototype to namespaces.h
Date
From: Arnaldo Carvalho de Melo <acme@redhat.com>

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>
---
tools/perf/util/namespaces.h | 4 ++++
tools/perf/util/setns.c | 4 +++-
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 @@
#include <linux/refcount.h>
#include <linux/types.h>

+#ifndef HAVE_SETNS_SUPPORT
+int setns(int fd, int nstype);
+#endif
+
struct namespaces_event;

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 @@
-#include "util.h"
+// SPDX-License-Identifier: LGPL-2.1
+
+#include "namespaces.h"
#include <unistd.h>
#include <sys/syscall.h>

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);
int sched_getcpu(void);
#endif

-#ifndef HAVE_SETNS_SUPPORT
-int setns(int fd, int nstype);
-#endif
-
extern bool perf_singlethreaded;

void perf_set_singlethreaded(void);
--
2.21.0
\
 
 \ /
  Last update: 2019-07-09 20:34    [W:0.237 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site