Skip to contentSkip to conversation

perf tools: Move get_current_dir_name() cond prototype out of util.h

tip:perf/urgent tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Jul 13, 2019 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  e5653eb82ddc71ad8ffcbb3c74dd6f0c0230ab4c
Gitweb:     https://git.kernel.org/tip/e5653eb82ddc71ad8ffcbb3c74dd6f0c0230ab4c
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Fri, 5 Jul 2019 14:16:15 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 9 Jul 2019 10:13:26 -0300

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.

---
 tools/perf/util/get_current_dir_name.c | 6 +++---
 tools/perf/util/get_current_dir_name.h | 8 ++++++++
 tools/perf/util/namespaces.c           | 1 +
 tools/perf/util/util.h                 | 4 ----
 4 files changed, 12 insertions(+), 7 deletions(-)
tools/perf/util/get_current_dir_name.c +3 -3
index 267aa609a582..01f32f26552d 100644
@@ -1,8 +1,8 @@
-// SPDX-License-Identifier: GPL-2.0
-// Copyright (C) 2018, Red Hat Inc, Arnaldo Carvalho de Melo <[email protected]>
+// SPDX-License-Identifier: LGPL-2.1
+// Copyright (C) 2018, 2019 Red Hat Inc, Arnaldo Carvalho de Melo <[email protected]>
 //
 #ifndef HAVE_GET_CURRENT_DIR_NAME
-#include "util.h"
+#include "get_current_dir_name.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdlib.h>
tools/perf/util/get_current_dir_name.h new file +8 -0
new file mode 100644
index 000000000000..69f7d5537d32
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: LGPL-2.1
+// Copyright (C) 2018, 2019 Red Hat Inc, Arnaldo Carvalho de Melo <[email protected]>
+//
+#ifndef __PERF_GET_CURRENT_DIR_NAME_H
+#ifndef HAVE_GET_CURRENT_DIR_NAME
+char *get_current_dir_name(void);
+#endif // HAVE_GET_CURRENT_DIR_NAME
+#endif // __PERF_GET_CURRENT_DIR_NAME_H
tools/perf/util/namespaces.c +1 -0
index 023c4efd788d..fda2fa1e8819 100644
@@ -7,6 +7,7 @@
 #include "namespaces.h"
 #include "util.h"
 #include "event.h"
+#include "get_current_dir_name.h"
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
tools/perf/util/util.h +0 -4
index 59fe33708090..cfc4d85bbd42 100644
@@ -59,10 +59,6 @@ int fetch_kernel_version(unsigned int *puint,
 
 const char *perf_tip(const char *dirpath);
 
-#ifndef HAVE_GET_CURRENT_DIR_NAME
-char *get_current_dir_name(void);
-#endif
-
 #ifndef HAVE_SCHED_GETCPU_SUPPORT
 int sched_getcpu(void);
 #endif