diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-07-05 13:16:15 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-07-09 09:13:26 -0400 |
commit | e5653eb82ddc71ad8ffcbb3c74dd6f0c0230ab4c (patch) | |
tree | 9620a795fa21bc14f3f1fcb311f8ddee98b9bff8 | |
parent | 245aec7f7f4ca95b924f005d604bab9d838b5eb1 (diff) |
perf tools: Move get_current_dir_name() cond prototype out of util.h
And in a separate header, so that we erode util.h a bit more.
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-xpzvuu9d0gei9jl9bkzgobln@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/util/get_current_dir_name.c | 6 | ||||
-rw-r--r-- | tools/perf/util/get_current_dir_name.h | 8 | ||||
-rw-r--r-- | tools/perf/util/namespaces.c | 1 | ||||
-rw-r--r-- | tools/perf/util/util.h | 4 |
4 files changed, 12 insertions, 7 deletions
diff --git a/tools/perf/util/get_current_dir_name.c b/tools/perf/util/get_current_dir_name.c index 267aa609a582..01f32f26552d 100644 --- a/tools/perf/util/get_current_dir_name.c +++ b/tools/perf/util/get_current_dir_name.c | |||
@@ -1,8 +1,8 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: LGPL-2.1 |
2 | // Copyright (C) 2018, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> | 2 | // Copyright (C) 2018, 2019 Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> |
3 | // | 3 | // |
4 | #ifndef HAVE_GET_CURRENT_DIR_NAME | 4 | #ifndef HAVE_GET_CURRENT_DIR_NAME |
5 | #include "util.h" | 5 | #include "get_current_dir_name.h" |
6 | #include <unistd.h> | 6 | #include <unistd.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #include <stdlib.h> | 8 | #include <stdlib.h> |
diff --git a/tools/perf/util/get_current_dir_name.h b/tools/perf/util/get_current_dir_name.h new file mode 100644 index 000000000000..69f7d5537d32 --- /dev/null +++ b/tools/perf/util/get_current_dir_name.h | |||
@@ -0,0 +1,8 @@ | |||
1 | // SPDX-License-Identifier: LGPL-2.1 | ||
2 | // Copyright (C) 2018, 2019 Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> | ||
3 | // | ||
4 | #ifndef __PERF_GET_CURRENT_DIR_NAME_H | ||
5 | #ifndef HAVE_GET_CURRENT_DIR_NAME | ||
6 | char *get_current_dir_name(void); | ||
7 | #endif // HAVE_GET_CURRENT_DIR_NAME | ||
8 | #endif // __PERF_GET_CURRENT_DIR_NAME_H | ||
diff --git a/tools/perf/util/namespaces.c b/tools/perf/util/namespaces.c index 023c4efd788d..fda2fa1e8819 100644 --- a/tools/perf/util/namespaces.c +++ b/tools/perf/util/namespaces.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include "namespaces.h" | 7 | #include "namespaces.h" |
8 | #include "util.h" | 8 | #include "util.h" |
9 | #include "event.h" | 9 | #include "event.h" |
10 | #include "get_current_dir_name.h" | ||
10 | #include <sys/types.h> | 11 | #include <sys/types.h> |
11 | #include <sys/stat.h> | 12 | #include <sys/stat.h> |
12 | #include <fcntl.h> | 13 | #include <fcntl.h> |
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 59fe33708090..cfc4d85bbd42 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h | |||
@@ -59,10 +59,6 @@ int fetch_kernel_version(unsigned int *puint, | |||
59 | 59 | ||
60 | const char *perf_tip(const char *dirpath); | 60 | const char *perf_tip(const char *dirpath); |
61 | 61 | ||
62 | #ifndef HAVE_GET_CURRENT_DIR_NAME | ||
63 | char *get_current_dir_name(void); | ||
64 | #endif | ||
65 | |||
66 | #ifndef HAVE_SCHED_GETCPU_SUPPORT | 62 | #ifndef HAVE_SCHED_GETCPU_SUPPORT |
67 | int sched_getcpu(void); | 63 | int sched_getcpu(void); |
68 | #endif | 64 | #endif |