Skip to content

Commit

Permalink
perf namespaces: Move the conditional setns() prototype to namespaces.h
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arnaldo Carvalho de Melo committed Jul 9, 2019
1 parent 215a0d3 commit 245aec7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions tools/perf/util/namespaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 3 additions & 1 deletion tools/perf/util/setns.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "util.h"
// SPDX-License-Identifier: LGPL-2.1

#include "namespaces.h"
#include <unistd.h>
#include <sys/syscall.h>

Expand Down
4 changes: 0 additions & 4 deletions tools/perf/util/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 245aec7

Please sign in to comment.